aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-04-25 00:02:55 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-04-25 00:21:26 +0200
commitac4d75a1ae023510133fac0a9104ded9ddf42497 (patch)
tree36ea7e1bf819e39ff516a861ba0d0686991341fb
parentgen****: just set focus to genlist / gengrid if no item is available (diff)
downloadefl-ac4d75a1ae023510133fac0a9104ded9ddf42497.tar.gz
efl_ui_focus_composition: permit anything but adapters and widgets
a wildcard gfx object could bring focus to a evas object that has no smart parent, and thus keyboard events are left at a place where they cannot come away from. clock was using this to give focus to the edit buttons. The edit buttons are now wrapped into theire own adapter objects which makes them focusable like before. However, the no keybindings or anything are taken to react on the value.
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.c7
-rw-r--r--src/lib/elementary/elm_clock.c30
2 files changed, 21 insertions, 16 deletions
diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c
index 4f3b0bcbc6..a5a49c755c 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -106,13 +106,6 @@ _efl_ui_focus_composition_composition_elements_set(Eo *obj, Efl_Ui_Focus_Composi
{
pd->register_target = eina_list_append(pd->register_target , o);
}
- else if (efl_isa(elem, EFL_GFX_ENTITY_INTERFACE))
- {
- o = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, efl_provider_find(obj, EFL_LOOP_CLASS), efl_ui_focus_composition_adapter_canvas_object_set(efl_added, elem));
-
- pd->adapters = eina_list_append(pd->adapters, o);
- pd->register_target = eina_list_append(pd->register_target , o);
- }
else
{
EINA_SAFETY_ERROR("List contains element that is not EFL_UI_FOCUS_OBJECT_MIXIN or EFL_GFX_ENTITY_INTERFACE or EFL_UI_WIDGET_CLASS");
diff --git a/src/lib/elementary/elm_clock.c b/src/lib/elementary/elm_clock.c
index 001996bae2..4ba69a1f67 100644
--- a/src/lib/elementary/elm_clock.c
+++ b/src/lib/elementary/elm_clock.c
@@ -4,10 +4,12 @@
#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
+#define EFL_UI_FOCUS_COMPOSITION_ADAPTER_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_clock.h"
+#include "efl_ui_focus_composition_adapter.eo.h"
#define MY_CLASS ELM_CLOCK_CLASS
@@ -340,17 +342,27 @@ _access_time_register(Evas_Object *obj, Eina_Bool is_access)
}
static Evas_Object*
-_part_get(Evas_Object *part, const char *part_name)
+_focus_part_get(Evas_Object *part, const char *part_name)
{
- Evas_Object *po;
+ Evas_Object *po, *adapter;
po = (Evas_Object *)edje_object_part_object_get
(part, part_name);
- if (_elm_config->access_mode != ELM_ACCESS_MODE_ON)
- return po;
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ po = evas_object_data_get(po, "_part_access_obj");
- return evas_object_data_get(po, "_part_access_obj");
+
+ adapter = evas_object_data_get(po, "_focus_adapter_object");
+
+ if (!adapter)
+ {
+ adapter = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, po);
+ efl_ui_focus_composition_adapter_canvas_object_set(adapter, part);
+ evas_object_data_set(po, "_focus_adapter_object", adapter);
+ }
+
+ return adapter;
}
static void
@@ -366,15 +378,15 @@ _flush_clock_composite_elements(Evas_Object *obj, Elm_Clock_Data *sd)
if ((!sd->seconds) && (i >= 4)) break;
if (sd->digedit & (1 << i))
{
- items = eina_list_append(items, _part_get(sd->digit[i], "access.t"));
- items = eina_list_append(items, _part_get(sd->digit[i], "access.b"));
+ items = eina_list_append(items, _focus_part_get(sd->digit[i], "access.t"));
+ items = eina_list_append(items, _focus_part_get(sd->digit[i], "access.b"));
}
}
if (sd->am_pm)
{
- items = eina_list_append(items, _part_get(sd->am_pm_obj, "access.t"));
- items = eina_list_append(items, _part_get(sd->am_pm_obj, "access.b"));
+ items = eina_list_append(items, _focus_part_get(sd->am_pm_obj, "access.t"));
+ items = eina_list_append(items, _focus_part_get(sd->am_pm_obj, "access.b"));
}
}