diff --git a/src/x11_init.c b/src/x11_init.c index 8007dc07..0bd38485 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -459,8 +459,6 @@ static void detectEWMH(void) getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_BYPASS_COMPOSITOR"); XFree(supportedAtoms); - - _glfw.x11.hasEWMH = GL_TRUE; } // Initialize X11 display and look for supported X11 extensions diff --git a/src/x11_platform.h b/src/x11_platform.h index b17478f8..214f2515 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -115,8 +115,6 @@ typedef struct _GLFWlibraryX11 XContext context; // XIM input method XIM im; - // True if window manager supports EWMH - GLboolean hasEWMH; // Most recent error code received by X error handler int errorCode; // Clipboard string (while the selection is owned) diff --git a/src/x11_window.c b/src/x11_window.c index e85d31cb..47e9712e 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -317,24 +317,27 @@ static GLboolean createWindow(_GLFWwindow* window, (XPointer) window); } - if (window->monitor && !_glfw.x11.hasEWMH) + if (window->monitor) { - // This is the butcher's way of removing window decorations - // Setting the override-redirect attribute on a window makes the window - // manager ignore the window completely (ICCCM, section 4) - // The good thing is that this makes undecorated full screen windows - // easy to do; the bad thing is that we have to do everything manually - // and some things (like iconify/restore) won't work at all, as those - // are tasks usually performed by the window manager + if (!_glfw.x11.NET_WM_STATE || !_glfw.x11.NET_WM_STATE_FULLSCREEN) + { + // This is the butcher's way of removing window decorations + // Setting the override-redirect attribute on a window makes the + // window manager ignore the window completely (ICCCM, section 4) + // The good thing is that this makes undecorated full screen windows + // easy to do; the bad thing is that we have to do everything + // manually and some things (like iconify/restore) won't work at + // all, as those are tasks usually performed by the window manager - XSetWindowAttributes attributes; - attributes.override_redirect = True; - XChangeWindowAttributes(_glfw.x11.display, - window->x11.handle, - CWOverrideRedirect, - &attributes); + XSetWindowAttributes attributes; + attributes.override_redirect = True; + XChangeWindowAttributes(_glfw.x11.display, + window->x11.handle, + CWOverrideRedirect, + &attributes); - window->x11.overrideRedirect = GL_TRUE; + window->x11.overrideRedirect = GL_TRUE; + } } // Declare the WM protocols supported by GLFW