!105 修复锁屏时两次调用blockGlobalShortcuts的问题

Merge pull request !105 from liudunfa/openkylin/nile
This commit is contained in:
杨敏 2024-10-31 07:46:01 +00:00 committed by openkylin-cibot
parent 62c77ba27b
commit 16575180a3
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From: =?utf-8?b?5p2o5pWP?= <yangmin@kylinos.cn>
Date: Thu, 31 Oct 2024 07:46:01 +0000
Subject: =?utf-8?b?ITEwNSDkv67lpI3plIHlsY/ml7bkuKTmrKHosIPnlKhibG9ja0dsb2Jh?=
=?utf-8?b?bFNob3J0Y3V0c+eahOmXrumimCBNZXJnZSBwdWxsIHJlcXVlc3QgITEwNSBmcm9t?=
=?utf-8?b?IGxpdWR1bmZhL29wZW5reWxpbi9uaWxl?=
---
src/lock-backend/dbusupperinterface.cpp | 6 +++++-
src/lock-backend/dbusupperinterface.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/lock-backend/dbusupperinterface.cpp b/src/lock-backend/dbusupperinterface.cpp
index 90dac4f..940d699 100644
--- a/src/lock-backend/dbusupperinterface.cpp
+++ b/src/lock-backend/dbusupperinterface.cpp
@@ -623,7 +623,11 @@ void DbusUpperInterface::emitLockState(bool val)
{
qDebug() << "emitLockState state = " << val;
- m_kglobalHelper->blockShortcut(val);
+ if (val != m_bBlockShortcutState) {
+ m_kglobalHelper->blockShortcut(val);
+ m_bBlockShortcutState = val;
+ qDebug() << " block all shortcut " << "blockShortcut states = " << m_bBlockShortcutState;
+ }
QDBusMessage message;
if (val) {
diff --git a/src/lock-backend/dbusupperinterface.h b/src/lock-backend/dbusupperinterface.h
index 6070942..67302bb 100644
--- a/src/lock-backend/dbusupperinterface.h
+++ b/src/lock-backend/dbusupperinterface.h
@@ -428,6 +428,7 @@ private:
QByteArray pubKey, priKey;
KglobalAccelHelper *m_kglobalHelper = nullptr;
LibinputSwitchEvent *m_libinputSwitchEvent = nullptr;
+ bool m_bBlockShortcutState = false;
};
#endif // DBUSUPPERINTERFACE_H

View File

@ -65,3 +65,4 @@
0065-102-fixbug.patch 0065-102-fixbug.patch
0066-103-fixbug.patch 0066-103-fixbug.patch
0067-104-fixbug.patch 0067-104-fixbug.patch
0068-105-blockGlobalShortcuts.patch