x11: SDL_SetWindowPosition on an unmapped window will do the actual move later.

Fixes https://github.com/libsdl-org/sdl2-compat/issues/303
This commit is contained in:
Ryan C. Gordon 2025-02-03 22:50:51 -05:00
parent f1b3523c67
commit 61b1c25eeb
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 6 additions and 2 deletions

View File

@ -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)