From c77edaee346c1fdd68d94cfef04de04dc2a15426 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 15 Jun 2015 14:45:05 +0200 Subject: [PATCH] Always pre-position X11 full screen windows. --- src/x11_window.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index 8b16134b..cd015549 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -767,6 +767,18 @@ static void enterFullscreenMode(_GLFWwindow* window) PropModeReplace, (unsigned char*) &value, 1); } + // Position the window over its monitor + { + int xpos, ypos; + GLFWvidmode mode; + + _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); + _glfwPlatformGetVideoMode(window->monitor, &mode); + + XMoveResizeWindow(_glfw.x11.display, window->x11.handle, + xpos, ypos, mode.width, mode.height); + } + if (_glfw.x11.xinerama.available && _glfw.x11.NET_WM_FULLSCREEN_MONITORS) { sendEventToWM(window, @@ -803,20 +815,6 @@ static void enterFullscreenMode(_GLFWwindow* window) _glfw.x11.NET_WM_STATE_FULLSCREEN, 0, 1, 0); } - else - { - // In override-redirect mode we have divorced ourselves from the - // window manager, so we need to do everything manually - int xpos, ypos; - GLFWvidmode mode; - - _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); - _glfwPlatformGetVideoMode(window->monitor, &mode); - - XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos); - XResizeWindow(_glfw.x11.display, window->x11.handle, - mode.width, mode.height); - } } // Leave full screen mode