去除dbus service文件,由systemd拉起可能会带来拉起时间点不对,获取logind session地址失败等问题

This commit is contained in:
liuxinhao 2022-12-19 09:33:22 +08:00
parent 38070a9ae2
commit 83284c80d9
2 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,36 @@
From 74493a9280e5840b394f75d047317c4f68784ad3 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 15 Dec 2022 17:15:40 +0800
Subject: [PATCH] fix(background,logind session): Deleting the dbus service
file and pulling it up by systemd may cause problems, such as incorrect
pulling time and failure to obtain the logind session address
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 去除dbus service文件,由systemd拉起可能会带来拉起时间点不对,获取logind session地址失败等问题
---
CMakeLists.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc48bc4..ee74108 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,7 +113,11 @@ configure_file(data/com.kylinsec.Kiran.ScreenSaver.service.in ${CMAKE_BINARY_DIR
install(TARGETS ${PROJECT_NAME} DESTINATION ${SCREENSAVER_BIN_DIR})
install(FILES ${QM_FILES} DESTINATION ${TRANSLATIONS_INSTALL_DIR})
install(FILES ${DEVEL_HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/kiran-screensaver)
-install(FILES ${CMAKE_BINARY_DIR}/com.kylinsec.Kiran.ScreenSaver.service DESTINATION ${DBUS_SERVICE_INSTALL_DIR})
+#不安装dbus-1 service文件
+#1. 若安装dbus-1service文件,kiran-session-daemon POWER插件可能过早拉起kiran-screensaver导致获取壁纸失败
+#2. 若安装dbus-1service文件,systemd拉起kiran-screensaver可能出现通过Logind Manager的GetSessionByPID方法获取当前logind session dbus地址失败的问题
+#经过考虑,kiran-screensaver只安装xdg/autostart文件,通过会话管理拉起
+#install(FILES ${CMAKE_BINARY_DIR}/com.kylinsec.Kiran.ScreenSaver.service DESTINATION ${DBUS_SERVICE_INSTALL_DIR})
install(FILES data/kiran-screensaver.desktop DESTINATION ${XDG_AUTO_START_DIR})
install(FILES data/kiran-screensaver DESTINATION /${CMAKE_INSTALL_SYSCONFDIR}/pam.d/)
install(FILES data/com.kylinsec.kiran.screensaver.gschema.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas/)
\ No newline at end of file
--
2.33.0

View File

@ -1,12 +1,13 @@
Name: kiran-screensaver
Version: 2.2.2
Release: 1
Release: 2
Summary: Kiran Desktop Screensaver Backend
Summary(zh_CN): kiran桌面屏保后端
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-background-logind-session-Deleting-the-dbus-serv.patch
BuildRequires: gcc-c++
BuildRequires: cmake
@ -60,7 +61,7 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
%{_bindir}/kiran-screensaver
%{_bindir}/kiran-screensaver-command
%{_datadir}/kiran-screensaver/translations/*
%{_datadir}/dbus-1/services/com.kylinsec.Kiran.ScreenSaver.service
#%{_datadir}/dbus-1/services/com.kylinsec.Kiran.ScreenSaver.service
%{_datadir}/glib-2.0/schemas/com.kylinsec.kiran.screensaver.gschema.xml
%files devel
@ -70,6 +71,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
rm -rf %{buildroot}
%changelog
* Thu Dec 15 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.2.2-2
- KYOS-F: Deleting the dbus service file and pulling it up by systemd may cause problems, such as incorrect pulling time and failure to obtain the logind session address
* Mon Dec 05 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.2.2-1
- KYOS-F: Fix the crash caused by window management when the lock screen is inserted and pulled out
- KYOS-F: Use another Gaussian blur interface to avoid the deadlock caused by crash and error release