| Summary: | Bogus coords in mousedown on Mac OS X | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ryan C. Gordon <icculus> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | cwalther |
| Version: | 1.2.9 | ||
| Hardware: | PowerPC | ||
| OS: | Mac OS X (All) | ||
| Bug Depends on: | 720 | ||
| Bug Blocks: | |||
| Attachments: | Patch to fix the problem. | ||
|
Description
Ryan C. Gordon
2006-01-03 11:55:07 UTC
(This may be fixed in the latest CVS...pleases test!) --ryan. I can reproduce what's probably this problem here with both SDL 1.2.8 from Fink and my recent (but not completely up-to-date) CVS version. The issue seems to be that SDL's internal mouse location is not updated when the SDL window is brought to the front by clicking into it, it's still what it was when the application was switched away from (until the first mouse motion event comes in). If you switched away from the application by clicking into some other window, that's somewhere at the edge of the SDL window, e.g. with a y coordinate of 0. If you switch away using cmd-tab, it can be in the middle of the window. Solutions could be updating the internal mouse location when the application becomes active, or doing it on mousedown events. Created attachment 25 [details]
Patch to fix the problem.
Here's a simple patch that fixes the problem (at least the one I described, which I hope is the one the original poster meant) by updating SDL's mouse location when the application is activated.
(I'll post a separate patch shortly that contains a lot more changes to SDL's activation/deactivation handling.)
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL. --ryan. This patch is in CVS now. --ryan. |