From 6135e55c58959626ec6bbf0539fd3636c961106f Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Wed, 30 Mar 2022 14:59:24 +0200 Subject: [PATCH] cursor.c: Do not segfault on missing drag icon Observed by moving tabs in chromium wayland native (started with --ozone-platform-hint=wayland). Backport of 47912aebb6ff9dc197a241c89bcd78b3a9dc2dc9 --- src/cursor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cursor.c b/src/cursor.c index fba83f6b..5c8b2583 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -378,6 +378,11 @@ start_drag(struct wl_listener *listener, void *data) seat->pressed.view = NULL; seat->pressed.surface = NULL; seat->drag_icon = wlr_drag->icon; + if (!seat->drag_icon) { + wlr_log(WLR_ERROR, + "Started drag but application did not set a drag icon"); + return; + } wl_signal_add(&seat->drag_icon->events.destroy, &seat->destroy_drag); }