]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/x11/window.cpp
Put Window on the correcte monitor when initially created
[libs/gui.git] / source / graphics / x11 / window.cpp
index 07ff75588c824ad17ab1cdd22b09572a7cd279de..32744deb0178a3dc5684b1786c298d8cb3281ae1 100644 (file)
@@ -34,9 +34,19 @@ void Window::platform_init()
        attr.override_redirect = options.fullscreen;
        attr.event_mask = ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask|EnterWindowMask|ExposureMask|FocusChangeMask;
 
+       // User position is set when the window is mapped
+       int x = 0;
+       int y = 0;
+       if(options.fullscreen && !options.fullscreen_exclusive)
+       {
+               const Monitor::Settings &ms = options.fullscreen_monitor->current_settings;
+               x = ms.x;
+               y = ms.y;
+       }
+
        priv->window = XCreateWindow(dpy,
                display.get_private().root_window,
-               0, 0,    // User position is set when the window is mapped
+               x, y,
                options.width, options.height,
                0,
                CopyFromParent,