x11: Only position the fullscreen window if not on the target display

Entering fullscreen and moving the window can be a racy operation on some desktops, and isn't needed when the window is already on the target display, so only do it when necessary.

(cherry picked from commit 2ec0b24b54)
This commit is contained in:
Frank Praznik
2026-08-31 12:37:31 -04:00
parent 4ef437dc55
commit 5b492bd278

View File

@@ -1909,8 +1909,8 @@ static SDL_FullscreenResult X11_SetWindowFullscreenViaWM(SDL_VideoDevice *_this,
data->expected.w = _display->current_mode->w;
data->expected.h = _display->current_mode->h;
// Only move the window if it isn't fullscreen or already on the target display.
if (!(window->flags & SDL_WINDOW_FULLSCREEN) || (!current || current != _display->id)) {
// Only move the window if it isn't already on the target display.
if (!current || current != _display->id) {
X11_XMoveWindow(display, data->xwindow, displaydata->x, displaydata->y);
data->pending_operation |= X11_PENDING_OP_MOVE;
}