Jelajahi Sumber

video: Try to match the requested video mode when moving fullscreen windows

Try to match the requested video mode when a fullscreen window is moved to a new display, or it may not be returned to the requested mode if it is moved to a display with no matching mode, then back to the original display.
Frank Praznik 3 tahun lalu
induk
melakukan
5a0095d373
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/video/SDL_video.c

+ 2 - 2
src/video/SDL_video.c

@@ -3229,8 +3229,8 @@ void SDL_OnWindowDisplayChanged(SDL_Window *window)
         SDL_DisplayID displayID = SDL_GetDisplayForWindowPosition(window);
         const SDL_DisplayMode *new_mode = NULL;
 
-        if (window->current_fullscreen_mode.pixel_w != 0 || window->current_fullscreen_mode.pixel_h != 0) {
-            new_mode = SDL_GetClosestFullscreenDisplayMode(displayID, window->current_fullscreen_mode.pixel_w, window->current_fullscreen_mode.pixel_h, window->current_fullscreen_mode.refresh_rate);
+        if (window->requested_fullscreen_mode.pixel_w != 0 || window->requested_fullscreen_mode.pixel_h != 0) {
+            new_mode = SDL_GetClosestFullscreenDisplayMode(displayID, window->requested_fullscreen_mode.pixel_w, window->requested_fullscreen_mode.pixel_h, window->requested_fullscreen_mode.refresh_rate);
         }
 
         if (new_mode) {