Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SDL2 GFX Suspend Screensaver Warning #15846

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions gfx/drivers/sdl2_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,16 @@ static bool sdl2_gfx_focus(void *data)
return (SDL_GetWindowFlags(vid->window) & flags) == flags;
}

static bool sdl2_gfx_suspend_screensaver(void *data, bool enable) { return false; }
static bool sdl2_gfx_suspend_screensaver(void *data, bool enable)
{
#ifdef HAVE_X11
/* Use X11's suspend screensaver if X11 available. */
return x11_suspend_screensaver(data, enable);
#else
return false;
#endif
}

/* TODO/FIXME - implement */
static bool sdl2_gfx_has_windowed(void *data) { return true; }

Expand Down Expand Up @@ -714,11 +723,7 @@ video_driver_t video_sdl2 = {
sdl2_gfx_set_nonblock_state,
sdl2_gfx_alive,
sdl2_gfx_focus,
#ifdef HAVE_X11
x11_suspend_screensaver,
#else
sdl2_gfx_suspend_screensaver,
#endif
sdl2_gfx_has_windowed,
sdl2_gfx_set_shader,
sdl2_gfx_free,
Expand Down
Loading