diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-05-17 15:11:22 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2018-05-18 09:24:29 -0500 |
commit | 6326e54b14327980e65c88b0668baf6de447caa4 (patch) | |
tree | 1e2a9ce170a9e564e665de036f66664ef8d1e526 | |
parent | e1cb483643ae2318efd6d8ed5d37ac17bf420f20 (diff) | |
download | efl-6326e54b14327980e65c88b0668baf6de447caa4.tar.gz |
efl_input_device: Fix seat_get
This was testing the same thing twice.
-rw-r--r-- | src/lib/efl/interfaces/efl_input_device.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/efl/interfaces/efl_input_device.c b/src/lib/efl/interfaces/efl_input_device.c index aed03c9980..4924f1f9d0 100644 --- a/src/lib/efl/interfaces/efl_input_device.c +++ b/src/lib/efl/interfaces/efl_input_device.c @@ -151,13 +151,17 @@ _efl_input_device_seat_id_get(const Eo *obj, Efl_Input_Device_Data *pd) EOLIAN static Efl_Input_Device * _efl_input_device_seat_get(const Eo *obj, Efl_Input_Device_Data *pd) { - for (; obj; obj = efl_parent_get(obj)) - { - if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) - return pd->eo; + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); + + if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) + return pd->eo; + while ((obj = efl_parent_get(obj))) + { if (!efl_isa(obj, MY_CLASS)) break; pd = efl_data_scope_get(obj, MY_CLASS); + if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) + return pd->eo; } return NULL; |