mirror of
https://github.com/storytold/winit.git
synced 2026-11-25 13:50:47 +01:00
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, the `CursorMoved` event sent alongside `Focused` now uses the correct device ID; it previously used the ID of a master keyboard, but now uses the ID of the pointer paired to that keyboard. Note that for those using multi-pointer X, the correctness of this ID is dependent on the correctness of the window manager's focus model.