Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pressing the power button opened the lock screen #637

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ install: build install-dde-data install-icons
cp -r misc/dsg-configs/*.json ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/

cp -f misc/scripts/dde-lock.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
cp -f misc/scripts/dde-shutdown.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
install-dde-data:
mkdir -pv ${DESTDIR}${PREFIX}/share/dde/
cp -r misc/data misc/zoneinfo ${DESTDIR}${PREFIX}/share/dde/
Expand Down
2 changes: 1 addition & 1 deletion keybinding/special_keycode.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (m *Manager) handlePower() {
}
m.systemTurnOffScreen()
case powerActionShowUI:
cmd := "/usr/lib/deepin-daemon/dde-lock.sh"
cmd := "/usr/lib/deepin-daemon/dde-shutdown.sh"
go func() {
locked, err := m.sessionManager.Locked().Get(0)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion misc/scripts/dde-lock.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');setxkbmap -option grab:break_actions&&xdotool key XF86Ungrab&&dbus-send --print-reply --dest=org.deepin.dde.LockFront1 /org/deepin/dde/LockFront1 org.deepin.dde.LockFront1.Show; setxkbmap -option $originmap
originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');
setxkbmap -option grab:break_actions &&
xdotool key XF86Ungrab &&
dbus-send --print-reply --dest=org.deepin.dde.LockFront1 /org/deepin/dde/LockFront1 org.deepin.dde.LockFront1.Show
setxkbmap -option $originmap
7 changes: 7 additions & 0 deletions misc/scripts/dde-shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

originmap=$(setxkbmap -query | grep option | awk -F ' ' '{print $2}');
setxkbmap -option grab:break_actions &&
xdotool key XF86Ungrab &&
dbus-send --print-reply --dest=org.deepin.dde.ShutdownFront1 /org/deepin/dde/ShutdownFront1 org.deepin.dde.ShutdownFront1.Show
setxkbmap -option $originmap
Loading