summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-09 20:16:07 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-09 19:14:58 -0400
commita777fcb679833727fedbbbdc96826f947bb10ed9 (patch)
treec0f01feb28dea386ed7d9d64be5cb714320d122d /src/lib/ecore_evas
parent7e3c10838227bbb623f98f736f229cf4ab30086e (diff)
ecore-evas: make focus-setting work with async device init
@fix
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c13
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index ccc54b9f26..e5eae6d0b9 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -382,6 +382,11 @@ _ecore_evas_dev_added_or_removed(void *data, const Efl_Event *event)
382 { 382 {
383 if (_is_pointer(event->info)) 383 if (_is_pointer(event->info))
384 _ecore_evas_cursor_add(ee, event->info); 384 _ecore_evas_cursor_add(ee, event->info);
385 else if (event->info == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT))
386 {
387 if (ee->prop.focused)
388 _ecore_evas_focus_device_set(ee, event->info, 1);
389 }
385 } 390 }
386 else 391 else
387 { 392 {
@@ -1987,15 +1992,15 @@ _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
1987 1992
1988 if (!seat) 1993 if (!seat)
1989 seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT); 1994 seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
1990 if (on) 1995 if ((!on) && (!seat)) return;
1991 EINA_SAFETY_ON_NULL_RETURN(seat);
1992 else if (!seat) return;
1993 1996
1994 if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) 1997 if (seat && (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT))
1995 { 1998 {
1996 ERR("The Input device must be an seat"); 1999 ERR("The Input device must be an seat");
1997 return; 2000 return;
1998 } 2001 }
2002 ee->prop.focused = ee->prop.focused_by || on;
2003 if (!seat) return;
1999 2004
2000 present = ecore_evas_focus_device_get(ee, seat); 2005 present = ecore_evas_focus_device_get(ee, seat);
2001 if (on) 2006 if (on)
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index e905209bf4..08fed6f9dd 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -289,6 +289,7 @@ struct _Ecore_Evas
289 Eina_Bool modal : 1; 289 Eina_Bool modal : 1;
290 Eina_Bool demand_attention : 1; 290 Eina_Bool demand_attention : 1;
291 Eina_Bool focus_skip : 1; 291 Eina_Bool focus_skip : 1;
292 Eina_Bool focused : 1;
292 } prop; 293 } prop;
293 294
294 struct { 295 struct {