72 lines
2.7 KiB
Diff
72 lines
2.7 KiB
Diff
From 49da14ad556935f475a538090a7c3648485d3485 Mon Sep 17 00:00:00 2001
|
|
From: huangjiawen <huangjiawen@kylinsec.com.cn>
|
|
Date: Wed, 31 May 2023 17:31:48 +0800
|
|
Subject: [PATCH] feature(session): Add always show exit window flag.
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
- 添加总是显示退出窗口标志位
|
|
|
|
Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
|
|
---
|
|
data/com.kylinsec.kiran.session-manager.gschema.xml.in | 6 +++++-
|
|
include/ksm-i.h | 4 +++-
|
|
src/core/session-manager.cpp | 3 ++-
|
|
3 files changed, 10 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/data/com.kylinsec.kiran.session-manager.gschema.xml.in b/data/com.kylinsec.kiran.session-manager.gschema.xml.in
|
|
index b71dd3e..313d055 100644
|
|
--- a/data/com.kylinsec.kiran.session-manager.gschema.xml.in
|
|
+++ b/data/com.kylinsec.kiran.session-manager.gschema.xml.in
|
|
@@ -15,6 +15,10 @@
|
|
<default>true</default>
|
|
<description>Whether lock screen when the computer is hibernate.</description>
|
|
</key>
|
|
- </schema>
|
|
|
|
+ <key name="always-show-exit-window" type="b">
|
|
+ <default>false</default>
|
|
+ <description>Set whether to always show the exit window.</description>
|
|
+ </key>
|
|
+ </schema>
|
|
</schemalist>
|
|
diff --git a/include/ksm-i.h b/include/ksm-i.h
|
|
index ca4bb86..fb49a59 100644
|
|
--- a/include/ksm-i.h
|
|
+++ b/include/ksm-i.h
|
|
@@ -42,6 +42,8 @@ extern "C"
|
|
#define KSM_SCHEMA_KEY_SCREEN_LOCKED_WHEN_SUSPEND "screen-locked-when-suspend"
|
|
// 休眠时是否锁定屏幕
|
|
#define KSM_SCHEMA_KEY_SCREEN_LOCKED_WHEN_HIBERNATE "screen-locked-when-hibernate"
|
|
+// 退出时是否显示退出窗口
|
|
+#define KSM_SCHEMA_KEY_ALWAYS_SHOW_EXIT_WINDOW "always-show-exit-window"
|
|
|
|
// JK: json key
|
|
#define KSM_INHIBITOR_JK_COOKIE "cookie"
|
|
@@ -96,4 +98,4 @@ extern "C"
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
-#endif
|
|
\ No newline at end of file
|
|
+#endif
|
|
diff --git a/src/core/session-manager.cpp b/src/core/session-manager.cpp
|
|
index 12dcc15..6ca79be 100644
|
|
--- a/src/core/session-manager.cpp
|
|
+++ b/src/core/session-manager.cpp
|
|
@@ -725,8 +725,9 @@ void SessionManager::queryEndSessionComplete()
|
|
this->m_waitingClientsTimeoutID->disconnect();
|
|
this->m_waitingClientsTimeoutID->stop();
|
|
|
|
+ auto showExitWindow = this->m_settings->get(KSM_SCHEMA_KEY_ALWAYS_SHOW_EXIT_WINDOW).toBool();
|
|
// 如果不存在退出会话的抑制器,则直接进入下一个阶段
|
|
- if (!this->m_inhibitorManager->hasInhibitor(KSMInhibitorFlag::KSM_INHIBITOR_FLAG_QUIT))
|
|
+ if (!showExitWindow && !this->m_inhibitorManager->hasInhibitor(KSMInhibitorFlag::KSM_INHIBITOR_FLAG_QUIT))
|
|
{
|
|
this->startNextPhase();
|
|
return;
|
|
--
|
|
2.33.0
|
|
|