summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_focus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_focus.c')
-rw-r--r--src/lib/evas/canvas/evas_focus.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index 6ea934a..0b79bf9 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -106,10 +106,7 @@ _evas_object_unfocus(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat)
106{ 106{
107 int event_id = _evas_event_counter; 107 int event_id = _evas_event_counter;
108 108
109 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 109 obj->focused_by_seats = eina_list_remove(obj->focused_by_seats, seat);
110 events->focused_by_seats = eina_list_remove(events->focused_by_seats, seat);
111 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
112
113 _evas_focus_set(obj->object, seat, EINA_FALSE); 110 _evas_focus_set(obj->object, seat, EINA_FALSE);
114 _evas_focus_dispatch_event(obj, seat, EINA_FALSE); 111 _evas_focus_dispatch_event(obj, seat, EINA_FALSE);
115 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); 112 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
@@ -141,7 +138,7 @@ _efl_canvas_object_seat_focus_del(Eo *eo_obj,
141 obj->layer->evas->pending_default_focus_obj = NULL; 138 obj->layer->evas->pending_default_focus_obj = NULL;
142 } 139 }
143 140
144 EINA_LIST_FOREACH(obj->events->focused_by_seats, l, dev) 141 EINA_LIST_FOREACH(obj->focused_by_seats, l, dev)
145 { 142 {
146 if (dev != seat) 143 if (dev != seat)
147 continue; 144 continue;
@@ -187,7 +184,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
187 if (!efl_input_seat_event_filter_get(eo_obj, seat)) 184 if (!efl_input_seat_event_filter_get(eo_obj, seat))
188 return EINA_FALSE; 185 return EINA_FALSE;
189 186
190 if (_already_focused(obj->events->focused_by_seats, seat)) 187 if (_already_focused(obj->focused_by_seats, seat))
191 goto end; 188 goto end;
192 189
193 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET, 190 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
@@ -205,10 +202,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
205 202
206 efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj); 203 efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj);
207 204
208 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 205 obj->focused_by_seats = eina_list_append(obj->focused_by_seats, seat);
209 events->focused_by_seats = eina_list_append(events->focused_by_seats, seat);
210 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
211
212 _evas_focus_set(eo_obj, seat, EINA_TRUE); 206 _evas_focus_set(eo_obj, seat, EINA_TRUE);
213 207
214 _evas_focus_dispatch_event(obj, seat, EINA_TRUE); 208 _evas_focus_dispatch_event(obj, seat, EINA_TRUE);
@@ -231,7 +225,7 @@ _efl_canvas_object_seat_focus_check(Eo *eo_obj,
231 225
232 if (!seat) seat = _default_seat_get(eo_obj); 226 if (!seat) seat = _default_seat_get(eo_obj);
233 227
234 EINA_LIST_FOREACH(obj->events->focused_by_seats, l, s) 228 EINA_LIST_FOREACH(obj->focused_by_seats, l, s)
235 { 229 {
236 if (s == seat) 230 if (s == seat)
237 return EINA_TRUE; 231 return EINA_TRUE;
@@ -259,7 +253,7 @@ _efl_canvas_object_seat_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
259 return EINA_FALSE; 253 return EINA_FALSE;
260 MAGIC_CHECK_END(); 254 MAGIC_CHECK_END();
261 255
262 return eina_list_count(obj->events->focused_by_seats) ? EINA_TRUE : EINA_FALSE; 256 return eina_list_count(obj->focused_by_seats) ? EINA_TRUE : EINA_FALSE;
263} 257}
264 258
265EOLIAN Eina_Bool 259EOLIAN Eina_Bool