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
This commit is contained in:
Carsten Haitzler 2018-08-21 18:17:15 +09:00
parent 18217d8a1e
commit e3b6f5a959
2 changed files with 5 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;