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
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;
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;
/*
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;
Eina_Bool src_invisible_valid : 1;
} parent_cache;
+ Eina_Bool events_filter_enabled : 1;
};
struct _Evas_Data_Node