summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-14 10:24:47 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-11-14 10:24:57 -0800
commit883d41f0062b947c1d8793b5c6f9c586e20f484b (patch)
tree281f6e3e5ca6947a716a5565dac8501918541524
parentee5a1d28f13f3f43737d31490f4b5428ce469dbe (diff)
downloadefl-883d41f0062b947c1d8793b5c6f9c586e20f484b.tar.gz
evas focus: Do not allow two objects focused by the same seat.
Summary: Before focusing an object, the intercept focus callback is called. This callback may ask Evas to focus another object instead, so it's necessary to check if the seat in question still have a focused object event after a efl_canvas_object_seat_focus_del() call. Reviewers: cedric, bdilly, barbieri, ProhtMeyhet, netstar Subscribers: cedric, jpeg Maniphest Tasks: T4864, T4886 Differential Revision: https://phab.enlightenment.org/D4396 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/evas/canvas/evas_focus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index c09ba28e72..3245867fee 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -153,6 +153,9 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
if (current_focus)
efl_canvas_object_seat_focus_del(current_focus, seat);
+ //In case intercept focus callback focused object we should return.
+ if (_current_focus_get(eo_obj, seat)) goto end;
+
efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj);
obj->focused_by_seats = eina_list_append(obj->focused_by_seats, seat);