Skip to content

Commit

Permalink
riscos: send SDL_APPACTIVE events when iconizing the window
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Sep 3, 2019
1 parent 5a28385 commit 57a2c85
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions WhatsNew
Expand Up @@ -81,6 +81,7 @@ Changes include:
is in focus. don't reset mouse focus when recreating the window.
- RISC OS: support Windows and Menu key input.
- RISC OS: implement SDL_WM_IconifyWindow()
- RISC OS: send SDL_APPACTIVE events when iconizing the window.
- Configuration: fix library detection selecting wrong lib (bug 2795.)
- Configuration: fix detecting dynamic library support on powerpc64le
(bug 3481.)
Expand Down
3 changes: 3 additions & 0 deletions docs.html
Expand Up @@ -199,6 +199,9 @@ <H2> SDL 1.2.16 Release Notes </H2>
<P>
RISC OS: implement SDL_WM_IconifyWindow()
</P>
<P>
RISC OS: send SDL_APPACTIVE events when iconizing the window.
</P>
<P>
Configuration: fix library detection selecting wrong lib (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=2795">2795</a>.)
</P>
Expand Down
7 changes: 4 additions & 3 deletions src/video/riscos/SDL_riscostask.c
Expand Up @@ -95,14 +95,15 @@ int RISCOS_InitTask()
char task_name[32];
_kernel_swi_regs regs;
_kernel_oserror *error;
int messages[4];
int messages[5];

RISCOS_GetTaskName(task_name, SDL_arraysize(task_name));

messages[0] = 9; /* Palette changed */
messages[1] = 0x400c1; /* Mode changed */
messages[2] = 8; /* Pre quit */
messages[3] = 0;
messages[2] = 0x400ca; /* Iconize window */
messages[3] = 8; /* Pre quit */
messages[4] = 0;

regs.r[0] = (unsigned int)360; /* Minimum version 3.6 */
regs.r[1] = (unsigned int)0x4b534154;
Expand Down
24 changes: 15 additions & 9 deletions src/video/riscos/SDL_wimppoll.c
Expand Up @@ -145,15 +145,17 @@ void WIMP_Poll(_THIS, int waitTime)
break;

case 2: /* Open window */
if ( resizeOnOpen && message[0] == sdlWindow)
{
/* Ensure window is correct size */
resizeOnOpen = 0;
message[3] = message[1] + (this->screen->w << 1);
message[4] = message[2] + (this->screen->h << 1);
}
_kernel_swi(Wimp_OpenWindow, &regs, &regs);
break;
if (message[0] == sdlWindow) {
SDL_PrivateAppActive(1, SDL_APPACTIVE);
if (resizeOnOpen) {
/* Ensure window is correct size */
resizeOnOpen = 0;
message[3] = message[1] + (this->screen->w << 1);
message[4] = message[2] + (this->screen->h << 1);
}
}
_kernel_swi(Wimp_OpenWindow, &regs, &regs);
break;

case 3: /* Close window */
if (message[0] == sdlWindow)
Expand Down Expand Up @@ -251,6 +253,10 @@ void WIMP_Poll(_THIS, int waitTime)
resizeOnOpen = 1;
break;

case 0x400ca: /* Iconize window */
if (message[5] == sdlWindow) SDL_PrivateAppActive(0, SDL_APPACTIVE);
break;

case 9: /* Palette changed */
WIMP_SetupPlotInfo(this);
break;
Expand Down

0 comments on commit 57a2c85

Please sign in to comment.