Don't generate multiple mouse focus events
authorPatrice Mandin <patmandin@gmail.com>
Thu, 07 Jul 2005 12:10:30 +0000
changeset 10886091b9ca1a97
parent 1087 8c44005e0979
child 1089 b3f7c4af00e0
Don't generate multiple mouse focus events
src/video/gem/SDL_gemevents.c
     1.1 --- a/src/video/gem/SDL_gemevents.c	Fri Jul 01 15:39:23 2005 +0000
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Thu Jul 07 12:10:30 2005 +0000
     1.3 @@ -179,12 +179,16 @@
     1.4  		/* Mouse entering/leaving window */
     1.5  		if (resultat & MU_M1) {
     1.6  			if (this->input_grab == SDL_GRAB_OFF) {
     1.7 -				SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
     1.8 +				if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
     1.9 +					SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
    1.10 +				}
    1.11  			}
    1.12  		}
    1.13  		if (resultat & MU_M2) {
    1.14  			if (this->input_grab == SDL_GRAB_OFF) {
    1.15 -				SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
    1.16 +				if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    1.17 +					SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
    1.18 +				]
    1.19  			}
    1.20  		}
    1.21  
    1.22 @@ -260,7 +264,7 @@
    1.23  			/* If we're active, make ourselves inactive */
    1.24  			if ( SDL_GetAppState() & SDL_APPACTIVE ) {
    1.25  				/* Send an internal deactivate event */
    1.26 -				SDL_PrivateAppActive(0, SDL_APPACTIVE|SDL_APPINPUTFOCUS);
    1.27 +				SDL_PrivateAppActive(0, SDL_APPACTIVE);
    1.28  			}
    1.29  			/* Update window title */
    1.30  			if (GEM_refresh_name && GEM_icon_name) {