From e3b6f5a959b020d68abd4c0363afff7183e6cb8a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 21 Aug 2018 18:17:15 +0900 Subject: [PATCH] efl selection manager - avoid multiple selection get callbacks for req do one request and get multiple returns if you have multiple windows. this affected terminology in one proces, multiple windows the sel get cb is called multiple times from one selection if you cnp between windows a few times. @fix --- src/lib/elementary/efl_selection_manager.c | 3 +++ src/lib/elementary/efl_selection_manager_private.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c index aa1ae9a394..3e97b5d838 100644 --- a/src/lib/elementary/efl_selection_manager.c +++ b/src/lib/elementary/efl_selection_manager.c @@ -927,6 +927,8 @@ _efl_sel_manager_x11_selection_notify(void *udata, int type EINA_UNUSED, void *e return ECORE_CALLBACK_PASS_ON; } sel_debug("Target is %s", ev->target); + if (!sel->asked) return ECORE_CALLBACK_PASS_ON; + sel->asked--; if (ev->selection != ECORE_X_SELECTION_XDND && (!strcmp(ev->target, "TARGETS") || !strcmp(ev->target, "ATOMS"))) @@ -1288,6 +1290,7 @@ _x11_efl_sel_manager_selection_get(const Efl_Object *request, Efl_Selection_Mana } } + sel->asked = 2; sel->request(xwin, ECORE_X_SELECTION_TARGET_TARGETS); } diff --git a/src/lib/elementary/efl_selection_manager_private.h b/src/lib/elementary/efl_selection_manager_private.h index 5495c9e33e..66ed7b4c0d 100644 --- a/src/lib/elementary/efl_selection_manager_private.h +++ b/src/lib/elementary/efl_selection_manager_private.h @@ -123,6 +123,8 @@ struct _Sel_Manager_Selection Efl_Selection_Action action; Eina_Bool active : 1; + unsigned char asked : 2; + Efl_Object *owner; Efl_Object *request_obj; void *data_func_data;