Skip to content

Commit

Permalink
x11: on grabbed hotkey press, send the hotkey's underlying key (xdoto…
Browse files Browse the repository at this point in the history
…ol bug workaround) *only if* the first command is a `Send` or `SendRaw`

In other words, if the hotkey isn't used for sending text (which we assume it isn't if the first command is something else, out of simplicity), it's okay for the key to be eaten up a bit. Doing the Send workaround does send something to X11 after all which could be undesired and should be avoided: See:
Needed for phil294/vimium-everywhere#3
  • Loading branch information
phil294 committed Jul 2, 2023
1 parent 4190bf3 commit 9f976a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/run/display/hotkeys.cr
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ module Run
(! @runner.display.suspended || hotkey.exempt_from_suspension)
end
if hotkey
if ! hotkey.up && ! hotkey.no_grab
# TODO: auto test for this
if ! hotkey.up && ! hotkey.no_grab && (hotkey.cmd.is_a?(Cmd::X11::Keyboard::Send) || hotkey.cmd.is_a?(Cmd::X11::Keyboard::SendRaw))
# Fix https://github.com/jordansissel/xdotool/pull/406#issuecomment-1280013095
key_map = XDo::LibXDo::Charcodemap.new
key_map.code = hotkey.keycode
Expand Down

0 comments on commit 9f976a5

Please sign in to comment.