wlroots icon indicating copy to clipboard operation
wlroots copied to clipboard

button_count is corrupted when no pointer release is encountered

Open norcalli opened this issue 6 years ago • 2 comments

I am writing a program and I had it use right click as a means of exiting the event loop. I was trying to validate my serial to initiate a drag and drop and noticed that the serial in sway debug logs weren't being validated, but the button_count also seemed incorrect. It also kept incrementing.

I realized that by using right click to exit the program, button_count wasn't being decremented.

Tracking increments and decrements seems like it is a difficult balance act and could easily get corrupted if we encounter a state which is unaccounted for, so it seems like there needs to be an appropriate point at which we should reset button_count so as to at least have a catch-all in case we screw up.

In this case, if the surface originating a pointer event is destroyed, then it makes sense to reset the state.


wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1716

norcalli avatar Jun 07 '19 22:06 norcalli

potentially related to swaywm/sway#4168

norcalli avatar Jun 07 '19 22:06 norcalli

Related: https://github.com/swaywm/wlroots/issues/1593

emersion avatar Jun 08 '19 07:06 emersion