Skip to content

Commit

Permalink
atari:gem: Restore mouse on exit. Process mouse status after all even…
Browse files Browse the repository at this point in the history
…ts are processed.
  • Loading branch information
pmandin committed Sep 11, 2014
1 parent 6668607 commit e085e52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -129,6 +129,8 @@ void GEM_PumpEvents(_THIS)
break;
}

GEM_CheckMouseMode(this);

/* Update mouse state */
graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
do_keyboard_special(kstate, cur_tick);
Expand Down Expand Up @@ -167,10 +169,10 @@ void GEM_PumpEvents(_THIS)

static int do_messages(_THIS, short *message)
{
int quit, check_mouse_mode;
int quit;
short x2,y2,w2,h2;

quit = check_mouse_mode = 0;
quit = 0;
switch (message[0]) {
case WM_CLOSED:
case AP_TERM:
Expand All @@ -188,7 +190,6 @@ static int do_messages(_THIS, short *message)
if (VDI_setpalette) {
VDI_setpalette(this, VDI_curpalette);
}
check_mouse_mode = 1;
break;
case WM_REDRAW:
if (!GEM_lock_redraw) {
Expand All @@ -208,7 +209,6 @@ static int do_messages(_THIS, short *message)
wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_icon_name)>>16),(short)(((unsigned long)GEM_icon_name) & 0xffff),0,0);
GEM_refresh_name = SDL_FALSE;
}
check_mouse_mode = 1;
break;
case WM_UNICONIFY:
wind_set(message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
Expand All @@ -221,7 +221,6 @@ static int do_messages(_THIS, short *message)
wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
GEM_refresh_name = SDL_FALSE;
}
check_mouse_mode = 1;
break;
case WM_SIZED:
wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
Expand Down Expand Up @@ -258,13 +257,8 @@ static int do_messages(_THIS, short *message)
if (VDI_setpalette) {
VDI_setpalette(this, VDI_oldpalette);
}
check_mouse_mode = 1;
break;
}

if (check_mouse_mode) {
GEM_CheckMouseMode(this);
}

return quit;
}
Expand Down
6 changes: 6 additions & 0 deletions src/video/gem/SDL_gemvideo.c
Expand Up @@ -1097,6 +1097,12 @@ static int GEM_ToggleFullScreen(_THIS, int on)
*/
void GEM_VideoQuit(_THIS)
{
/* Restore mouse cursor */
if (GEM_cursor_hidden) {
graf_mouse(M_ON, NULL);
}
graf_mouse(ARROW, NULL);

SDL_AtariXbios_RestoreVectors();
if (GEM_usedevmouse) {
SDL_AtariDevMouse_Close();
Expand Down

0 comments on commit e085e52

Please sign in to comment.