Skip to content

Commit

Permalink
x11: Always use correct window ID for XInput2 events
Browse files Browse the repository at this point in the history
The `CursorMoved` events that are used to send position updates alongside `Focused` and
`CursorEntered` events were using incorrect values for the window ID. This is a direct
result of the X11 backend being hard to understand, as those values came from variables in
the top-level scope of the function, which one would assume to be valid throughout the
entirety of their scope. In reality, their validity is dependent on the event belonging to
the `XEvent` union, so very surprising things can happen if those variables are read in the
case of XInput2/XKB/etc. events. To prevent future accidents, the aforementioned variables
have been removed, and are now defined per-event instead.

Additionally, `Focused` is now accompanied by a `CursorMoved` for every master pointer
positioned within the window, and `CursorLeft` for any master pointers that were previously
in the window but left without previously sending `CursorLeft`. The old implementation
provided invalid device IDs and lacked multi-pointer awareness.
  • Loading branch information
francesca64 committed Dec 28, 2017
1 parent 198d9ff commit 51ad6a8
Show file tree
Hide file tree
Showing 2 changed files with 393 additions and 152 deletions.
Loading

0 comments on commit 51ad6a8

Please sign in to comment.