cursor.c: Do not segfault on missing drag icon

Observed by moving tabs in chromium wayland native
(started with --ozone-platform-hint=wayland).
This commit is contained in:
Consolatis 2022-03-30 14:59:24 +02:00 committed by Johan Malm
parent 3826d7ef36
commit 47912aebb6

View file

@ -365,6 +365,11 @@ start_drag(struct wl_listener *listener, void *data)
struct wlr_drag *wlr_drag = data;
seat->active_view = 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);
}