Commit 8349cf08 authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403927
parent bb9b9834
...@@ -93,16 +93,13 @@ X11_DispatchEvent(_THIS) ...@@ -93,16 +93,13 @@ X11_DispatchEvent(_THIS)
if (xevent.xcrossing.mode == NotifyUngrab) if (xevent.xcrossing.mode == NotifyUngrab)
printf("Mode: NotifyUngrab\n"); printf("Mode: NotifyUngrab\n");
#endif #endif
if ((xevent.xcrossing.mode != NotifyGrab) &&
(xevent.xcrossing.mode != NotifyUngrab)) {
#if 1 #if 1
/* FIXME: Should we reset data for all mice? */ /* FIXME: Should we reset data for all mice? */
for (i = 0; i < SDL_GetNumMice(); ++i) { for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse = SDL_GetMouse(i); SDL_Mouse *mouse = SDL_GetMouse(i);
SDL_SetMouseFocus(mouse->id, data->windowID); SDL_SetMouseFocus(mouse->id, data->windowID);
}
#endif
} }
#endif
} }
break; break;
...@@ -118,15 +115,13 @@ X11_DispatchEvent(_THIS) ...@@ -118,15 +115,13 @@ X11_DispatchEvent(_THIS)
if (xevent.xcrossing.mode == NotifyUngrab) if (xevent.xcrossing.mode == NotifyUngrab)
printf("Mode: NotifyUngrab\n"); printf("Mode: NotifyUngrab\n");
#endif #endif
if ((xevent.xcrossing.mode != NotifyGrab) && if (xevent.xcrossing.detail != NotifyInferior) {
(xevent.xcrossing.mode != NotifyUngrab) &&
(xevent.xcrossing.detail != NotifyInferior)) {
#if 1 #if 1
/* FIXME: Should we reset data for all mice? */ /* FIXME: Should we reset data for all mice? */
for (i = 0; i < SDL_GetNumMice(); ++i) { for (i = 0; i < SDL_GetNumMice(); ++i) {
SDL_Mouse *mouse = SDL_GetMouse(i); SDL_Mouse *mouse = SDL_GetMouse(i);
SDL_SetMouseFocus(mouse->id, 0); SDL_SetMouseFocus(mouse->id, 0);
} }
#endif #endif
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment