summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-06-23 17:58:48 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-06-24 08:26:38 +0300
commitd904e9761e417ec945e0d401735f769aaa19a480 (patch)
tree08f471bb58493b54146cfde250640c92a104e196
parent44dad9fabb718e2d75c2909b89e53cdf1b4e1b13 (diff)
CnP: improve loss callback
- Reset loss cb after invocation as it is no more needed - When selection is set, previous owner loss cb is invoked only if the new owner and the previous one are different.
-rw-r--r--src/lib/elm_cnp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index e20fbb1d3..0bee00a07 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -706,9 +706,10 @@ _x11_selection_clear(void *udata EINA_UNUSED, int type EINA_UNUSED, void *event)
706 _x11_sel_obj_del2, sel); 706 _x11_sel_obj_del2, sel);
707 sel->widget = NULL; 707 sel->widget = NULL;
708 sel->requestwidget = NULL; 708 sel->requestwidget = NULL;
709 sel->loss_cb = NULL;
710 sel->loss_data = NULL;
709 711
710 sel->active = EINA_FALSE; 712 sel->active = EINA_FALSE;
711 sel->widget = NULL;
712 ELM_SAFE_FREE(sel->selbuf, free); 713 ELM_SAFE_FREE(sel->selbuf, free);
713 return ECORE_CALLBACK_PASS_ON; 714 return ECORE_CALLBACK_PASS_ON;
714} 715}
@@ -1852,7 +1853,7 @@ _x11_elm_cnp_selection_set(Ecore_X_Window xwin, Evas_Object *obj, Elm_Sel_Type s
1852 return elm_object_cnp_selection_clear(obj, selection); 1853 return elm_object_cnp_selection_clear(obj, selection);
1853 1854
1854 sel = _x11_selections + selection; 1855 sel = _x11_selections + selection;
1855 if (sel->loss_cb) sel->loss_cb(sel->loss_data, selection); 1856 if (sel->widget != obj && sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
1856 if (sel->widget) 1857 if (sel->widget)
1857 evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL, 1858 evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
1858 _x11_sel_obj_del, sel); 1859 _x11_sel_obj_del, sel);