summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-12-19 13:58:01 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-19 16:47:14 -0200
commitecdf56de47d5c96711619e7c8dc1586a0dee7f90 (patch)
tree73fae20e9571374968815f12c23305e547f96f21 /src
parente78390c4c5910cef98f0f931f162a19d3a83570b (diff)
evas: improve logic regarding events filtering enablement
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. Reviewed By: iscaro Differential Revision: https://phab.enlightenment.org/D4498
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_main.c6
-rw-r--r--src/lib/evas/include/evas_private.h2
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
915 Evas_Object_Protected_Data *obj, 915 Evas_Object_Protected_Data *obj,
916 Efl_Input_Device *seat) 916 Efl_Input_Device *seat)
917{ 917{
918 //If the list is empty this object accept events from any seat. 918 //It means this object accept events from any seat.
919 if (!obj->events_whitelist) 919 if (!obj->events_filter_enabled)
920 return EINA_TRUE; 920 return EINA_TRUE;
921 return eina_list_data_find(obj->events_whitelist, seat) ? 921 return eina_list_data_find(obj->events_whitelist, seat) ?
922 EINA_TRUE : EINA_FALSE; 922 EINA_TRUE : EINA_FALSE;
@@ -939,6 +939,8 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
939 EINA_SAFETY_ON_NULL_RETURN(seat); 939 EINA_SAFETY_ON_NULL_RETURN(seat);
940 940
941 if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return; 941 if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
942
943 obj->events_filter_enabled = EINA_TRUE;
942 if (add) 944 if (add)
943 { 945 {
944 if (eina_list_data_find(obj->events_whitelist, seat)) return; 946 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
1118 /* 1118 /*
1119 The list below contain the seats (Efl.Input.Devices) which this 1119 The list below contain the seats (Efl.Input.Devices) which this
1120 object allows events to be reported (Mouse, Keybord and focus events). 1120 object allows events to be reported (Mouse, Keybord and focus events).
1121 If this list is empty, this object will allow events from any seat.
1122 */ 1121 */
1123 Eina_List *events_whitelist; 1122 Eina_List *events_whitelist;
1124 1123
@@ -1212,6 +1211,7 @@ struct _Evas_Object_Protected_Data
1212 Eina_Bool src_invisible_valid : 1; 1211 Eina_Bool src_invisible_valid : 1;
1213 } parent_cache; 1212 } parent_cache;
1214 1213
1214 Eina_Bool events_filter_enabled : 1;
1215}; 1215};
1216 1216
1217struct _Evas_Data_Node 1217struct _Evas_Data_Node