riscos: send SDL_APPACTIVE events when iconizing the window SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Tue, 03 Sep 2019 23:30:24 +0300
branchSDL-1.2
changeset 130552641390846e1
parent 13054 d07097a0e57e
child 13065 5df049ec4620
riscos: send SDL_APPACTIVE events when iconizing the window
WhatsNew
docs.html
src/video/riscos/SDL_riscostask.c
src/video/riscos/SDL_wimppoll.c
     1.1 --- a/WhatsNew	Tue Sep 03 23:11:10 2019 +0300
     1.2 +++ b/WhatsNew	Tue Sep 03 23:30:24 2019 +0300
     1.3 @@ -81,6 +81,7 @@
     1.4    is in focus. don't reset mouse focus when recreating the window.
     1.5  - RISC OS: support Windows and Menu key input.
     1.6  - RISC OS: implement SDL_WM_IconifyWindow()
     1.7 +- RISC OS: send SDL_APPACTIVE events when iconizing the window.
     1.8  - Configuration: fix library detection selecting wrong lib (bug 2795.)
     1.9  - Configuration: fix detecting dynamic library support on powerpc64le
    1.10    (bug 3481.)
     2.1 --- a/docs.html	Tue Sep 03 23:11:10 2019 +0300
     2.2 +++ b/docs.html	Tue Sep 03 23:30:24 2019 +0300
     2.3 @@ -200,6 +200,9 @@
     2.4    RISC OS: implement SDL_WM_IconifyWindow()
     2.5  </P>
     2.6  <P>
     2.7 +  RISC OS: send SDL_APPACTIVE events when iconizing the window.
     2.8 +</P>
     2.9 +<P>
    2.10    Configuration: fix library detection selecting wrong lib (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=2795">2795</a>.)
    2.11  </P>
    2.12  <P>
     3.1 --- a/src/video/riscos/SDL_riscostask.c	Tue Sep 03 23:11:10 2019 +0300
     3.2 +++ b/src/video/riscos/SDL_riscostask.c	Tue Sep 03 23:30:24 2019 +0300
     3.3 @@ -95,14 +95,15 @@
     3.4     char task_name[32];
     3.5     _kernel_swi_regs regs;
     3.6     _kernel_oserror *error;
     3.7 -   int messages[4];
     3.8 +   int messages[5];
     3.9  
    3.10     RISCOS_GetTaskName(task_name, SDL_arraysize(task_name));
    3.11  
    3.12     messages[0] = 9;       /* Palette changed */
    3.13     messages[1] = 0x400c1; /* Mode changed */
    3.14 -   messages[2] = 8;       /* Pre quit */
    3.15 -   messages[3] = 0;
    3.16 +   messages[2] = 0x400ca; /* Iconize window */
    3.17 +   messages[3] = 8;       /* Pre quit */
    3.18 +   messages[4] = 0;
    3.19  
    3.20  	regs.r[0] = (unsigned int)360; /* Minimum version 3.6 */
    3.21  	regs.r[1] = (unsigned int)0x4b534154;
     4.1 --- a/src/video/riscos/SDL_wimppoll.c	Tue Sep 03 23:11:10 2019 +0300
     4.2 +++ b/src/video/riscos/SDL_wimppoll.c	Tue Sep 03 23:30:24 2019 +0300
     4.3 @@ -145,15 +145,17 @@
     4.4            break;
     4.5          	
     4.6  		case 2:		/* Open window */
     4.7 -		   if ( resizeOnOpen && message[0] == sdlWindow)
     4.8 -		   {
     4.9 -		      /* Ensure window is correct size */
    4.10 -		      resizeOnOpen = 0;
    4.11 -		      message[3] = message[1] + (this->screen->w << 1);
    4.12 -		      message[4] = message[2] + (this->screen->h << 1);       
    4.13 -		   }
    4.14 -        	_kernel_swi(Wimp_OpenWindow, &regs, &regs);
    4.15 -       	    break;
    4.16 +			if (message[0] == sdlWindow) {
    4.17 +				SDL_PrivateAppActive(1, SDL_APPACTIVE);
    4.18 +				if (resizeOnOpen) {
    4.19 +					/* Ensure window is correct size */
    4.20 +					resizeOnOpen = 0;
    4.21 +					message[3] = message[1] + (this->screen->w << 1);
    4.22 +					message[4] = message[2] + (this->screen->h << 1);
    4.23 +				}
    4.24 +			}
    4.25 +			_kernel_swi(Wimp_OpenWindow, &regs, &regs);
    4.26 +			break;
    4.27          	
    4.28  		case 3:		/* Close window */
    4.29  			if (message[0] == sdlWindow)
    4.30 @@ -251,6 +253,10 @@
    4.31  				resizeOnOpen = 1;
    4.32  				break;
    4.33  
    4.34 +			case 0x400ca: /* Iconize window */
    4.35 +				if (message[5] == sdlWindow) SDL_PrivateAppActive(0, SDL_APPACTIVE);
    4.36 +				break;
    4.37 +
    4.38  			case 9:      /* Palette changed */
    4.39  				WIMP_SetupPlotInfo(this);
    4.40  				break;