Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug #716
Browse files Browse the repository at this point in the history
 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.
  • Loading branch information
slouken committed Sep 27, 2009
1 parent 80182e6 commit 82d28d0
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -93,16 +93,13 @@ X11_DispatchEvent(_THIS)
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);
}
#endif
/* 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;

Expand All @@ -118,15 +115,13 @@ X11_DispatchEvent(_THIS)
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
}
}
Expand Down

0 comments on commit 82d28d0

Please sign in to comment.