From 2ec0b24b54d7d9d01d2d2a13579f68b6e8245098 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Mon, 31 Aug 2026 12:37:31 -0400 Subject: [PATCH] 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. --- src/video/x11/SDL_x11window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index deaf67c487..64dff5e93a 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -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; }