From 1ad5777c6a4e11eec599843f132f7db1d739222c Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:11:45 +0200 Subject: [PATCH] Wayland: use libdecor_dispatch() instead of wl_display_dispatch(). --- src/CMakeLists.txt | 1 + src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7984ebd9f..d8bc43ef7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -612,6 +612,7 @@ if(FLTK_USE_WAYLAND) endif(USE_SYSTEM_LIBDECOR) set_source_files_properties( ${FLTK_SOURCE_DIR}/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx + ${FLTK_SOURCE_DIR}/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx ${FLTK_SOURCE_DIR}/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx PROPERTIES COMPILE_DEFINITIONS "USE_SYSTEM_LIBDECOR=${USE_SYSTEM_LIBDECOR}" ) diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 9285d3a15..2781010cf 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -19,6 +19,7 @@ #include #include #include "../../Fl_Gl_Choice.H" +#include "../../../libdecor/build/fl_libdecor.h" #include "Fl_Wayland_Window_Driver.H" #include "Fl_Wayland_Graphics_Driver.H" #include "Fl_Wayland_Gl_Window_Driver.H" @@ -273,7 +274,8 @@ void Fl_Wayland_Gl_Window_Driver::make_current_before() { struct wl_surface *surface = win->wl_surface; if (pWindow->parent()) { // force toplevel win to enter its display before sizing GL subwin win = fl_wl_xid(pWindow->top_window()); - while (wl_list_empty(&win->outputs)) wl_display_dispatch(fl_wl_display()); + struct libdecor *ld = ((Fl_Wayland_Screen_Driver*)Fl::screen_driver())->libdecor_context; + while (wl_list_empty(&win->outputs)) libdecor_dispatch(ld, 0); } int W = pWindow->pixel_w(); int H = pWindow->pixel_h();