# HG changeset patch # User Sam Lantinga # Date 1254093898 0 # Node ID d9dd6cbba4c03f5adf8ff2b9387fa17f07547540 # Parent 714a352c88698cc4f0d141b49bccc899c211cc51 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 714a352c8869 -r d9dd6cbba4c0 src/video/x11/SDL_x11events.c --- a/src/video/x11/SDL_x11events.c Sat Sep 26 21:39:56 2009 +0000 +++ b/src/video/x11/SDL_x11events.c Sun Sep 27 23:24:58 2009 +0000 @@ -93,16 +93,13 @@ if (xevent.xcrossing.mode == NotifyUngrab) printf("Mode: NotifyUngrab\n"); #endif - if ((xevent.xcrossing.mode != NotifyGrab) && - (xevent.xcrossing.mode != NotifyUngrab)) { #if 1 - /* FIXME: Should we reset data for all mice? */ - for (i = 0; i < SDL_GetNumMice(); ++i) { - SDL_Mouse *mouse = SDL_GetMouse(i); - SDL_SetMouseFocus(mouse->id, data->windowID); - } + /* FIXME: Should we reset data for all mice? */ + for (i = 0; i < SDL_GetNumMice(); ++i) { + SDL_Mouse *mouse = SDL_GetMouse(i); + SDL_SetMouseFocus(mouse->id, data->windowID); + } #endif - } } break; @@ -118,15 +115,13 @@ 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 1 /* FIXME: Should we reset data for all mice? */ - for (i = 0; i < SDL_GetNumMice(); ++i) { - SDL_Mouse *mouse = SDL_GetMouse(i); - SDL_SetMouseFocus(mouse->id, 0); - } + for (i = 0; i < SDL_GetNumMice(); ++i) { + SDL_Mouse *mouse = SDL_GetMouse(i); + SDL_SetMouseFocus(mouse->id, 0); + } #endif } }