浏览代码

wayland: Add roundtrip in SetWindowFullscreen() to get new size

The video core assumes that window->w/h will be updated before returning
from SetWindowFullscreen(). This is needed to generate a resize event
with the correct window size when exiting fullscreen.

The roundtrip allows us to receive the configure callback that informs
us of the new window size before returning.

Fixes #6043
Cameron Gutman 3 年之前
父节点
当前提交
1b08cd20b3
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/video/wayland/SDL_waylandwindow.c

+ 2 - 1
src/video/wayland/SDL_waylandwindow.c

@@ -1643,7 +1643,8 @@ Wayland_SetWindowFullscreen(_THIS, SDL_Window * window,
     SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata;
     SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata;
     SetFullscreen(window, fullscreen ? output : NULL, SDL_TRUE);
     SetFullscreen(window, fullscreen ? output : NULL, SDL_TRUE);
 
 
-    WAYLAND_wl_display_flush(viddata->display);
+    /* Roundtrip required to receive the updated window dimensions */
+    WAYLAND_wl_display_roundtrip(viddata->display);
 }
 }
 
 
 void
 void