From 55fd451d5fd1c3a0b259100b6753522d2cb1a4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 25 Mar 2026 17:58:04 +0100 Subject: [PATCH] Wayland: Remove unused struct member The libdecor initialization sync callback was saved in the library struct but never meaningfully used. --- src/wl_init.c | 11 +++-------- src/wl_platform.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/wl_init.c b/src/wl_init.c index 25ceba0d..04af29b8 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -244,10 +244,7 @@ static void libdecorReadyCallback(void* userData, uint32_t time) { _glfw.wl.libdecor.ready = GLFW_TRUE; - - assert(_glfw.wl.libdecor.callback == callback); - wl_callback_destroy(_glfw.wl.libdecor.callback); - _glfw.wl.libdecor.callback = NULL; + wl_callback_destroy(callback); } static const struct wl_callback_listener libdecorReadyListener = @@ -881,10 +878,8 @@ int _glfwInitWayland(void) libdecor_dispatch(_glfw.wl.libdecor.context, 0); // Create sync point to "know" when libdecor is ready for use - _glfw.wl.libdecor.callback = wl_display_sync(_glfw.wl.display); - wl_callback_add_listener(_glfw.wl.libdecor.callback, - &libdecorReadyListener, - NULL); + struct wl_callback* callback = wl_display_sync(_glfw.wl.display); + wl_callback_add_listener(callback, &libdecorReadyListener, NULL); } } diff --git a/src/wl_platform.h b/src/wl_platform.h index 16b735d1..8164150a 100644 --- a/src/wl_platform.h +++ b/src/wl_platform.h @@ -595,7 +595,6 @@ typedef struct _GLFWlibraryWayland struct { void* handle; struct libdecor* context; - struct wl_callback* callback; GLFWbool ready; PFN_libdecor_new libdecor_new_; PFN_libdecor_unref libdecor_unref_;