diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-10-16 08:00:01 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-10-16 08:00:01 -0400 |
commit | b8de0a29b4f53700eef40edc76653ff318bbcf89 (patch) | |
tree | 5cc70840162d9683c5b10e785def1570f663593f /rootston/cursor.c | |
parent | 2d35e20691c86600fdb3a20dffdf71c765683e10 (diff) |
rootston: handle icon already being in the list
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r-- | rootston/cursor.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c index 19f015aa..5867528e 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -319,6 +319,14 @@ static void handle_pointer_grab_begin(struct wl_listener *listener, if (grab->interface == &wlr_data_device_pointer_drag_interface) { struct wlr_drag *drag = grab->data; if (drag->icon) { + struct roots_drag_icon *iter_icon; + wl_list_for_each(iter_icon, &input->drag_icons, link) { + if (iter_icon->surface == drag->icon) { + // already in the list + return; + } + } + struct roots_drag_icon *drag_icon = calloc(1, sizeof(struct roots_drag_icon)); drag_icon->surface = drag->icon; |