From 8176cae1bc21f085a4fb69c91c103bcbfb8adb9c Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 21 Oct 2012 23:44:10 +0200 Subject: [PATCH] Fixed position of fullscreen windows on X11. --- src/x11_window.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index 21e0e6b2..c9a0c4c4 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -98,8 +98,6 @@ static GLboolean createWindow(_GLFWwindow* window, // Create the actual window { - int screenX, screenY; - wamask = CWBorderPixel | CWColormap | CWEventMask; wa.colormap = window->X11.colormap; @@ -109,12 +107,7 @@ static GLboolean createWindow(_GLFWwindow* window, ExposureMask | FocusChangeMask | VisibilityChangeMask | EnterWindowMask | LeaveWindowMask; - if (wndconfig->monitor) - { - screenX = wndconfig->monitor->screenX; - screenY = wndconfig->monitor->screenY; - } - else + if (wndconfig->monitor == NULL) { // The /only/ reason for setting the background pixel here is that // otherwise our window won't get any decorations on systems using @@ -122,14 +115,11 @@ static GLboolean createWindow(_GLFWwindow* window, wa.background_pixel = BlackPixel(_glfwLibrary.X11.display, _glfwLibrary.X11.screen); wamask |= CWBackPixel; - - screenX = 0; - screenY = 0; } window->X11.handle = XCreateWindow(_glfwLibrary.X11.display, _glfwLibrary.X11.root, - screenX, screenY, + 0, 0, window->width, window->height, 0, // Border width visual->depth, // Color depth @@ -225,6 +215,13 @@ static GLboolean createWindow(_GLFWwindow* window, hints->flags = 0; + if (wndconfig->monitor) + { + hints->flags |= PPosition; + hints->x = wndconfig->monitor->screenX; + hints->y = wndconfig->monitor->screenY; + } + if (!wndconfig->resizable) { hints->flags |= (PMinSize | PMaxSize);