From 16da6532f0237fcff8d13aa80280c1c434e792fd Mon Sep 17 00:00:00 2001 From: ranicharradi <71833988+ranicharradi@users.noreply.github.com> Date: Sun, 26 Jul 2026 00:48:26 +0100 Subject: [PATCH] Wayland: fix abort when dragging a tab out drag_icon_surface_listener is registered with only .enter and .leave. wl_compositor is bound at version 6 whenever the compositor offers it, so the drag icon surface receives wl_surface.preferred_buffer_scale (opcode 2) and libwayland aborts on the NULL listener slot: listener function for opcode 2 of wl_surface is NULL Add no-op handlers for both version 6 events, matching surfaceListener. The drag icon's scale is already fixed at drag start from the source window, via viewport destination or wl_surface_set_buffer_scale, so ignoring the compositor's later preference preserves existing behavior. Fixes #10284 --- glfw/wl_window.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index c065ee094..61462c000 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -3334,9 +3334,21 @@ drag_icon_surface_handle_enter(void *data UNUSED, struct wl_surface *surface UNU static void drag_icon_surface_handle_leave(void *data UNUSED, struct wl_surface *surface UNUSED, struct wl_output *output UNUSED) {} +#ifdef WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION +static void +drag_icon_surface_handle_preferred_buffer_scale(void *data UNUSED, struct wl_surface *surface UNUSED, int32_t scale UNUSED) {} + +static void +drag_icon_surface_handle_preferred_buffer_transform(void *data UNUSED, struct wl_surface *surface UNUSED, uint32_t transform UNUSED) {} +#endif + static const struct wl_surface_listener drag_icon_surface_listener = { .enter = drag_icon_surface_handle_enter, .leave = drag_icon_surface_handle_leave, +#ifdef WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION + .preferred_buffer_scale = &drag_icon_surface_handle_preferred_buffer_scale, + .preferred_buffer_transform = &drag_icon_surface_handle_preferred_buffer_transform, +#endif }; #define dr _glfw.wl.drag.data_requests[i]