From b726211b9b9eefeaabf5ba366565792e943a18b6 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 3 May 2024 21:55:01 +0200 Subject: Wayland: use frame_cb before redrawing GL subwindows (#967) --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 00c1ab0ca..5f96480ab 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -357,6 +357,13 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() { } if (egl_surface) { + if (pWindow->parent()) { + struct wld_window *xid = fl_wl_xid(pWindow); + if (xid->frame_cb) return; + xid->frame_cb = wl_surface_frame(xid->wl_surface); + wl_callback_add_listener(xid->frame_cb, Fl_Wayland_Graphics_Driver::p_surface_frame_listener, + xid); + } eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface); } } -- cgit v1.2.3