Skip to content

Commit

Permalink
atari:gem: Do not change system palette if application does not have …
Browse files Browse the repository at this point in the history
…focus
  • Loading branch information
pmandin committed Oct 9, 2017
1 parent 3df35c1 commit 2a27988
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/video/gem/SDL_gemvideo.c
Expand Up @@ -1116,7 +1116,7 @@ static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)

static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
{
int i;
int i, has_input_focus;
SDL_Surface *surface;

#ifdef DEBUG_VIDEO_GEM
Expand All @@ -1129,6 +1129,8 @@ static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
return 1;
}

has_input_focus = ((SDL_GetAppState() & SDL_APPINPUTFOCUS) == SDL_APPINPUTFOCUS);

for(i = 0; i < ncolors; i++)
{
int r, g, b;
Expand All @@ -1142,7 +1144,9 @@ static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
rgb[1] = VDI_curpalette[i][1] = (1000 * g) / 255;
rgb[2] = VDI_curpalette[i][2] = (1000 * b) / 255;

vs_color(VDI_handle, vdi_index[firstcolor+i], rgb);
if (has_input_focus) {
vs_color(VDI_handle, vdi_index[firstcolor+i], rgb);
}
}

return(1);
Expand Down

0 comments on commit 2a27988

Please sign in to comment.