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
This commit is contained in:
ranicharradi 2026-07-26 00:48:26 +01:00
parent 4f2f6a076b
commit 16da6532f0

12
glfw/wl_window.c vendored
View file

@ -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]