diff options
author | Benjamin Otte <otte@redhat.com> | 2023-04-28 22:40:39 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-04-28 22:40:39 +0200 |
commit | b4c859c0113f8802d9c6f047dcf2b689223848da (patch) | |
tree | f98a30c32ae4a9b1c602c32bff0ad03746f54aea /gdk | |
parent | 45216e1c88285e526db825a80ccba957d4fd3533 (diff) | |
download | gtk+-b4c859c0113f8802d9c6f047dcf2b689223848da.tar.gz |
wayland: Set EGL swap interval to 0.
There's no need for EGL to do any timing, we do it in GTK already.
This fixes hangs in Mesa when we hide a surface after a SwapBuffers()
but before the frame callback arrives.
If we then reshow the surface and immediately render to it, Mesa would
still have a frame callback from before the hiding and forever poll()
waiting for the compositor to send the callback.
Fixes #5761
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkglcontext-wayland.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index b0ae79a0b7..b236854ba9 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -75,6 +75,9 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, WL_SURFACE_OFFSET_SINCE_VERSION) wl_surface_offset (impl->display_server.wl_surface, dx, dy); + /* We should do ths when setting up the EGLSurface, but we don't make_current then */ + eglSwapInterval (gdk_display_get_egl_display (gdk_draw_context_get_display (draw_context)), 0); + GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->end_frame (draw_context, painted); gdk_wayland_surface_notify_committed (surface); |