From 1b008bed45205929a9f98f48708efbdeab5d507e Mon Sep 17 00:00:00 2001 From: The Flying Rapist Date: Sun, 12 Nov 2017 14:06:05 -0500 Subject: [PATCH] unix: fix fullscreen property change timing Previously, the Unix version of Snes9x was unable to create a fullscreen window. (It would create a regular window the size of the screen.) --- unix/x11.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/unix/x11.cpp b/unix/x11.cpp index f046fcd8..7e02f683 100644 --- a/unix/x11.cpp +++ b/unix/x11.cpp @@ -862,6 +862,12 @@ void S9xInitDisplay (int argc, char **argv) WidthOfScreen(GUI.screen), HeightOfScreen(GUI.screen), 0, GUI.depth, InputOutput, GUI.visual, CWBackPixel | CWColormap, &attrib); + /* Try to tell the Window Manager not to decorate this window. */ + Atom wm_state = XInternAtom (GUI.display, "_NET_WM_STATE", true ); + Atom wm_fullscreen = XInternAtom (GUI.display, "_NET_WM_STATE_FULLSCREEN", true ); + + XChangeProperty(GUI.display, GUI.window, wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *)&wm_fullscreen, 1); + #ifdef USE_XVIDEO if (GUI.use_xvideo) { @@ -964,15 +970,6 @@ void S9xInitDisplay (int argc, char **argv) XNextEvent(GUI.display, &event); } while (event.type != MapNotify || event.xmap.event != GUI.window); - if (GUI.fullscreen) - { - /* Try to tell the Window Manager not to decorate this window. */ - Atom wm_state = XInternAtom (GUI.display, "_NET_WM_STATE", true ); - Atom wm_fullscreen = XInternAtom (GUI.display, "_NET_WM_STATE_FULLSCREEN", true ); - - XChangeProperty(GUI.display, GUI.window, wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *)&wm_fullscreen, 1); - } - #ifdef USE_XVIDEO if (GUI.use_xvideo) {