sway icon indicating copy to clipboard operation
sway copied to clipboard

`bindsym` for mouse buttons causes single release event to be emitted

Open mvforell opened this issue 1 year ago • 2 comments

Please fill out the following:

  • Sway Version: 1.7

  • Configuration File:

[...]
bindsym q exec echo 'hi'
bindsym --whole-window BTN_LEFT exec echo 'hi'
[...]
  • Description:
    • Run wev
    • Press the Q button on the keyboard: no events are recorded
    • Press the left mouse button: a release event is recorded (there was no press event)

As expected, pressing Q generates no events. The same should happen when pressing the left button on the mouse.

I tested with different mouse buttons (BTN_RIGHT, BTN_MIDDLE, BTN_EXTRA, BTN_SIDE, BTN_FORWARD), and they all showed the same behaviour.

mvforell avatar Oct 17 '22 13:10 mvforell

I reproduced this but I'm not clear it's a bug.

I have bound "Super+D" and "Control+Super+E" in sway. When I use these with the wev window focused, The logs show that the modifiers were used, but I don't see mention of "e" or "d" there. It's clear to me exactly which keys I should expect to show up in wev.

Aside for testing with wev, is there some other indication that "release" events are being emitted in a way that's problematic?

markstos avatar Nov 05 '22 23:11 markstos

I think the behaviour you describe regarding the modifiers is expected. However, this bug I reported applies only to mouse buttons afaict.

I discovered this bug after I bound the "Back" mouse button to change the volume instead. Some applications (e.g. Chrome) seem to interpret the single release event as if the mouse button was clicked normally, and then take action (e.g. Chrome goes back to the last visited page). This is arguably also a bug in these applications, but I think it should be fixed in Sway as well.

mvforell avatar Nov 07 '22 11:11 mvforell