# HG changeset patch # User Sam Lantinga # Date 1254093777 0 # Node ID 5a203e2b01622a2d0ccbd6905631a9a21424d3a3 # Parent 8afecb86be35e8e26365a1c0c7af99a669e4547b Fixed bug #716 Armin Burgmeier 2009-03-15 04:35:45 PDT When I hold a mouse button down on another (non-SDL) window, then move the mouse over an SDL window and releasing the mouse button there, then the application does not receive an SDL_ACTIVEEVENT with state SDL_APPMOUSEFOCUS and gain 1. Furthermore, SDL_GetAppState() reports the application not having mouse focus until moving the mouse out of the window and back in again. diff -r 8afecb86be35 -r 5a203e2b0162 src/video/x11/SDL_x11events.c --- a/src/video/x11/SDL_x11events.c Sun Sep 27 22:41:34 2009 +0000 +++ b/src/video/x11/SDL_x11events.c Sun Sep 27 23:22:57 2009 +0000 @@ -423,15 +423,12 @@ if ( xevent.xcrossing.mode == NotifyUngrab ) printf("Mode: NotifyUngrab\n"); #endif - if ( (xevent.xcrossing.mode != NotifyGrab) && - (xevent.xcrossing.mode != NotifyUngrab) ) { - if ( this->input_grab == SDL_GRAB_OFF ) { - posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); - } - posted = SDL_PrivateMouseMotion(0, 0, - xevent.xcrossing.x, - xevent.xcrossing.y); + if ( this->input_grab == SDL_GRAB_OFF ) { + posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); } + posted = SDL_PrivateMouseMotion(0, 0, + xevent.xcrossing.x, + xevent.xcrossing.y); } break; @@ -444,9 +441,7 @@ if ( xevent.xcrossing.mode == NotifyUngrab ) printf("Mode: NotifyUngrab\n"); #endif - if ( (xevent.xcrossing.mode != NotifyGrab) && - (xevent.xcrossing.mode != NotifyUngrab) && - (xevent.xcrossing.detail != NotifyInferior) ) { + if ( xevent.xcrossing.detail != NotifyInferior ) { if ( this->input_grab == SDL_GRAB_OFF ) { posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); } else {