From 786046f77924aed18ec7c85f62df8be37c1c6b04 Mon Sep 17 00:00:00 2001 From: tangjie02 Date: Tue, 12 Sep 2023 20:38:11 +0800 Subject: [PATCH] Ignore the cancel shutdown request Signed-off-by: tangjie02 --- ...p-Ignore-the-cancel-shutdown-request.patch | 68 +++++++++++++++++++ kiran-session-manager.spec | 6 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch diff --git a/0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch b/0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch new file mode 100644 index 0000000..7c19209 --- /dev/null +++ b/0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch @@ -0,0 +1,68 @@ +From 9c06f60de67e54bd835e66d1b1adca9e370f0b2b Mon Sep 17 00:00:00 2001 +From: tangjie02 +Date: Tue, 12 Sep 2023 20:29:06 +0800 +Subject: [PATCH] fix(xsmp): Ignore the cancel shutdown request. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 用于响应客户端取消结束会话的事件不能通知到用户,会导致开始菜单注销按钮功能不能正常使用,影响用户体验,因此暂时禁止处理该请求 + +Signed-off-by: tangjie02 +--- + src/core/inhibitor-manager.cpp | 13 ++++++++++--- + src/core/session-manager.cpp | 7 ++++--- + 2 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/src/core/inhibitor-manager.cpp b/src/core/inhibitor-manager.cpp +index b42b57d..552929a 100644 +--- a/src/core/inhibitor-manager.cpp ++++ b/src/core/inhibitor-manager.cpp +@@ -129,9 +129,8 @@ void InhibitorManager::deleteInhibitorsWithStartupID() + + bool InhibitorManager::hasInhibitor(uint32_t flags) + { +- auto iter = std::find_if(this->m_inhibitors.begin(), this->m_inhibitors.end(), [flags](QSharedPointer iter) { +- return ((flags & iter->flags) == flags); +- }); ++ auto iter = std::find_if(this->m_inhibitors.begin(), this->m_inhibitors.end(), [flags](QSharedPointer iter) ++ { return ((flags & iter->flags) == flags); }); + + return (iter != this->m_inhibitors.end()); + } +@@ -147,6 +146,14 @@ bool InhibitorManager::addInhibitor(QSharedPointer inhibitor) + + KLOG_DEBUG() << "Cookie: " << inhibitor->cookie; + ++ KLOG_DEBUG() << "Add a new inhibitor," ++ << " cookie: " << inhibitor->cookie ++ << ", appid: " << inhibitor->appID ++ << ", flags: " << inhibitor->flags ++ << ", reason: " << inhibitor->reason ++ << ", startupID: " << inhibitor->startupID ++ << ", toplevelXID: " << inhibitor->toplevelXID; ++ + if (this->m_inhibitors.find(inhibitor->cookie) != this->m_inhibitors.end()) + { + KLOG_WARNING() << "The inhibitor " << inhibitor->cookie << " already exist."; +diff --git a/src/core/session-manager.cpp b/src/core/session-manager.cpp +index 6ca79be..b5bdb57 100644 +--- a/src/core/session-manager.cpp ++++ b/src/core/session-manager.cpp +@@ -486,9 +486,10 @@ void SessionManager::onInteractDone(Client *client) + + void SessionManager::onShutdownCanceled(Client *client) + { +- KLOG_DEBUG() << "Client: " << client->getID() << " cancels shutdown."; +- +- this->cancelEndSession(); ++ KLOG_WARNING() << "Client: " << client->getID() << " want to cancels shutdown. ignore the client request."; ++ /* 如果QT的窗口在closeEvent函数中调用event->ignore()来忽略窗口关闭事件,则桌面会话退出时会收到QT客户端发送的取消结束会话的事件, ++ 用于响应客户端取消结束会话的事件不能通知到用户,会导致开始菜单->注销按钮功能不能正常使用,影响用户体验,因此暂时禁止处理该请求。*/ ++ // this->cancelEndSession(); + } + + void SessionManager::onEndSessionPhase2Request(Client *client) +-- +2.36.1 + diff --git a/kiran-session-manager.spec b/kiran-session-manager.spec index aa5b3a7..5cb9e5e 100644 --- a/kiran-session-manager.spec +++ b/kiran-session-manager.spec @@ -1,6 +1,6 @@ Name: kiran-session-manager Version: 2.5.0 -Release: 9 +Release: 10 Summary: Session manager for KIRAN desktop environment License: MulanPSL-2.0 @@ -11,6 +11,7 @@ Patch1001: 0001-feature-session-Add-always-show-exit-window-flag.patch Patch1002: 0001-Add-Type-Application-in-kiran-session-idlemonitor.de.patch Patch1003: 0001-fix-boot-Fix-fork-other-session-program-failed-by-ad.patch Patch1004: 0001-fix-kiran-session-manager-fixes-link-Qt5DBus-error.patch +Patch1005: 0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch BuildRequires: cmake >= 3.2 BuildRequires: pkgconfig(gio-unix-2.0) @@ -94,6 +95,9 @@ fi %changelog +* Tue Sep 12 2023 tangjie02 - 2.5.0-10 +- KYOS-F: 0001-fix-xsmp-Ignore-the-cancel-shutdown-request.patch. + * Mon Sep 11 2023 longcheng - 2.5.0-9 - KYOS-B: change BuildRequires in redhat 7 (#14460) -- Gitee