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

This commit is contained in:
liudunfa 2024-10-30 18:49:12 +08:00
parent b44b8d323b
commit d79eccce34
2 changed files with 6 additions and 1 deletions

View File

@ -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) {

View File

@ -428,6 +428,7 @@ private:
QByteArray pubKey, priKey;
KglobalAccelHelper *m_kglobalHelper = nullptr;
LibinputSwitchEvent *m_libinputSwitchEvent = nullptr;
bool m_bBlockShortcutState = false;
};
#endif // DBUSUPPERINTERFACE_H