client/X11: fix post fullscreen repositioning

This commit is contained in:
Norbert Federa 2015-11-04 17:58:21 +01:00
parent 48be0815c1
commit 7ddd15d8de
1 changed files with 11 additions and 1 deletions

View File

@ -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 */