aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_focus.c
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-09-02 20:28:23 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-09-02 20:28:51 +0900
commita007a3af1398e66ba90eae005ccbf31dfb81788a (patch)
treeca6329a3aaf569a5cac549f16007eb8e18f4554c /src/lib/evas/canvas/evas_focus.c
parentevas: Fix sigsegv after font rehint (diff)
downloadefl-a007a3af1398e66ba90eae005ccbf31dfb81788a.tar.gz
evas: focus_set can fail... internally handle that case properly now.
Diffstat (limited to 'src/lib/evas/canvas/evas_focus.c')
-rw-r--r--src/lib/evas/canvas/evas_focus.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index 757f585dc7..5294ee653e 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -10,29 +10,36 @@
EAPI void
evas_object_focus_set(Evas_Object *eo_obj, Eina_Bool focus)
{
- eo_do(eo_obj, evas_obj_focus_set(focus));
+ eo_do(eo_obj, evas_obj_focus_set(focus, NULL));
}
void
_focus_set(Eo *eo_obj, void *_pd, va_list *list)
{
Eina_Bool focus = va_arg(*list, int);
+ Eina_Bool *r = va_arg(*list, Eina_Bool *);
int event_id = 0;
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
- Evas_Object_Protected_Data *obj = _pd;
+ Evas_Object_Protected_Data *obj = _pd;
+
+ if (r) *r = EINA_FALSE;
_evas_object_event_new();
event_id = _evas_event_counter;
- if (obj->focused == focus) goto end;
+ if (obj->focused == focus) goto success_end;
if (evas_object_intercept_call_focus_set(eo_obj, obj, focus)) goto end;
if (focus)
{
+ Eina_Bool success = EINA_TRUE;
+
if (obj->layer->evas->focused)
- evas_object_focus_set(obj->layer->evas->focused, 0);
+ eo_do(obj->layer->evas->focused,
+ evas_obj_focus_set(0, &success));
+ if (!success) goto end;
obj->focused = 1;
obj->layer->evas->focused = eo_obj;
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_IN, NULL, event_id);
@@ -47,7 +54,11 @@ _focus_set(Eo *eo_obj, void *_pd, va_list *list)
evas_event_callback_call(obj->layer->evas->evas,
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, eo_obj);
}
- end:
+
+ success_end:
+ if (r) *r = EINA_TRUE;
+
+ end:
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
}