We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 889

Summary: MacOS mouse positioning anomaly
Product: SDL Reporter: Mike <michrublev>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2    
Version: HG 2.0   
Hardware: Other   
OS: Mac OS X (All)   

Description Mike 2009-11-19 01:16:29 UTC
Running windowed application under Mac OS X I have some strange behaviour for mouse (cursor) coordinates:

It returns event.button.x = 0; event.button.y = 0 in SDL_MOUSEBUTTONDOWN (/UP | SDL_MOUSEMOTION) when clicking created window. But after I move window (dragging its caption) or under another undefined conditions (I can't figure out what exactly) it begins to return non-zero values (that is still incorrect)

Trying to click on [0,0] pixel - returns [60,10] or so.
Moving window to the most-left position on the screen - x is ok, y - incorrect
Maximised window - works normal (get correct coordinates)
Moving to the right side or on the second display (even when maximised) - totally incorrect coordinates.

It seems that I can get correct coordinates only when window is at the most top-left edge on the first display.

Window is created with SDL_WINDOWPOS_CENTERED and SDL_WINDOW_RESIZABLE flags.

--Mike
Comment 1 Sam Lantinga 2009-12-03 00:57:40 UTC
I think this is fixed in the latest SDL 1.3 snapshot:
http://www.libsdl.org/tmp/SDL-1.3.zip

Can you give it a try and let me know if this is fixed?
Comment 2 Mike 2009-12-07 04:38:54 UTC
The problem was fixed, thanks!

--Mike