Don't generate multiple mouse focus events
authorPatrice Mandin <patmandin@gmail.com>
Thu, 07 Jul 2005 12:10:30 +0000
changeset 1088 6091b9ca1a97
parent 1087 8c44005e0979
child 1089 b3f7c4af00e0
Don't generate multiple mouse focus events
src/video/gem/SDL_gemevents.c
--- a/src/video/gem/SDL_gemevents.c	Fri Jul 01 15:39:23 2005 +0000
+++ b/src/video/gem/SDL_gemevents.c	Thu Jul 07 12:10:30 2005 +0000
@@ -179,12 +179,16 @@
 		/* Mouse entering/leaving window */
 		if (resultat & MU_M1) {
 			if (this->input_grab == SDL_GRAB_OFF) {
-				SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+				if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+					SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+				}
 			}
 		}
 		if (resultat & MU_M2) {
 			if (this->input_grab == SDL_GRAB_OFF) {
-				SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+				if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+					SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+				]
 			}
 		}
 
@@ -260,7 +264,7 @@
 			/* If we're active, make ourselves inactive */
 			if ( SDL_GetAppState() & SDL_APPACTIVE ) {
 				/* Send an internal deactivate event */
-				SDL_PrivateAppActive(0, SDL_APPACTIVE|SDL_APPINPUTFOCUS);
+				SDL_PrivateAppActive(0, SDL_APPACTIVE);
 			}
 			/* Update window title */
 			if (GEM_refresh_name && GEM_icon_name) {