Skip to content

Commit 29beed7

Browse files
committed
fix: pressing the shortcut key will hide the launchpad
grab key 的 keyboard mode 改为 sync mode Deps: linuxdeepin/go-x11-client#36 Issues: linuxdeepin/developer-center#5989
1 parent 0765e2e commit 29beed7

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

keybinding/shortcuts/key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ func (k Key) Ungrab(conn *x.Conn) {
7878

7979
func (k Key) Grab(conn *x.Conn) error {
8080
rootWin := conn.GetDefaultScreen().Root
81-
return keybind.GrabChecked(conn, rootWin, uint16(k.Mods), x.Keycode(k.Code))
81+
return keybind.GrabCheckedV2(conn, rootWin, uint16(k.Mods), x.Keycode(k.Code), x.GrabModeAsync, x.GrabModeSync)
8282
}

keybinding/shortcuts/shortcut_manager.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ func (sm *ShortcutManager) EventLoop() {
775775
for ev := range eventChan {
776776
switch ev.GetEventCode() {
777777
case x.KeyPressEventCode:
778+
x.UngrabKeyboardChecked(sm.conn, x.TimeCurrentTime).Check(sm.conn)
779+
778780
event, _ := x.NewKeyPressEvent(ev)
779781
logger.Debug(event)
780782
sm.handleKeyEvent(true, event.Detail, event.State)

0 commit comments

Comments
 (0)