aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-01-30 14:23:00 +0100
committeremersion <contact@emersion.fr>2019-01-30 15:24:18 +0100
commit29952dee19c030d2ae1034e0304de72a645b4444 (patch)
tree35cfc896a7dc98097333aebf40eedc2f288722a9
parentfaa00a4a3362a8d7ea3942be50f95eb693fddb2e (diff)
data-device: only allow one drag at a time
-rw-r--r--types/data_device/wlr_drag.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
index 20c9b30e..9bd63d96 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -122,6 +122,9 @@ static void drag_end(struct wlr_drag *drag) {
drag_icon_set_mapped(drag->icon, false);
}
+ assert(drag->seat->drag == drag);
+ drag->seat->drag = NULL;
+
wlr_signal_emit_safe(&drag->events.destroy, drag);
free(drag);
}
@@ -434,6 +437,13 @@ bool seat_client_start_drag(struct wlr_seat_client *client,
return true;
}
+ if (seat->drag != NULL) {
+ wlr_log(WLR_DEBUG, "Refusing to start drag, "
+ "another drag is already in progress");
+ free(drag);
+ return true;
+ }
+
if (icon_surface) {
int32_t touch_id = (point ? point->touch_id : 0);
struct wlr_drag_icon *icon =