[SDL] SDL gives incorrect mouse coordinates under Mac OS X

Michael Benfield leftfist at mac.com
Sun Sep 4 14:41:53 PDT 2005

Under Mac OS 10.3 with a recent SDL, I get incorrect mouse coordinates 
for button down events in a specific circumstance. If I pass another 
window over the SDL window, and then draw back that window, and then 
click in the middle of the SDL window, every subsequent click in the 
SDL window until I move the mouse will generate a mouse button down 
event with a Y coordinate of 0 regardless of where the click actually 
is. This doesn't happen under x86 Linux.

I'm including at the end of this email a tiny program that makes it 
easy to reproduce and see the issue.

Mike Benfield


int main(int argc, char** argv)
   SDL_SetVideoMode(400, 400, 32, 0);

   SDL_Event e;
   for(;;) {
       switch(e.type) {
         printf("click x: %d, y: %d\n", e.button.x, e.button.y);
       case SDL_QUIT:
         return 0;

More information about the SDL mailing list