Browse Source

video: Don't switch display modes when emulating mode changes

SDL uses window minimization to determine fullscreen window visibility and hide windows before changing the video mode back to the desktop. Wayland, however, does not have the concept of a minimized window and doesn't set the minimized flag (minimization can be requested, but what actually happens to the window is implementation dependent, and if a window is minimized via a desktop shortcut or decoration control, the application is not notified of any state changes). Make the video core mode setting a no-op so that the Wayland backend can handle reporting the display dimensions using its own internal logic.
Frank Praznik 2 years ago
parent
commit
7d439b87b0
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/video/SDL_video.c

+ 5 - 0
src/video/SDL_video.c

@@ -1124,6 +1124,11 @@ const SDL_DisplayMode *SDL_GetCurrentDisplayMode(SDL_DisplayID displayID)
 
 static int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay *display, SDL_DisplayMode *mode)
 {
+    /* Mode switching is being emulated per-window; nothing to do and cannot fail. */
+    if (ModeSwitchingEmulated(_this)) {
+        return 0;
+    }
+
     if (!mode) {
         mode = &display->desktop_mode;
     }