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