sway: bindsym to mouse button release doesn't work

I’ve found that I am unable to bind to the release of mouse buttons.

Steps to reproduce:

  1. Bind command to spare mouse button with bindsym --whole-window --release
  2. Refresh config (same after restart too)
  3. Press mouse button that was bound
  4. Nothing happens

Additional info

  • In my example I used the BTN_EXTRA button, this was found via libinput debug-events
  • Binding to the normal press of a mouse button works
  • Binding to the release of a keyboard key works

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 5
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@Xyene This issue seems to persists in version 1.5-e5913f81 on arch

I tried to do this:

bindsym --whole-window BTN_FORWARD seat - cursor press button1
bindsym --whole-window --release BTN_FORWARD seat - cursor release button1

both wev and libinput debug-events seem to register both BTN_FORWARD events, but the cursor release never seems to occur. I’ve tried mapping seat - cursor release button1 to a separate key (without --release), which worked flawlessly

OK, I understand what’s going on now.

Release bindings are triggered only when the release hits seatop_default. When clicking a window, the press goes through seatop_default (and the press binding gets fired), before starting seatop_down. seatop_down receives the eventual release event and resets to seatop_default, but since the release didn’t go through seatop_default, the binding isn’t fired.

Pressing and releasing on an empty workspace will trigger the release binding, since we never enter seatop_down in that case – which is why I wasn’t able to reproduce it in https://github.com/swaywm/sway/issues/5333#issuecomment-646762263.