gem: Check mouse focus inside mouse motion function SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sun, 04 Nov 2012 19:02:21 +0100
branchSDL-1.2
changeset 6648 5415ef59343a
parent 6647 42abe340dc14
child 6649 1aab0b09a0e3
gem: Check mouse focus inside mouse motion function
src/video/gem/SDL_gemevents.c
--- a/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:00:20 2012 +0100
+++ b/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:02:21 2012 +0100
@@ -117,16 +117,6 @@
 
 		/* Mouse motion event ? */
 		if (resultat & MU_M1) {
-			if (this->input_grab == SDL_GRAB_OFF) {
-				/* Switch mouse focus state */
-				if (!GEM_fullscreen && (GEM_handle>=0)) {
-					SDL_PrivateAppActive(
-						mouse_in_work_area(GEM_handle, mousex,mousey),
-						SDL_APPMOUSEFOCUS);
-				}
-			}
-			GEM_CheckMouseMode(this);
-
 			do_mouse_motion(this, mousex, mousey);
 			prevmx = mousex;
 			prevmy = mousey;
@@ -304,6 +294,16 @@
 {
 	short x2, y2, w2, h2;
 
+	if (this->input_grab == SDL_GRAB_OFF) {
+		/* Switch mouse focus state */
+		if (!GEM_fullscreen && (GEM_handle>=0)) {
+			SDL_PrivateAppActive(
+				mouse_in_work_area(GEM_handle, mx,my),
+				SDL_APPMOUSEFOCUS);
+		}
+	}
+	GEM_CheckMouseMode(this);
+
 	/* Don't return mouse events if out of window */
 	if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS)==0) {
 		return;