Cleaned up the mouse window focus handling: you always pass in the relative window when sending a mouse event.

Fixed a bug where only mouse wheel up was sent on Mac OS X
Fixed a bug where mouse window focus was getting hosed by the fullscreen mouse code on Mac OS X
This commit is contained in:
Sam Lantinga 2010-07-05 22:48:13 -07:00
parent 8cafde92ae
commit 320eb4600b
6 changed files with 50 additions and 30 deletions

View file

@ -272,17 +272,17 @@ X11_DispatchEvent(_THIS)
#ifdef DEBUG_MOTION
printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
#endif
SDL_SendMouseMotion(0, xevent.xmotion.x, xevent.xmotion.y);
SDL_SendMouseMotion(data->window, 0, xevent.xmotion.x, xevent.xmotion.y);
}
break;
case ButtonPress:{
SDL_SendMouseButton(SDL_PRESSED, xevent.xbutton.button);
SDL_SendMouseButton(data->window, SDL_PRESSED, xevent.xbutton.button);
}
break;
case ButtonRelease:{
SDL_SendMouseButton(SDL_RELEASED, xevent.xbutton.button);
SDL_SendMouseButton(data->window, SDL_RELEASED, xevent.xbutton.button);
}
break;