wayland cnp: check selection owner before calling losscb 59/54759/1
authorThiep Ha <thiep.ha@samsung.com>
Fri, 18 Dec 2015 07:46:05 +0000 (07:46 +0000)
committerThiep Ha <thiep.ha@samsung.com>
Fri, 18 Dec 2015 07:46:05 +0000 (07:46 +0000)
The selection is cleared by losscb when we set it.
As result, selection is not done.
To avoid it, we should check if the new selection owner
is current selection owner or not and only call losscb
if the new selection owner is not the current one.

Test Plan:
In wayland, select text in entry (e.g double click, ctrl-a).

upstream commit: 6c13b8db9a7dbbd417caf06d9f855986d815d075
Author: Thiep Ha <thiepha@gmail.com>
Date:   Thu Dec 17 18:13:17 2015 +0000

Change-Id: I9ff64766130858f7b98613f18c4fb88a14100cc0

src/lib/elm_cnp.c

index 070105746a99fae7d6095b5e3e7f798c0bd9af1b..d5c72894e47f2c6400e2f106be4cc6663855da7f 100644 (file)
@@ -2410,7 +2410,8 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
 
    win = elm_win_wl_window_get(obj);
 
-   if (sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
+   if ((sel->widget != obj) && sel->loss_cb)
+     sel->loss_cb(sel->loss_data, selection);
 
    if (sel->widget)
      evas_object_event_callback_del_full(sel->widget,