From d79eccce340e817beba69139c813f1b5eb3b06af Mon Sep 17 00:00:00 2001 From: liudunfa Date: Wed, 30 Oct 2024 18:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=81=E5=B1=8F=E6=97=B6?= =?UTF-8?q?=E4=B8=A4=E6=AC=A1=E8=B0=83=E7=94=A8blockGlobalShortcuts?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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