atari:gem: Store iconified state so we do not have to query system on each frame. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 07 Oct 2017 00:10:57 +0200
branchSDL-1.2
changeset 115686fbdeeef1935
parent 11566 8292cd49212c
child 11569 eacc3725d279
atari:gem: Store iconified state so we do not have to query system on each frame.
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemvideo.c
src/video/gem/SDL_gemvideo.h
     1.1 --- a/src/video/gem/SDL_gemevents.c	Wed Oct 04 23:27:35 2017 +0200
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Sat Oct 07 00:10:57 2017 +0200
     1.3 @@ -233,7 +233,8 @@
     1.4  					0,0);
     1.5  				GEM_refresh_name = SDL_FALSE;
     1.6  			}
     1.7 -			update_work_area = iconified = 1;
     1.8 +			GEM_iconified = SDL_TRUE;
     1.9 +			update_work_area = 1;
    1.10  			break;
    1.11  		case WM_UNICONIFY:
    1.12  			wind_set (message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
    1.13 @@ -249,6 +250,7 @@
    1.14  					0,0);
    1.15  				GEM_refresh_name = SDL_FALSE;
    1.16  			}
    1.17 +			GEM_iconified = SDL_FALSE;
    1.18  			update_work_area = 1;
    1.19  			break;
    1.20  		case WM_SIZED:
    1.21 @@ -288,7 +290,7 @@
    1.22  	}
    1.23  
    1.24  	if (update_work_area) {
    1.25 -		GEM_align_work_area(this, message[3], 1, iconified);
    1.26 +		GEM_align_work_area(this, message[3], 1);
    1.27  
    1.28  		if (sdl_resize) {
    1.29  			SDL_PrivateResize(GEM_work_w, GEM_work_h);
     2.1 --- a/src/video/gem/SDL_gemvideo.c	Wed Oct 04 23:27:35 2017 +0200
     2.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Oct 07 00:10:57 2017 +0200
     2.3 @@ -410,6 +410,7 @@
     2.4  	GEM_handle = -1;
     2.5  	GEM_locked = SDL_FALSE;
     2.6  	GEM_win_fulled = SDL_FALSE;
     2.7 +	GEM_iconified = SDL_FALSE;
     2.8  	GEM_fullscreen = SDL_FALSE;
     2.9  	GEM_lock_redraw = SDL_TRUE;	/* Prevent redraw till buffers are setup */
    2.10  
    2.11 @@ -791,6 +792,8 @@
    2.12  
    2.13  			/* Open the window */
    2.14  			wind_open(GEM_handle,x2,y2,w2,h2);
    2.15 +
    2.16 +			GEM_iconified = SDL_FALSE;
    2.17  		} else {
    2.18  			/* Resize window to fit asked video mode */
    2.19  			wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
    2.20 @@ -799,7 +802,7 @@
    2.21  			}
    2.22  		}
    2.23  
    2.24 -		GEM_align_work_area(this, GEM_handle, 0, 0);
    2.25 +		GEM_align_work_area(this, GEM_handle, 0);
    2.26  		GEM_fullscreen = SDL_FALSE;
    2.27  	}
    2.28  
    2.29 @@ -839,12 +842,12 @@
    2.30  	return(current);
    2.31  }
    2.32  
    2.33 -void GEM_align_work_area(_THIS, short windowid, int clear_pads, int iconified)
    2.34 +void GEM_align_work_area(_THIS, short windowid, int clear_pads)
    2.35  {
    2.36  	int new_x, new_w;
    2.37  
    2.38  	wind_get(windowid, WF_WORKXYWH, &GEM_work_x,&GEM_work_y,&GEM_work_w,&GEM_work_h);
    2.39 -	if (iconified) {
    2.40 +	if (GEM_iconified) {
    2.41  		return;
    2.42  	}
    2.43  
    2.44 @@ -1229,17 +1232,8 @@
    2.45  	MFDB mfdb_src;
    2.46  	short pxy[8];
    2.47  	SDL_Surface *surface;
    2.48 -	int iconified;
    2.49  
    2.50 -	/* Is window iconified ? */
    2.51 -	iconified = 0;
    2.52 -/*	if (GEM_wfeatures & (1<<WF_ICONIFY))*/ {
    2.53 -		if (wind_get(winhandle, WF_ICONIFY, &pxy[0], &pxy[1], &pxy[2], &pxy[3])!=0) {
    2.54 -			iconified = pxy[0];
    2.55 -		}
    2.56 -	}
    2.57 -
    2.58 -	if (iconified && GEM_icon) {
    2.59 +	if (GEM_iconified && GEM_icon) {
    2.60  		short icon_rect[4], dst_rect[4];
    2.61  		short iconx,icony;
    2.62  
     3.1 --- a/src/video/gem/SDL_gemvideo.h	Wed Oct 04 23:27:35 2017 +0200
     3.2 +++ b/src/video/gem/SDL_gemvideo.h	Sat Oct 07 00:10:57 2017 +0200
     3.3 @@ -37,7 +37,7 @@
     3.4  
     3.5  /* Functions prototypes */
     3.6  void GEM_wind_redraw(_THIS, int winhandle, short *inside);
     3.7 -void GEM_align_work_area(_THIS, short windowid, int clear_pads, int iconified);
     3.8 +void GEM_align_work_area(_THIS, short windowid, int clear_pads);
     3.9  
    3.10  /* Private display data */
    3.11  
    3.12 @@ -84,6 +84,7 @@
    3.13  	short wfeatures;			/* AES window features */
    3.14  	SDL_bool refresh_name;		/* Change window title ? */
    3.15  	SDL_bool window_fulled;		/* Window maximized ? */
    3.16 +	SDL_bool iconified;			/* Window iconified ? */
    3.17  	SDL_bool mouse_relative;	/* Report relative mouse movement */
    3.18  	SDL_bool locked;			/* AES locked for fullscreen ? */
    3.19  	SDL_bool lock_redraw;		/* Prevent redraw till buffers are setup */
    3.20 @@ -136,6 +137,7 @@
    3.21  #define GEM_version			(this->hidden->version)
    3.22  #define GEM_wfeatures		(this->hidden->wfeatures)
    3.23  #define GEM_win_fulled		(this->hidden->window_fulled)
    3.24 +#define GEM_iconified		(this->hidden->iconified)
    3.25  #define GEM_mouse_relative	(this->hidden->mouse_relative)
    3.26  #define GEM_locked			(this->hidden->locked)
    3.27  #define GEM_lock_redraw		(this->hidden->lock_redraw)