X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fx11%2Fwindow.cpp;h=825c049055db86ff31ae7c099b6cedcfecc82e50;hb=eddae342dd069589319029b48986b14dbbe5165b;hp=07ff75588c824ad17ab1cdd22b09572a7cd279de;hpb=95480fceabec2dd6354b87a200b4a219b39d4f0a;p=libs%2Fgui.git diff --git a/source/graphics/x11/window.cpp b/source/graphics/x11/window.cpp index 07ff755..825c049 100644 --- a/source/graphics/x11/window.cpp +++ b/source/graphics/x11/window.cpp @@ -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, @@ -50,8 +60,8 @@ void Window::platform_init() { XSizeHints hints; hints.flags = PMinSize|PMaxSize; - hints.min_width=hints.max_width = options.width; - hints.min_height=hints.max_height = options.height; + hints.min_width = hints.max_width = options.width; + hints.min_height = hints.max_height = options.height; XSetWMNormalHints(dpy, priv->window, &hints); } } @@ -172,7 +182,7 @@ void Window::platform_show() { DisplayHandle dpy = display.get_private().display; XMapRaised(dpy, priv->window); - if(options.user_position) + if(options.user_position && !options.fullscreen) XMoveWindow(dpy, priv->window, options.x, options.y); }