diff --git a/client.h b/client.h index 800b867..29ddd8c 100644 --- a/client.h +++ b/client.h @@ -38,7 +38,7 @@ toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl) struct wlr_xwayland_surface *xsurface; #endif - if (!s) + if (!s || (!s->addons.addons.prev && !s->addons.addons.next)) return -1; root_surface = wlr_surface_get_root_surface(s); diff --git a/dwl.c b/dwl.c index 6f041a0..1b094f4 100644 --- a/dwl.c +++ b/dwl.c @@ -1808,8 +1808,9 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d /* Find the client under the pointer and send the event along. */ xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy); - if (cursor_mode == CurPressed && !seat->drag && surface != held_grab - && toplevel_from_wlr_surface(held_grab, &w, &l) >= 0) { + if (cursor_mode == CurPressed && !seat->drag && surface != held_grab) { + if (toplevel_from_wlr_surface(held_grab, &w, &l) < 0) + return; c = w; surface = held_grab; sx = cursor->x - (l ? l->geom.x : w->geom.x);