atari:gem: Restore mouse on exit. Process mouse status after all events are processed. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Thu, 11 Sep 2014 21:51:10 +0200
branchSDL-1.2
changeset 9130347df449e563
parent 9124 e6320f77cd2e
child 9131 8b9217e06b02
atari:gem: Restore mouse on exit. Process mouse status after all events are processed.
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemvideo.c
     1.1 --- a/src/video/gem/SDL_gemevents.c	Sat Sep 06 11:15:26 2014 +0200
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Thu Sep 11 21:51:10 2014 +0200
     1.3 @@ -129,6 +129,8 @@
     1.4  			break;
     1.5  	}
     1.6  
     1.7 +	GEM_CheckMouseMode(this);
     1.8 +
     1.9  	/* Update mouse state */
    1.10  	graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
    1.11  	do_keyboard_special(kstate, cur_tick);
    1.12 @@ -167,10 +169,10 @@
    1.13  
    1.14  static int do_messages(_THIS, short *message)
    1.15  {
    1.16 -	int quit, check_mouse_mode;
    1.17 +	int quit;
    1.18  	short x2,y2,w2,h2;
    1.19  
    1.20 -	quit = check_mouse_mode = 0;
    1.21 +	quit = 0;
    1.22  	switch (message[0]) {
    1.23  		case WM_CLOSED:
    1.24  		case AP_TERM:    
    1.25 @@ -188,7 +190,6 @@
    1.26  			if (VDI_setpalette) {
    1.27  				VDI_setpalette(this, VDI_curpalette);
    1.28  			}
    1.29 -			check_mouse_mode = 1;
    1.30  			break;
    1.31  		case WM_REDRAW:
    1.32  			if (!GEM_lock_redraw) {
    1.33 @@ -208,7 +209,6 @@
    1.34  				wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_icon_name)>>16),(short)(((unsigned long)GEM_icon_name) & 0xffff),0,0);
    1.35  				GEM_refresh_name = SDL_FALSE;
    1.36  			}
    1.37 -			check_mouse_mode = 1;
    1.38  			break;
    1.39  		case WM_UNICONIFY:
    1.40  			wind_set(message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
    1.41 @@ -221,7 +221,6 @@
    1.42  				wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
    1.43  				GEM_refresh_name = SDL_FALSE;
    1.44  			}
    1.45 -			check_mouse_mode = 1;
    1.46  			break;
    1.47  		case WM_SIZED:
    1.48  			wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
    1.49 @@ -258,13 +257,8 @@
    1.50  			if (VDI_setpalette) {
    1.51  				VDI_setpalette(this, VDI_oldpalette);
    1.52  			}
    1.53 -			check_mouse_mode = 1;
    1.54  			break;
    1.55  	}
    1.56 -
    1.57 -	if (check_mouse_mode) {
    1.58 -		GEM_CheckMouseMode(this);
    1.59 -	}
    1.60  	
    1.61  	return quit;
    1.62  }
     2.1 --- a/src/video/gem/SDL_gemvideo.c	Sat Sep 06 11:15:26 2014 +0200
     2.2 +++ b/src/video/gem/SDL_gemvideo.c	Thu Sep 11 21:51:10 2014 +0200
     2.3 @@ -1097,6 +1097,12 @@
     2.4  */
     2.5  void GEM_VideoQuit(_THIS)
     2.6  {
     2.7 +	/* Restore mouse cursor */
     2.8 +	if (GEM_cursor_hidden) {
     2.9 +		graf_mouse(M_ON, NULL);
    2.10 +	}
    2.11 +	graf_mouse(ARROW, NULL);
    2.12 +
    2.13  	SDL_AtariXbios_RestoreVectors();
    2.14  	if (GEM_usedevmouse) {
    2.15  		SDL_AtariDevMouse_Close();