From 7ddd15d8deab94a8a2c1d61c792188fa7b6e21a2 Mon Sep 17 00:00:00 2001 From: Norbert Federa Date: Wed, 4 Nov 2015 17:58:21 +0100 Subject: [PATCH] client/X11: fix post fullscreen repositioning --- client/X11/xf_window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index db8bd25..9e7ed6e 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -200,12 +200,22 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) xf_ResizeDesktopWindow(xfc, window, width, height); - XMoveWindow(xfc->display, window->handle, startX, startY); + if (fullscreen) + { + /* enter full screen: move the window before adding NET_WM_STATE_FULLSCREEN */ + XMoveWindow(xfc->display, window->handle, startX, startY); + } /* Set the fullscreen state */ xf_SendClientEvent(xfc, window->handle, xfc->_NET_WM_STATE, 4, fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, xfc->_NET_WM_STATE_FULLSCREEN, 0, 0); + + if (!fullscreen) + { + /* leave full screen: move the window after removing NET_WM_STATE_FULLSCREEN */ + XMoveWindow(xfc->display, window->handle, startX, startY); + } } /* http://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html */ -- 2.7.4