Commit cd1d53f1 authored by Sam Lantinga's avatar Sam Lantinga

Applied the same logic as the fix for bug 894.

Anytime we enter the window, we gain the mouse focus.  If we leave the window because of a normal LeaveNotify, then we lose mouse focus.
parent 658b2fec
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> /* For INT_MAX */ #include <limits.h> /* For INT_MAX */
#include "SDL_x11video.h" #include "SDL_x11video.h"
#include "../../events/SDL_events_c.h" #include "../../events/SDL_events_c.h"
...@@ -92,8 +92,8 @@ X11_DispatchEvent(_THIS) ...@@ -92,8 +92,8 @@ X11_DispatchEvent(_THIS)
case EnterNotify:{ case EnterNotify:{
#ifdef DEBUG_XEVENTS #ifdef DEBUG_XEVENTS
printf("EnterNotify! (%d,%d,%d)\n", printf("EnterNotify! (%d,%d,%d)\n",
xevent.xcrossing.x, xevent.xcrossing.x,
xevent.xcrossing.y, xevent.xcrossing.y,
xevent.xcrossing.mode); xevent.xcrossing.mode);
if (xevent.xcrossing.mode == NotifyGrab) if (xevent.xcrossing.mode == NotifyGrab)
printf("Mode: NotifyGrab\n"); printf("Mode: NotifyGrab\n");
...@@ -108,15 +108,17 @@ X11_DispatchEvent(_THIS) ...@@ -108,15 +108,17 @@ X11_DispatchEvent(_THIS)
case LeaveNotify:{ case LeaveNotify:{
#ifdef DEBUG_XEVENTS #ifdef DEBUG_XEVENTS
printf("LeaveNotify! (%d,%d,%d)\n", printf("LeaveNotify! (%d,%d,%d)\n",
xevent.xcrossing.x, xevent.xcrossing.x,
xevent.xcrossing.y, xevent.xcrossing.y,
xevent.xcrossing.mode); xevent.xcrossing.mode);
if (xevent.xcrossing.mode == NotifyGrab) if (xevent.xcrossing.mode == NotifyGrab)
printf("Mode: NotifyGrab\n"); printf("Mode: NotifyGrab\n");
if (xevent.xcrossing.mode == NotifyUngrab) if (xevent.xcrossing.mode == NotifyUngrab)
printf("Mode: NotifyUngrab\n"); printf("Mode: NotifyUngrab\n");
#endif #endif
if (xevent.xcrossing.detail != NotifyInferior) { if (xevent.xcrossing.mode != NotifyGrab &&
xevent.xcrossing.mode != NotifyUngrab &&
xevent.xcrossing.detail != NotifyInferior) {
SDL_SetMouseFocus(NULL); SDL_SetMouseFocus(NULL);
} }
} }
......
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