From 61b1c25eeb0dc84a6f8a75ebedf4d5ef6da5e528 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 3 Feb 2025 22:50:51 -0500 Subject: [PATCH] x11: SDL_SetWindowPosition on an unmapped window will do the actual move later. Fixes https://github.com/libsdl-org/sdl2-compat/issues/303 --- src/video/x11/SDL_x11window.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index c8c0ffd737..c26ee7f5a7 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1065,8 +1065,12 @@ void X11_UpdateWindowPosition(SDL_Window *window, bool use_current_position) &data->expected.x, &data->expected.y); // Attempt to move the window - data->pending_operation |= X11_PENDING_OP_MOVE; - X11_XMoveWindow(display, data->xwindow, data->expected.x, data->expected.y); + if (window->flags & SDL_WINDOW_HIDDEN) { + window->internal->pending_position = true; + } else { + data->pending_operation |= X11_PENDING_OP_MOVE; + X11_XMoveWindow(display, data->xwindow, data->expected.x, data->expected.y); + } } bool X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window)