| Summary: | Mouse focus is 0 if exiting fullscreen overlaps mouse button event while in relative mouse mode. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jason Wyatt <jwyatt> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | jwyatt |
| Version: | 2.0.4 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Demo for mouse focus loss. | ||
Created attachment 2527 [details] Demo for mouse focus loss. While in SDL_WINDOW_FULLSCREEN_DESKTOP mode, with relative mouse mode enabled. If a mouse button down event triggers switching to windowed mode, the following sequence of events causes the current mouse focus to be NULL. - Mouse button down event, at a point outside where the window will be. - Leave fullscreen, causing resize. - (LeaveNotify and EnterNotify cause mouse focus to be lost and gained again, however relative mouse mode prevents this being used to update coordinates). - Mouse button up event. Coordinates have not been updated, so this calls SDL_UpdateMouseFocus with coordinates outside the window, resulting in the mouse focus being set to NULL. Mouse focus won't be reset until the next EnterNotify event or similar (e.g. alt-tabbing out then in again). (Again, relative mouse mode prevents the focus being updated in SDL_SendMouseMotion) Seen in Fedora 23, under Gnome. Demo attached - move the cursor to some large coordinates and click (being careful not to move the mouse during the click, as this may cause the mouse position to be updated.) The mouse motion events will report a window id of 0, despite the window still having the mouse grab. Also alt-tabbing to other programs may be broken, because SDL won't properly release the mouse.