summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-12-16 18:11:05 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-19 16:46:57 -0200
commite78390c4c5910cef98f0f931f162a19d3a83570b (patch)
tree787d6da52aedf4bf44d5e6ea0145cc8fc5eb02a8 /src
parente2c0b7741b7545408f4f10dcfebc36aab65f4276 (diff)
evas: remove focus when removed from filter whitelist
It doesn't make sense to remove it when a seat is added to the list. It should be removed only when this seat is blocked. But when the list receives its first item, then it also should be checked if the focused seat is the one just added, otherwise the previous one must be removed.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_main.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index a030505ffe..a705bd42b7 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -942,14 +942,28 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
942 if (add) 942 if (add)
943 { 943 {
944 if (eina_list_data_find(obj->events_whitelist, seat)) return; 944 if (eina_list_data_find(obj->events_whitelist, seat)) return;
945 if (efl_canvas_object_seat_focus_check(eo_obj, seat)) 945 /* remove all previously focused seats, if any - it may happen
946 efl_canvas_object_seat_focus_del(eo_obj, seat); 946 since there wasn't a whitelist in place (no restrictions) */
947 if ((!obj->events_whitelist) && (obj->layer) && (obj->layer->evas))
948 {
949 const Eina_List *devices, *l;
950 Efl_Input_Device *dev;
951
952 devices = obj->layer->evas->devices;
953 EINA_LIST_FOREACH(devices, l, dev)
954 {
955 if ((efl_input_device_type_get(dev) ==
956 EFL_INPUT_DEVICE_CLASS_SEAT) && (dev != seat))
957 efl_canvas_object_seat_focus_del(eo_obj, dev);
958 }
959 }
947 obj->events_whitelist = eina_list_append(obj->events_whitelist, seat); 960 obj->events_whitelist = eina_list_append(obj->events_whitelist, seat);
948 efl_event_callback_add(seat, EFL_EVENT_DEL, 961 efl_event_callback_add(seat, EFL_EVENT_DEL,
949 _whitelist_events_device_remove_cb, obj); 962 _whitelist_events_device_remove_cb, obj);
950 } 963 }
951 else 964 else
952 { 965 {
966 efl_canvas_object_seat_focus_del(eo_obj, seat);
953 obj->events_whitelist = eina_list_remove(obj->events_whitelist, seat); 967 obj->events_whitelist = eina_list_remove(obj->events_whitelist, seat);
954 efl_event_callback_del(seat, EFL_EVENT_DEL, 968 efl_event_callback_del(seat, EFL_EVENT_DEL,
955 _whitelist_events_device_remove_cb, obj); 969 _whitelist_events_device_remove_cb, obj);