aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-03-09 18:52:02 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-03-15 15:39:12 +0100
commitdf55911967efe7f050c947a6ff4027701e0b4a55 (patch)
treeecbcdc3e5c7517e1c47038a3d4e08a6a7cd11fef
parentelm_widget_item_static_focus: fix fetching of the item (diff)
downloadefl-df55911967efe7f050c947a6ff4027701e0b4a55.tar.gz
efl_ui_focus_composition: redirect canvas move events to the adapter
otherwise a moving canvas object will not be recalculated, as the manager does not know about the new focus geometry
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.c39
-rw-r--r--src/lib/elementary/efl_ui_focus_composition_adapter.eo1
2 files changed, 39 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c
index ab3c6eb963..644821d898 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -196,10 +196,38 @@ typedef struct {
Evas_Object *object;
} Efl_Ui_Focus_Composition_Adapter_Data;
+static void
+_canvas_object_deleted(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ efl_ui_focus_composition_adapter_canvas_object_set(data, NULL);
+}
+
+static void
+_new_geom(void *data, const Efl_Event *event)
+{
+ efl_event_callback_call(data, event->desc, event->info);
+}
+
+
+EFL_CALLBACKS_ARRAY_DEFINE(canvas_obj,
+ {EFL_GFX_EVENT_RESIZE, _new_geom},
+ {EFL_GFX_EVENT_MOVE, _new_geom},
+ {EFL_EVENT_DEL, _canvas_object_deleted},
+);
+
EOLIAN static void
-_efl_ui_focus_composition_adapter_canvas_object_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Canvas_Object *v)
+_efl_ui_focus_composition_adapter_canvas_object_set(Eo *obj, Efl_Ui_Focus_Composition_Adapter_Data *pd, Efl_Canvas_Object *v)
{
+ if (pd->object)
+ {
+ efl_event_callback_array_del(pd->object, canvas_obj(), obj);
+ }
pd->object = v;
+ if (v)
+ {
+ efl_event_callback_array_add(pd->object, canvas_obj(), obj);
+ }
+
}
EOLIAN static Efl_Canvas_Object*
@@ -222,4 +250,13 @@ _efl_ui_focus_composition_adapter_efl_ui_focus_object_focus_set(Eo *obj EINA_UNU
evas_object_focus_set(pd->object, efl_ui_focus_object_focus_get(obj));
}
+EOLIAN static void
+_efl_ui_focus_composition_adapter_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Composition_Adapter_Data *pd)
+{
+ efl_ui_focus_composition_adapter_canvas_object_set(obj, NULL);
+
+ efl_destructor(efl_super(obj, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS));
+}
+
+
#include "efl_ui_focus_composition_adapter.eo.c"
diff --git a/src/lib/elementary/efl_ui_focus_composition_adapter.eo b/src/lib/elementary/efl_ui_focus_composition_adapter.eo
index b6e9fc927b..67096815a3 100644
--- a/src/lib/elementary/efl_ui_focus_composition_adapter.eo
+++ b/src/lib/elementary/efl_ui_focus_composition_adapter.eo
@@ -12,5 +12,6 @@ class Efl.Ui.Focus.Composition.Adapter (Efl.Object, Efl.Ui.Focus.Object)
implements {
Efl.Ui.Focus.Object.focus_geometry {get;}
Efl.Ui.Focus.Object.focus {set;}
+ Efl.Object.destructor;
}
}