diff options
author | Bruno Dilly <bdilly@profusion.mobi> | 2016-12-19 13:58:01 -0200 |
---|---|---|
committer | Bruno Dilly <bdilly@profusion.mobi> | 2016-12-19 14:07:08 -0200 |
commit | 304987bb36d2c315ff920eac9d0f41b5df03a513 (patch) | |
tree | 56a5eba2c372be8e823eee18aed9507b26eea044 | |
parent | 84a36eee7bf92efca7d4b754e2b2cdbc0e1f21d3 (diff) | |
download | efl-devs/bdilly/evas_events_filter_fixes.tar.gz |
evas: improve logic regarding events filtering enablementdevs/bdilly/evas_events_filter_fixes
Only the size of events_whitelist isn't enough, because in some
cases the user may be disabling the usage of a specific seat.
Considering the following scenario, the issue will easy to understand:
- an application with two entries (one to be used by seat 1 and other
by seat 2)
- the first seat is announced - it is enabled for entry 1 and
disabled for entry 2
- the second seat is announced
Before second seat is announced, the first seat would be able
to input the entry 1, because the events_whitelist of such
object will continue empty.
So a flag will be used to identify an object with active
filter.
-rw-r--r-- | src/lib/evas/canvas/evas_object_main.c | 6 | ||||
-rw-r--r-- | src/lib/evas/include/evas_private.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index a705bd42b7..5da01927ea 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -915,8 +915,8 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_get(Eo *eo_obj EINA_UNU Evas_Object_Protected_Data *obj, Efl_Input_Device *seat) { - //If the list is empty this object accept events from any seat. - if (!obj->events_whitelist) + //It means this object accept events from any seat. + if (!obj->events_filter_enabled) return EINA_TRUE; return eina_list_data_find(obj->events_whitelist, seat) ? EINA_TRUE : EINA_FALSE; @@ -939,6 +939,8 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj, EINA_SAFETY_ON_NULL_RETURN(seat); if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return; + + obj->events_filter_enabled = EINA_TRUE; if (add) { if (eina_list_data_find(obj->events_whitelist, seat)) return; diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 25e7a7db39..c1f938829a 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1118,7 +1118,6 @@ struct _Evas_Object_Protected_Data /* The list below contain the seats (Efl.Input.Devices) which this object allows events to be reported (Mouse, Keybord and focus events). - If this list is empty, this object will allow events from any seat. */ Eina_List *events_whitelist; @@ -1212,6 +1211,7 @@ struct _Evas_Object_Protected_Data Eina_Bool src_invisible_valid : 1; } parent_cache; + Eina_Bool events_filter_enabled : 1; }; struct _Evas_Data_Node |