]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor.c: Do not segfault on missing drag icon
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 30 Mar 2022 12:59:24 +0000 (14:59 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 30 Mar 2022 17:22:48 +0000 (18:22 +0100)
Observed by moving tabs in chromium wayland native
(started with --ozone-platform-hint=wayland).

src/cursor.c

index 8b0eecc97eca11bf1c83ccc87b8da9ad656d5772..41e091a809987fd20e6d57839d8b3b0c0c797513 100644 (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);
 }