Fixed #7326: Ensure proper window size

When leaving fullscreen with enabled smart sizing the window size
did shrink due to first resizing the window, then enabling window
decorations and finally moving to the correct position.
This commit is contained in:
Armin Novak 2021-10-05 10:37:54 +02:00 committed by akallabeth
parent 7f7bf2d731
commit b3209fe2b9

View File

@ -174,6 +174,7 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen)
xfc->savedHeight = xfc->window->height; xfc->savedHeight = xfc->window->height;
xfc->savedPosX = xfc->window->left; xfc->savedPosX = xfc->window->left;
xfc->savedPosY = xfc->window->top; xfc->savedPosY = xfc->window->top;
startX = (settings->DesktopPosX != UINT32_MAX) ? settings->DesktopPosX : 0; startX = (settings->DesktopPosX != UINT32_MAX) ? settings->DesktopPosX : 0;
startY = (settings->DesktopPosY != UINT32_MAX) ? settings->DesktopPosY : 0; startY = (settings->DesktopPosY != UINT32_MAX) ? settings->DesktopPosY : 0;
} }
@ -229,7 +230,11 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen)
if (!fullscreen) if (!fullscreen)
{ {
/* leave full screen: move the window after removing NET_WM_STATE_FULLSCREEN */ /* leave full screen: move the window after removing NET_WM_STATE_FULLSCREEN
* Resize the window again, the previous call to xf_SendClientEvent might have
* changed the window size (borders, ...)
*/
xf_ResizeDesktopWindow(xfc, window, width, height);
XMoveWindow(xfc->display, window->handle, startX, startY); XMoveWindow(xfc->display, window->handle, startX, startY);
} }