Skip to content

Commit 51da6c6

Browse files
yixinsharkdeepin-bot[bot]
authored andcommitted
fix: x11 shutdown plugin menu function
as title Log: as title
1 parent 61b5570 commit 51da6c6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

applets/dde-shutdown/shutdownapplet.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "treelandlockscreen.h"
77

88
#include <QDebug>
9+
#include <QProcess>
910
#include <QGuiApplication>
1011

1112
#include <DDBusSender>
@@ -54,12 +55,16 @@ bool ShutdownApplet::requestShutdown(const QString &type)
5455
m_lockscreen->shutdown();
5556
}
5657
} else {
57-
DDBusSender()
58+
if (type == QStringLiteral("Lock")) {
59+
QProcess::execute("bash -c \"originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');/usr/bin/setxkbmap -option grab:break_actions&&/usr/bin/xdotool key XF86Ungrab&&dbus-send --print-reply --dest=org.deepin.dde.LockFront1 /org/deepin/dde/LockFront1 org.deepin.dde.LockFront1.Show&&setxkbmap -option $originmap\"");
60+
} else {
61+
DDBusSender()
5862
.service("org.deepin.dde.ShutdownFront1")
5963
.interface("org.deepin.dde.ShutdownFront1")
6064
.path("/org/deepin/dde/ShutdownFront1")
61-
.method("Show")
65+
.method(type)
6266
.call();
67+
}
6368
}
6469

6570
return true;

0 commit comments

Comments
 (0)