Просмотр исходного кода

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.
Frank Praznik 2 недель назад
Родитель
Сommit
2ec0b24b54
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/video/x11/SDL_x11window.c

+ 2 - 2
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;
             }