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 47912aebb6
This commit is contained in:
Consolatis 2022-03-30 14:59:24 +02:00 committed by Johan Malm
parent 0284956ce8
commit 9cd502f0bf

View file

@ -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);
}