diff --git a/client/displayservers/SDL/sdl.c b/client/displayservers/SDL/sdl.c index 05597e52..5ed2f50d 100644 --- a/client/displayservers/SDL/sdl.c +++ b/client/displayservers/SDL/sdl.c @@ -452,6 +452,11 @@ static void sdlSetFullscreen(bool fs) SDL_SetWindowFullscreen(sdl.window, fs ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); } +static bool sdlGetFullscreen(void) +{ + return (SDL_GetWindowFlags(sdl.window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; +} + struct LG_DisplayServerOps LGDS_SDL = { .probe = sdlProbe, @@ -482,6 +487,7 @@ struct LG_DisplayServerOps LGDS_SDL = .wait = sdlWait, .setWindowSize = sdlSetWindowSize, .setFullscreen = sdlSetFullscreen, + .getFullscreen = sdlGetFullscreen, /* SDL does not have clipboard support */ .cbInit = NULL, diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index 576dd6bd..8c4aa9ad 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -1026,6 +1026,11 @@ static void x11SetFullscreen(bool fs) SubstructureNotifyMask | SubstructureRedirectMask, &e); } +static bool x11GetFullscreen(void) +{ + return x11.fullscreen; +} + static bool x11CBInit() { x11.aSelection = XInternAtom(x11.display, "CLIPBOARD" , False); @@ -1380,6 +1385,7 @@ struct LG_DisplayServerOps LGDS_X11 = .wait = x11Wait, .setWindowSize = x11SetWindowSize, .setFullscreen = x11SetFullscreen, + .getFullscreen = x11GetFullscreen, .cbInit = x11CBInit, .cbNotice = x11CBNotice, diff --git a/client/include/app.h b/client/include/app.h index c96d6e2a..7dead1a7 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -55,6 +55,7 @@ void app_handleFocusEvent(bool focused); void app_handleCloseEvent(void); void app_setFullscreen(bool fs); +bool app_getFullscreen(void); bool app_getProp(LG_DSProperty prop, void * ret); EGLDisplay app_getEGLDisplay(void); diff --git a/client/include/interface/displayserver.h b/client/include/interface/displayserver.h index 3348bb75..eb2365e9 100644 --- a/client/include/interface/displayserver.h +++ b/client/include/interface/displayserver.h @@ -130,8 +130,9 @@ struct LG_DisplayServerOps /* wait for the specified time without blocking UI processing/event loops */ void (*wait)(unsigned int time); - /* set the window dimensions */ + /* get/set the window dimensions */ void (*setWindowSize)(int x, int y); + bool (*getFullscreen)(void); void (*setFullscreen)(bool fs); /* clipboard support */ @@ -162,5 +163,6 @@ struct LG_DisplayServerOps (x)->uninhibitIdle && \ (x)->wait && \ (x)->setWindowSize && \ - (x)->setFullscreen) + (x)->setFullscreen && \ + (x)->getFullscreen) #endif diff --git a/client/src/app.c b/client/src/app.c index f4f3a089..e512402c 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -556,6 +556,11 @@ void app_setFullscreen(bool fs) g_state.ds->setFullscreen(fs); } +bool app_getFullscreen(void) +{ + return g_state.ds->getFullscreen(); +} + bool app_getProp(LG_DSProperty prop, void * ret) { return g_state.ds->getProp(prop, ret); diff --git a/client/src/keybind.c b/client/src/keybind.c index 4004e7a1..988881df 100644 --- a/client/src/keybind.c +++ b/client/src/keybind.c @@ -30,8 +30,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA static void bind_fullscreen(int sc, void * opaque) { - g_params.fullscreen = !g_params.fullscreen; - app_setFullscreen(g_params.fullscreen); + app_setFullscreen(!app_getFullscreen()); } static void bind_video(int sc, void * opaque)