From 3f8504c205528f1f1fa05f985852a11cbf925241 Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Fri, 7 Sep 2018 12:31:46 +0300 Subject: [PATCH] Efl selection: remove cancelled promises This removes the promises in case multiple selection_set are used and future_cancel were called. --- src/lib/elementary/efl_selection_manager.c | 5 ++++- src/lib/elementary/efl_selection_manager_private.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c index 3d5d65c2e5..846c4456e9 100644 --- a/src/lib/elementary/efl_selection_manager.c +++ b/src/lib/elementary/efl_selection_manager.c @@ -227,7 +227,8 @@ static void _sel_manager_promise_cancel(void *data, const Eina_Promise *dead_future EINA_UNUSED) { Sel_Manager_Selection_Lost *sel_lost = data; - //FIXME: remove from sel_lost_list in seat_sel + sel_lost->seat_sel->sel_lost_list = eina_list_remove( + sel_lost->seat_sel->sel_lost_list, sel_lost); free(sel_lost); } @@ -243,6 +244,7 @@ _update_sel_lost_list(Efl_Object *obj, Efl_Selection_Type type, return NULL; sel_lost->request = obj; sel_lost->type = type; + sel_lost->seat_sel = seat_sel; seat_sel->sel_lost_list = eina_list_append(seat_sel->sel_lost_list, sel_lost); p = eina_promise_new(efl_loop_future_scheduler_get(obj), @@ -1240,6 +1242,7 @@ _x11_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd, Efl_Object *o if (seat_sel->xwin == xwin) same_win = EINA_TRUE; _owner_change_check(pd->sel_man, owner, seat_sel, sel, type, same_win); + seat_sel->xwin = xwin; sel->owner = owner; free(sel->data.mem); diff --git a/src/lib/elementary/efl_selection_manager_private.h b/src/lib/elementary/efl_selection_manager_private.h index 66ed7b4c0d..f6cec6dd3f 100644 --- a/src/lib/elementary/efl_selection_manager_private.h +++ b/src/lib/elementary/efl_selection_manager_private.h @@ -141,6 +141,7 @@ struct _Sel_Manager_Selection_Lost Efl_Object *request; Eina_Promise *promise; Efl_Selection_Type type; + Sel_Manager_Seat_Selection *seat_sel; }; struct _Sel_Manager_Seat_Selection