Skip to content

Commit

Permalink
fix Hotkey, LButton, OFF / fix mouse button ungrabbing
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Jul 11, 2023
1 parent b261c2d commit 99837bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/run/display/x11.cr
Expand Up @@ -354,7 +354,11 @@ module Run
@mutex.lock
@hotkeys.delete hotkey if unsubscribe
hotkey.modifier_variants.each do |mod|
@display.ungrab_key(hotkey.keycode, mod, grab_window: from_window)
if hotkey.keysym < 10
@display.ungrab_button(hotkey.keycode, mod, grab_window: @root_win)
else
@display.ungrab_key(hotkey.keycode, mod, grab_window: from_window)
end
end
@mutex.unlock
@flush_event_queue.send(nil)
Expand Down
8 changes: 6 additions & 2 deletions tests.ahk
Expand Up @@ -3,7 +3,7 @@
; Right now, only commands that can be easily tested in 1-2 lines are tested.
;;;;;;;;;;;;;;;;;;;;;;

N_TESTS = 55
N_TESTS = 56

GoSub, run_tests
if tests_run != %N_TESTS%
Expand Down Expand Up @@ -669,6 +669,10 @@ key = xbutton2
xdotool_run = click 9
gosub test_hotkey_success

key = lbUTton
xdotool_run = click 1
gosub test_hotkey_success

key = a
xdotool_run = key a
hotkey_send = bcd
Expand All @@ -685,7 +689,7 @@ hokey_send_raw =

; ;;;;;;;;;;

Send, {LButton}
Send, {LButTon}
sleep 50
expect = send {lbutton},gui_button_clicked_success,1
gosub assert
Expand Down

0 comments on commit 99837bf

Please sign in to comment.