锁屏时调用kwin的blockGlobalShortcuts来屏蔽快捷键

This commit is contained in:
liuyuanpeng 2022-07-19 11:06:39 +08:00
parent 3e4413205c
commit 1c79f46ff7
2 changed files with 7 additions and 0 deletions

View File

@ -17,3 +17,4 @@ X-UKUI-Bugzilla-Product=ukui-screensaver
X-UKUI-Bugzilla-Component=general
X-UKUI-Bugzilla-Version=1.0.0
OnlyShowIn=UKUI
X-UKUI-AutoRestart=true

View File

@ -86,6 +86,12 @@ void Interface::SetLockState()
void Interface::emitLockState(bool val)
{
qDebug()<<"emitLockState state = "<<val;
QDBusInterface interface("org.kde.KWin",
"/kglobalaccel",
"org.kde.KGlobalAccel",
QDBusConnection::sessionBus());
interface.call("blockGlobalShortcuts",val);
QDBusMessage message;
if(val){
message = QDBusMessage::createSignal(SS_DBUS_PATH,