mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-02 03:43:38 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user