mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
wayland: don't hang in SDL_GL_SwapBuffers if the compositor is ghosting us.
If you hide a window on Mutter, for example, the compositor never requests new frames, which will cause Mesa to block forever in eglSwapBuffers to satisfy the swap interval. We now always set the swap interval to 0 and manage this ourselves, handing the frame to Wayland when it requests a new one, and timing out at 10fps just to keep apps moving if the compositor wants no frames at all. My understanding is that other protocols are coming that might improve upon this solution, but for now it solves the total hang. Fixes #4335.
This commit is contained in:
@@ -1795,7 +1795,7 @@ extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
|
||||
* vsync. Adaptive vsync works the same as vsync, but if you've already missed
|
||||
* the vertical retrace for a given frame, it swaps buffers immediately, which
|
||||
* might be less jarring for the user during occasional framerate drops. If
|
||||
* application requests adaptive vsync and the system does not support it,
|
||||
* an application requests adaptive vsync and the system does not support it,
|
||||
* this function will fail and return -1. In such a case, you should probably
|
||||
* retry the call with 1 for the interval.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user