diff src/video/gem/SDL_gemevents.c @ 1088:6091b9ca1a97

Don't generate multiple mouse focus events
author Patrice Mandin <patmandin@gmail.com>
date Thu, 07 Jul 2005 12:10:30 +0000
parents 936da0056ed3
children b3f7c4af00e0
line wrap: on
line diff
--- 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) {