| Summary: | SDL_VIDEO_CENTERED and OpenGL generating incorrect mouse coordinates | ||
|---|---|---|---|
| Product: | SDL | Reporter: | sa666666 |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | jspradlin, puNES.development, sa666666 |
| Version: | 1.2.14 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | Fix superfluous ConfigureNotify event | ||
I have the same problem when I using SDL_VIDEO_WINDOW_POS environment variable. Thank you for your bug report! We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible. Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot? http://www.libsdl.org/tmp/SDL-1.3.zip Thanks! This patch was applied a few months ago: hg changeset 67d3be4ec9f2. Thanks! --ryan. |
Created attachment 529 [details] Fix superfluous ConfigureNotify event This following description assumes Linux, OpenGL mode, and using the SDL_VIDEO_CENTERED environment variable. When creating a larger screen after initially creating a smaller one, mouse button and motion x/y coordinates are clamped to the smaller size, even when that window no longer exists. I've traced the problem to the new 'SetMouseRange' function in SDL 1.2.14, which clamps the mouse coordinates to the current screen size. However, since this is initiated from a ConfigureNotify event, and that event is received *after* the new (larger) screen is created, the mouse tracking is no longer valid. I've fixed this issue by making sure a ConfigureNotify event isn't generated after an XMoveWindow caused by parsing the SDL_VIDEO_CENTERED variable. Attached is a proposed solution. Hopefully this can be added to release 1.2.15, as I'm not sure how to work around it in my app.