Revert "elm_widget: disable focus manager in tizen" 07/216207/2
authorYeongJong Lee <yj34.lee@samsung.com>
Tue, 22 Oct 2019 08:34:37 +0000 (08:34 +0000)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 22 Oct 2019 08:36:19 +0000 (17:36 +0900)
This reverts commit 754fc972036cdc95b88faacacbeb19d802d33cea.

Change-Id: Iaf0347bcba63f54d89240d52cac41f2e9ee4f1e5

40 files changed:
src/lib/elementary/efl_ui_calendar_item.eo
src/lib/elementary/efl_ui_clock.c
src/lib/elementary/efl_ui_collection.eo
src/lib/elementary/efl_ui_collection_focus_manager.eo
src/lib/elementary/efl_ui_collection_view.eo
src/lib/elementary/efl_ui_collection_view_focus_manager.eo
src/lib/elementary/efl_ui_focus_composition.eo
src/lib/elementary/efl_ui_focus_composition_adapter.eo
src/lib/elementary/efl_ui_focus_layer.c
src/lib/elementary/efl_ui_focus_layer.eo
src/lib/elementary/efl_ui_focus_manager_calc.eo
src/lib/elementary/efl_ui_focus_manager_root_focus.eo
src/lib/elementary/efl_ui_focus_manager_sub.eo
src/lib/elementary/efl_ui_focus_object.eo
src/lib/elementary/efl_ui_focus_parent_provider_standard.eo
src/lib/elementary/efl_ui_focus_util.c
src/lib/elementary/efl_ui_layout.c
src/lib/elementary/efl_ui_scroller.eo
src/lib/elementary/efl_ui_widget.c
src/lib/elementary/efl_ui_widget.eo
src/lib/elementary/efl_ui_widget_focus_manager.c
src/lib/elementary/efl_ui_widget_focus_manager.eo
src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo
src/lib/elementary/elc_hoversel.c
src/lib/elementary/elc_naviframe.c
src/lib/elementary/elc_popup.c
src/lib/elementary/elm_entry.c
src/lib/elementary/elm_focus_legacy.c
src/lib/elementary/elm_gengrid.c
src/lib/elementary/elm_genlist.c
src/lib/elementary/elm_interface_scrollable.c
src/lib/elementary/elm_interface_scrollable.eo
src/lib/elementary/elm_list.c
src/lib/elementary/elm_priv.h
src/lib/elementary/elm_scroller.c
src/lib/elementary/elm_spinner.c
src/lib/elementary/elm_toolbar.c
src/lib/elementary/elm_widget_item_static_focus.c
src/lib/elementary_tizen/elm_genlist.c

index 9f25290..6fce49b 100644 (file)
@@ -15,8 +15,8 @@ class @beta Efl.Ui.Calendar_Item extends Efl.Object implements Efl.Ui.Focus.Obje
        }
     }
     implements {
-       @empty Efl.Ui.Focus.Object.focus {set;}
-       @empty Efl.Ui.Focus.Object.focus_parent {get;}
-       @empty Efl.Ui.Focus.Object.focus_geometry {get;}
+       Efl.Ui.Focus.Object.focus {set;}
+       Efl.Ui.Focus.Object.focus_parent {get;}
+       Efl.Ui.Focus.Object.focus_geometry {get;}
     }
 }
index 9e6bf2e..5035fdd 100644 (file)
@@ -648,7 +648,15 @@ _efl_ui_clock_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd
    int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
    if (!int_ret) return EINA_FALSE;
 
-   if (!elm_widget_focus_get(obj))
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused = EINA_FALSE;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
+   if (!focused)
+   //if (!efl_ui_focus_object_focus_get(obj))
+   //
      {
         Clock_Mod_Api *dt_mod = _dt_mod_init();
         if ((dt_mod) && (dt_mod->obj_hide))
index 2a1bf8b..a57e07b 100644 (file)
@@ -78,9 +78,9 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
       Efl.Pack_Linear.pack_index_get;
       Efl.Pack_Linear.pack_content_get;
       Efl.Ui.Scrollable.match_content { set; }
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
-      @empty Efl.Ui.Widget.focus_state_apply;
-      @empty Efl.Ui.Focus.Manager.move;
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Focus.Manager.move;
       Efl.Ui.Single_Selectable.last_selected { get; }
       Efl.Ui.Multi_Selectable.selected_iterator_new;
       Efl.Ui.Multi_Selectable.select_mode {get; set;}
index 1f636a9..fb3978c 100644 (file)
@@ -1,7 +1,7 @@
 class @beta Efl.Ui.Collection_Focus_Manager extends Efl.Ui.Focus.Manager_Calc {
   [[Internal class which implements collection specific behaviour, cannot be used outside of @Efl.Ui.Collection.]]
   implements {
-      @empty Efl.Ui.Focus.Manager.manager_focus { set; }
-      @empty Efl.Ui.Focus.Manager.request_move;
+      Efl.Ui.Focus.Manager.manager_focus { set; }
+      Efl.Ui.Focus.Manager.request_move;
   }
 }
index fd0ca1f..4bbbf97 100644 (file)
@@ -49,9 +49,9 @@ class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
       Efl.Ui.Widget.theme_apply;
 
       Efl.Ui.Scrollable.match_content { set; }
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
-      @empty Efl.Ui.Focus.Manager.move;
-      @empty Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Focus.Manager.move;
+      Efl.Ui.Widget.focus_state_apply;
    }
    events {
       item,realized : Efl.Ui.Item; [[Event triggered when an @Efl.Ui.Item has been provided by the @Efl.Ui.Factory and is about to be used.]]
index f6bd244..bd4e277 100644 (file)
@@ -1,7 +1,7 @@
 class @beta Efl.Ui.Collection_View_Focus_Manager extends Efl.Ui.Focus.Manager_Calc {
   [[Internal class which implements collection specific behaviour, cannot be used outside of collection]]
   implements {
-      @empty Efl.Ui.Focus.Manager.manager_focus { set; }
-      @empty Efl.Ui.Focus.Manager.request_move;
+      Efl.Ui.Focus.Manager.manager_focus { set; }
+      Efl.Ui.Focus.Manager.request_move;
   }
 }
index ffaaf47..a829015 100644 (file)
@@ -40,11 +40,8 @@ mixin @beta Efl.Ui.Focus.Composition requires Efl.Ui.Widget {
    }
    implements {
       Efl.Object.invalidate;
-      @empty Efl.Ui.Widget.focus_state_apply;
-      @empty Efl.Ui.Focus.Object.setup_order_non_recursive;
+      Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Focus.Object.setup_order_non_recursive;
       @empty .prepare;
-      @empty .composition_elements;
-      @empty .dirty;
-      @empty .logical_mode;
    }
 }
index 98a77cf..98d548c 100644 (file)
@@ -27,13 +27,10 @@ class @beta Efl.Ui.Focus.Composition_Adapter extends Efl.Object implements Efl.U
       }
    }
    implements {
-     @empty Efl.Ui.Focus.Object.focus_geometry {get;}
-     @empty Efl.Ui.Focus.Object.focus_parent {get;}
-     @empty Efl.Ui.Focus.Object.focus_manager {get;}
-     @empty Efl.Ui.Focus.Object.focus {set;}
-     @empty .canvas_object;
-     @empty .focus_manager_object;
-     @empty .focus_manager_parent;
+     Efl.Ui.Focus.Object.focus_geometry {get;}
+     Efl.Ui.Focus.Object.focus_parent {get;}
+     Efl.Ui.Focus.Object.focus_manager {get;}
+     Efl.Ui.Focus.Object.focus {set;}
      Efl.Object.destructor;
    }
 }
index ccbe1d3..944cf7d 100644 (file)
@@ -29,7 +29,10 @@ EOLIAN static void
 _efl_ui_focus_layer_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Focus_Layer_Data *pd, Eina_Bool v)
 {
    efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), v);
-
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
+     return;
+   //
    if (pd->enable_on_visible)
      {
         efl_ui_focus_layer_enable_set(obj, v);
@@ -57,7 +60,11 @@ _efl_ui_focus_layer_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Focus_Layer_Data *
 EOLIAN static void
 _efl_ui_focus_layer_efl_object_invalidate(Eo *obj, Efl_Ui_Focus_Layer_Data *pd EINA_UNUSED)
 {
-   efl_ui_focus_layer_enable_set(obj, EINA_FALSE);
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj))
+   //
+     efl_ui_focus_layer_enable_set(obj, EINA_FALSE);
+
    efl_invalidate(efl_super(obj, MY_CLASS));
 }
 
@@ -89,6 +96,10 @@ EOLIAN static Efl_Object*
 _efl_ui_focus_layer_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Layer_Data *pd)
 {
    obj = efl_constructor(efl_super(obj, MY_CLASS));
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
+     return obj;
+   //
    pd->enable_on_visible = EINA_TRUE;
    pd->cycle = EINA_TRUE;
    return obj;
index 768a8d7..3d07102 100644 (file)
@@ -23,15 +23,13 @@ mixin @beta Efl.Ui.Focus.Layer requires Efl.Ui.Widget extends Efl.Ui.Widget_Focu
      }
    }
    implements {
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
-      @empty Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Widget.focus_state_apply;
       Efl.Gfx.Entity.visible {set;}
-      @empty Efl.Ui.Focus.Manager.move;
-      @empty Efl.Ui.Focus.Object.focus_manager { get; }
-      @empty Efl.Ui.Focus.Object.focus_parent { get; }
+      Efl.Ui.Focus.Manager.move;
+      Efl.Ui.Focus.Object.focus_manager { get; }
+      Efl.Ui.Focus.Object.focus_parent { get; }
       Efl.Object.constructor;
       Efl.Object.invalidate;
-      @empty .enable;
-      @empty .behaviour;
    }
 }
index b7047ff..cd9ad90 100644 (file)
@@ -84,31 +84,24 @@ class @beta Efl.Ui.Focus.Manager_Calc extends Efl.Object implements Efl.Ui.Focus
     implements {
         class.constructor;
         class.destructor;
-        @empty Efl.Ui.Focus.Manager.move;
-        @empty Efl.Ui.Focus.Manager.request_move;
-        @empty Efl.Ui.Focus.Manager.manager_focus {get; set;}
-        @empty Efl.Ui.Focus.Manager.redirect {set; get;}
-        @empty Efl.Ui.Focus.Manager.border_elements {get;}
-        @empty Efl.Ui.Focus.Manager.viewport_elements {get;}
-        @empty Efl.Ui.Focus.Manager.root {set; get;}
-        @empty Efl.Ui.Focus.Manager.request_subchild;
-        @empty Efl.Ui.Focus.Manager.fetch;
-        @empty Efl.Ui.Focus.Manager.logical_end;
-        @empty Efl.Ui.Focus.Manager.reset_history;
-        @empty Efl.Ui.Focus.Manager.pop_history_stack;
-        @empty Efl.Ui.Focus.Manager.setup_on_first_touch;
-        @empty Efl.Ui.Focus.Manager.dirty_logic_freeze;
-        @empty Efl.Ui.Focus.Manager.dirty_logic_unfreeze;
+        Efl.Ui.Focus.Manager.move;
+        Efl.Ui.Focus.Manager.request_move;
+        Efl.Ui.Focus.Manager.manager_focus {get; set;}
+        Efl.Ui.Focus.Manager.redirect {set; get;}
+        Efl.Ui.Focus.Manager.border_elements {get;}
+        Efl.Ui.Focus.Manager.viewport_elements {get;}
+        Efl.Ui.Focus.Manager.root {set; get;}
+        Efl.Ui.Focus.Manager.request_subchild;
+        Efl.Ui.Focus.Manager.fetch;
+        Efl.Ui.Focus.Manager.logical_end;
+        Efl.Ui.Focus.Manager.reset_history;
+        Efl.Ui.Focus.Manager.pop_history_stack;
+        Efl.Ui.Focus.Manager.setup_on_first_touch;
+        Efl.Ui.Focus.Manager.dirty_logic_freeze;
+        Efl.Ui.Focus.Manager.dirty_logic_unfreeze;
         Efl.Object.constructor;
         Efl.Object.finalize;
         Efl.Object.provider_find;
         Efl.Object.destructor;
-        @empty .register;
-        @empty .register_logical;
-        @empty .update_redirect;
-        @empty .update_parent;
-        @empty .update_children;
-        @empty .update_order;
-        @empty .unregister;
     }
 }
index 01e084f..1572e77 100644 (file)
@@ -12,17 +12,16 @@ class @beta Efl.Ui.Focus.Manager_Root_Focus extends Efl.Ui.Focus.Manager_Calc  {
      }
   }
   implements {
-    @empty Efl.Ui.Focus.Manager_Calc.register_logical;
-    @empty Efl.Ui.Focus.Manager_Calc.register;
-    @empty Efl.Ui.Focus.Manager_Calc.unregister;
-    @empty Efl.Ui.Focus.Manager.manager_focus {set; get;}
-    @empty Efl.Ui.Focus.Manager.fetch;
-    @empty Efl.Ui.Focus.Manager.logical_end;
-    @empty Efl.Ui.Focus.Manager.border_elements {get;}
-    @empty Efl.Ui.Focus.Manager.viewport_elements {get;}
-    @empty Efl.Ui.Focus.Manager.request_move;
-    @empty Efl.Ui.Focus.Manager.move;
-    @empty .canvas_object;
+    Efl.Ui.Focus.Manager_Calc.register_logical;
+    Efl.Ui.Focus.Manager_Calc.register;
+    Efl.Ui.Focus.Manager_Calc.unregister;
+    Efl.Ui.Focus.Manager.manager_focus {set; get;}
+    Efl.Ui.Focus.Manager.fetch;
+    Efl.Ui.Focus.Manager.logical_end;
+    Efl.Ui.Focus.Manager.border_elements {get;}
+    Efl.Ui.Focus.Manager.viewport_elements {get;}
+    Efl.Ui.Focus.Manager.request_move;
+    Efl.Ui.Focus.Manager.move;
     Efl.Object.constructor;
     Efl.Object.destructor;
     Efl.Object.finalize;
index a551048..eaf0075 100644 (file)
@@ -16,6 +16,6 @@ mixin @beta Efl.Ui.Focus.Manager_Sub requires Efl.Object extends Efl.Ui.Focus.Ma
     implements {
         Efl.Object.constructor;
         Efl.Object.destructor;
-        @empty Efl.Ui.Focus.Manager.move;
+        Efl.Ui.Focus.Manager.move;
     }
 }
index 3694165..2de9620 100644 (file)
@@ -76,9 +76,6 @@ mixin Efl.Ui.Focus.Object
         @empty .focus_manager;
         @empty .focus_parent;
         @empty .on_focus_update;
-        @empty .setup_order;
-        @empty .child_focus;
-        @empty .focus;
     }
     events {
         focus,changed : bool; [[Emitted if the focus state has changed.]]
index 6e63387..ba9745d 100644 (file)
@@ -5,6 +5,6 @@ class @beta Efl.Ui.Focus.Parent_Provider_Standard extends Efl.Object implements
      the widget's parent as the focus parent.
    ]]
    implements {
-      @empty Efl.Ui.Focus.Parent_Provider.find_logical_parent;
+      Efl.Ui.Focus.Parent_Provider.find_logical_parent;
    }
 }
index 8099eb3..8914897 100644 (file)
@@ -27,10 +27,6 @@ _can_take_focus(Efl_Ui_Focus_Manager *m, Efl_Ui_Focus_Object *user)
 EOLIAN static void
 _efl_ui_focus_util_focus(Efl_Ui_Focus_Object *user)
 {
-   //TIZEN_ONLY(20191021): disable focus manager
-   return;
-   //
-   /*
    Efl_Ui_Focus_Object *entry;
    Efl_Ui_Widget *top, *o;
    Efl_Ui_Focus_Manager *m, *registered_manager;
@@ -65,30 +61,20 @@ _efl_ui_focus_util_focus(Efl_Ui_Focus_Object *user)
      {
         efl_ui_focus_manager_focus_set(registered_manager, user);
      }
-   */
 }
 
 EOLIAN static Efl_Ui_Focus_Manager*
 _efl_ui_focus_util_active_manager(Efl_Ui_Focus_Manager *manager)
 {
-   //TIZEN_ONLY(20191021): disable focus manager
-   return NULL;
-   //
-   /*
    while (efl_ui_focus_manager_redirect_get(manager))
      manager = efl_ui_focus_manager_redirect_get(manager);
 
    return manager;
-   */
 }
 
 EOLIAN static Efl_Ui_Focus_Direction
 _efl_ui_focus_util_direction_complement(Efl_Ui_Focus_Direction dir)
 {
-   //TIZEN_ONLY(20191021): disable focus manager
-   return EFL_UI_FOCUS_DIRECTION_LAST;
-   //
-   /*
   #define COMP(a,b) \
         if (dir == a) return b; \
         if (dir == b) return a;
@@ -100,7 +86,6 @@ _efl_ui_focus_util_direction_complement(Efl_Ui_Focus_Direction dir)
     #undef COMP
 
     return EFL_UI_FOCUS_DIRECTION_LAST;
-   */
 }
 
 
index 7d2bbd0..a7fbc78 100644 (file)
@@ -726,8 +726,16 @@ _efl_ui_layout_base_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_D
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 
    if (!elm_widget_can_focus_get(obj)) return EINA_FALSE;
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused = EINA_FALSE;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
 
-   if (efl_ui_focus_object_focus_get(obj))
+   if (focused)
+   //if (efl_ui_focus_object_focus_get(obj))
+   //
      {
         if (elm_widget_is_legacy(obj))
           elm_layout_signal_emit(obj, "elm,action,focus", "elm");
index 4b3b40b..2331bcf 100644 (file)
@@ -26,9 +26,9 @@ class Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements
       Efl.Content.content_unset;
       Efl.Canvas.Group.group_calculate;
       Efl.Ui.Widget.theme_apply;
-      @empty Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Widget.focus_state_apply;
       Efl.Ui.Widget.widget_input_event_handler;
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
       Efl.Ui.Scrollable.match_content { set; }
    }
 }
index 732aa9a..3a4f957 100644 (file)
   ELM_WIDGET_DATA_GET(obj, sd);                      \
   if (!sd) return
 
+//TIZEN_ONLY(20180607): Restore legacy focus
+/*
 #define ELM_WIDGET_FOCUS_GET(obj)                                          \
   (efl_isa(obj, EFL_UI_WIDGET_CLASS) &&                                    \
    ((_elm_access_auto_highlight_get()) ? (elm_widget_highlight_get(obj)) : \
                                          (efl_ui_focus_object_focus_get(obj))))
-
+*/
+#define ELM_WIDGET_FOCUS_GET(obj)                                          \
+  (efl_isa(obj, EFL_UI_WIDGET_CLASS) &&                                    \
+   ((_elm_access_auto_highlight_get()) ? (elm_widget_highlight_get(obj)) : \
+                                         (elm_widget_is_legacy(obj) ? elm_widget_focus_get(obj) : efl_ui_focus_object_focus_get(obj))))
+//
 const char SIG_WIDGET_FOCUSED[] = "focused";
 const char SIG_WIDGET_UNFOCUSED[] = "unfocused";
 const char SIG_WIDGET_LANG_CHANGED[] = "language,changed";
@@ -527,7 +534,8 @@ static Efl_Ui_Focus_Object*
 _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool should, Eina_Bool *state_change_to_parent)
 {
    //TIZEN_ONLY(20180607): Restore legacy focus
-   return NULL;
+   if (elm_widget_is_legacy(obj))
+     return NULL;
    //
    Efl_Ui_Widget *parent;
    Efl_Ui_Focus_Parent_Provider *provider;
@@ -592,7 +600,8 @@ static void
 _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
 {
    //TIZEN_ONLY(20180607): Restore legacy focus
-   return;
+   if (elm_widget_is_legacy(obj))
+     return;
    //
    Efl_Ui_Focus_Object *old_parent;
    Efl_Ui_Focus_Object *old_registered_parent, *old_registered_manager;
@@ -874,8 +883,11 @@ _efl_ui_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
    eina_stringshare_del(sd->style);
    if (sd->theme) elm_theme_free(sd->theme);
    //TIZEN_ONLY(20180607): Restore legacy focus
-   _if_focused_revert(obj, EINA_TRUE);
-   efl_ui_widget_focus_custom_chain_unset(obj);
+   if (elm_widget_is_legacy(obj))
+     {
+        _if_focused_revert(obj, EINA_TRUE);
+        efl_ui_widget_focus_custom_chain_unset(obj);
+     }
    //
    eina_stringshare_del(sd->access_info);
    eina_stringshare_del(sd->accessible_name);
@@ -946,7 +958,8 @@ void
 _elm_widget_full_eval_children(Eo *obj, Elm_Widget_Smart_Data *sd)
 {
    //TIZEN_ONLY(20180607): Restore legacy focus
-   return;
+   if (elm_widget_is_legacy(obj))
+     return;
    //
    Eina_List *l;
    Eo *child;
@@ -2768,7 +2781,10 @@ _efl_ui_widget_disabled_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina
      {
         //TIZEN_ONLY(20180607): Restore legacy focus
         if (elm_widget_is(subs))
-          efl_ui_widget_focus_disabled_handle((Evas_Object *)subs);
+          {
+             if (elm_widget_is_legacy(subs))
+               efl_ui_widget_focus_disabled_handle((Evas_Object *)subs);
+          }
         //
         if (efl_isa(subs, EFL_UI_WIDGET_CLASS))
           efl_ui_widget_disabled_set(subs, efl_ui_widget_disabled_get(obj));
@@ -3681,21 +3697,25 @@ elm_widget_focus_mouse_up_handle(Eo *obj)
 
    if (!_is_focusable(obj)) return;
 
-   /TIZEN_ONLY(20180607): Restore legacy focus
-   if (pd->focus.manager && !pd->focus.logical)
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
      {
-        efl_ui_focus_util_focus(obj);
+        Evas_Object *o = obj;
+        do
+          {
+             if (_elm_widget_is(o)) break;
+             o = evas_object_smart_parent_get(o);
+          }
+        while (o);
+
+        efl_ui_widget_focus_mouse_up_handle(o);
+        return;
      }
-   */
-   Evas_Object *o = obj;
-   do
+   //
+   if (pd->focus.manager && !pd->focus.logical)
      {
-        if (_elm_widget_is(o)) break;
-        o = evas_object_smart_parent_get(o);
+        efl_ui_focus_util_focus(obj);
      }
-   while (o);
-
-   efl_ui_widget_focus_mouse_up_handle(o);
 }
 
 // TIZEN_ONLY(20190821): keep legacy focus logic
@@ -5760,16 +5780,24 @@ _efl_ui_widget_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Widget_Smart_Dat
    if (!elm_widget_can_focus_get(obj))
      return EINA_FALSE;
 
-   focused = efl_ui_focus_object_focus_get(obj);
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+   //
+     focused = efl_ui_focus_object_focus_get(obj);
 
    if (!sd->resize_obj)
      evas_object_focus_set(obj, focused);
 
    //TIZEN_ONLY(20180607): Restore legacy focus
-   if (focused)
-     evas_object_smart_callback_call(obj, "focused", NULL);
-   else
-     evas_object_smart_callback_call(obj, "unfocused", NULL);
+   if (elm_widget_is_legacy(obj))
+     {
+        if (focused)
+          evas_object_smart_callback_call(obj, "focused", NULL);
+        else
+          evas_object_smart_callback_call(obj, "unfocused", NULL);
+     }
    //
 
    if (_elm_atspi_enabled() && !elm_widget_child_can_focus_get(obj))
index ba866b8..8f1e3c6 100644 (file)
@@ -672,10 +672,10 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object,
       Efl.Access.Object.access_children { get; }
       Efl.Access.Object.attributes { get; }
       Efl.Access.Component.focus_grab;
-      @empty Efl.Ui.Focus.Object.focus_manager { get; }
-      @empty Efl.Ui.Focus.Object.focus_parent { get; }
-      @empty Efl.Ui.Focus.Object.focus_geometry { get; }
-      @empty Efl.Ui.Focus.Object.focus { set; }
+      Efl.Ui.Focus.Object.focus_manager { get; }
+      Efl.Ui.Focus.Object.focus_parent { get; }
+      Efl.Ui.Focus.Object.focus_geometry { get; }
+      Efl.Ui.Focus.Object.focus { set; }
       Efl.Ui.I18n.mirrored { get; set; [[This sets the mirror state of the whole sub-tree. ]] }
       Efl.Ui.I18n.mirrored_automatic { get; set; }
       Efl.Ui.Focus.Object.on_focus_update;
index 2e14ce7..e5270ad 100644 (file)
@@ -21,7 +21,6 @@ _efl_ui_widget_focus_manager_efl_object_constructor(Eo *obj, Efl_Ui_Widget_Focus
 {
    Eo *res = NULL;
 
-   /* TIZEN_ONLY(20191021): disable focus manager
    pd->manager = efl_ui_widget_focus_manager_create(obj, obj);
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(pd->manager, res);
@@ -29,7 +28,6 @@ _efl_ui_widget_focus_manager_efl_object_constructor(Eo *obj, Efl_Ui_Widget_Focus
    efl_ref(pd->manager);
    efl_composite_attach(obj, pd->manager);
    _efl_ui_focus_manager_redirect_events_add(pd->manager, obj);
-   */
    res = efl_constructor(efl_super(obj, MY_CLASS));
 
 
@@ -41,11 +39,9 @@ _efl_ui_widget_focus_manager_efl_object_destructor(Eo *obj, Efl_Ui_Widget_Focus_
 {
    efl_destructor(efl_super(obj, MY_CLASS));
 
-   /* TIZEN_ONLY(20191021): disable focus manager
    _efl_ui_focus_manager_redirect_events_del(pd->manager, obj);
    efl_unref(pd->manager);
    pd->manager = NULL;
-   */
 }
 
 EOLIAN static Eina_Bool
index 1a69c48..431fea7 100644 (file)
@@ -23,6 +23,6 @@ mixin Efl.Ui.Widget_Focus_Manager
   implements {
       Efl.Object.constructor;
       Efl.Object.destructor;
-      @empty Efl.Ui.Widget.focus_state_apply;
+      Efl.Ui.Widget.focus_state_apply;
   }
 }
index e16009a..c289562 100644 (file)
@@ -1633,39 +1633,53 @@ _elm_win_focus_in(Ecore_Evas *ee)
    ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
    if (sd->type != EFL_UI_WIN_TYPE_FAKE)
      {
-        /* TIZEN_ONLY(20180607): Restore legacy focus
-        Efl_Ui_Focus_Manager *man = sd->obj;
-        while(efl_ui_focus_manager_redirect_get(man))
-          {
-             man = efl_ui_focus_manager_redirect_get(man);
-          }
-
-        Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
-        if (focused)
-          efl_ui_focus_object_focus_set(focused, EINA_TRUE);
-        */
-        if (!efl_ui_widget_focus_order_get(obj))
+        //TIZEN_ONLY(20180607): Restore legacy focus
+        if (elm_widget_is_legacy(obj))
           {
-             efl_ui_widget_focus_steal(obj, NULL);
+             if (!efl_ui_widget_focus_order_get(obj))
+               {
+                  efl_ui_widget_focus_steal(obj, NULL);
+               }
+             else
+               {
+                  Evas_Object *newest = NULL;
+                  unsigned int newest_focus_order = 0;
+
+                  newest = efl_ui_widget_newest_focus_order_get
+                     (obj, &newest_focus_order, EINA_TRUE);
+                  // TIZEN_ONLY (20180508): onscreen_is should not be checked
+                  //                        to keep compatibility with Tizen 2.4
+                  /*
+                  if (newest &&
+                      (_elm_widget_onscreen_is(newest) || (newest == obj)))
+                    efl_ui_widget_focus_restore(obj);
+                  */
+                  if (newest) efl_ui_widget_focus_restore(obj);
+                  /////////////////////////////////////////////////////////////
+                  else
+                    evas_object_focus_set(obj, EINA_TRUE);
+               }
           }
         else
+        //
           {
-             Evas_Object *newest = NULL;
-             unsigned int newest_focus_order = 0;
+             Efl_Ui_Focus_Manager *man = sd->obj;
+             while(efl_ui_focus_manager_redirect_get(man))
+               {
+                  man = efl_ui_focus_manager_redirect_get(man);
+               }
 
-             newest = efl_ui_widget_newest_focus_order_get
-                (obj, &newest_focus_order, EINA_TRUE);
-             if (newest) efl_ui_widget_focus_restore(obj);
-             else
-               evas_object_focus_set(obj, EINA_TRUE);
+             Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
+             if (focused)
+               efl_ui_focus_object_focus_set(focused, EINA_TRUE);
           }
-        //
      }
 
    evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
    //TIZEN_ONLY(20180607): Restore legacy focus
-   //evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
+   if (!elm_widget_is_legacy(obj))
    //
+     evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
    ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
    sd->focus_highlight.cur.visible = EINA_TRUE;
    _elm_win_focus_highlight_reconfigure_job_start(sd);
@@ -1681,7 +1695,6 @@ _elm_win_focus_in(Ecore_Evas *ee)
    /* else if (sd->img_obj) */
    /*   { */
    /*   } */
-   /* TIZEN_ONLY(20180607): Restore legacy focus
    if ((!efl_ui_focus_manager_focus_get(sd->obj)) &&
        (!efl_ui_focus_manager_redirect_get(sd->obj)))
      {
@@ -1694,7 +1707,6 @@ _elm_win_focus_in(Ecore_Evas *ee)
         else  if (!evas_focus_get(evas_object_evas_get(sd->obj)))
           evas_object_focus_set(obj, EINA_TRUE);
      }
-   */
 }
 
 static void
@@ -1711,8 +1723,9 @@ _elm_win_focus_out(Ecore_Evas *ee)
    ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
    evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
    //TIZEN_ONLY(20180607): Restore legacy focus
-   //evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
+   if (!elm_widget_is_legacy(obj))
    //
+     evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
    ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
    sd->focus_highlight.cur.visible = EINA_FALSE;
    _elm_win_focus_highlight_reconfigure_job_start(sd);
@@ -1727,9 +1740,10 @@ _elm_win_focus_out(Ecore_Evas *ee)
         efl_access_window_deactivated_signal_emit(obj);
         efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_TYPE_ACTIVE, EINA_FALSE);
      }
-
-   /*TIZEN_ONLY(20180607): Restore legacy focus
-   if (sd->type != EFL_UI_WIN_TYPE_FAKE)
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj) && sd->type != ELM_WIN_FAKE)
+   //if (sd->type != EFL_UI_WIN_TYPE_FAKE)
+   //
      {
         Efl_Ui_Focus_Manager *man = sd->obj;
         while(efl_ui_focus_manager_redirect_get(man))
@@ -1740,7 +1754,6 @@ _elm_win_focus_out(Ecore_Evas *ee)
         Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
         efl_ui_focus_object_focus_set(focused, EINA_FALSE);
      }
-   */
    /* do nothing */
    /* if (sd->img_obj) */
    /*   { */
@@ -2313,10 +2326,24 @@ _efl_ui_win_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Win_Data *sd)
    if (!efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS)))
      return EINA_TRUE;
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
+
    if (sd->img_obj)
-     evas_object_focus_set(sd->img_obj, efl_ui_focus_object_focus_get(obj));
+     evas_object_focus_set(sd->img_obj, focused);
    else
-     evas_object_focus_set(obj, efl_ui_focus_object_focus_get(obj));
+     evas_object_focus_set(obj, focused);
+   /*
+   if (sd->img_obj)
+     evas_object_focus_set(sd->img_obj, efl_ui_focus_object_focus_get(obj));
+    else
+      evas_object_focus_set(obj, efl_ui_focus_object_focus_get(obj));
+   */
+   //
 
    return EINA_TRUE;
 }
@@ -2350,12 +2377,13 @@ _key_action_move(Evas_Object *obj, const char *params)
      focus_dir = EFL_UI_FOCUS_DIRECTION_DOWN;
    else return EINA_FALSE;
 
-   //TIZEN_ONLY(20180607): Restore legacy focus
-   efl_ui_widget_focus_cycle(obj, focus_dir);
-   /*
+
    // The handling for legacy is different due to elm_object_next set
    if (elm_widget_is_legacy(obj))
-     elm_object_focus_next(obj, focus_dir);
+     //TIZEN_ONLY(20180607): Restore legacy focus
+     //elm_object_focus_next(obj, focus_dir);
+     efl_ui_widget_focus_cycle(obj, focus_dir);
+     //
    else
      {
         Efl_Ui_Widget *o;
@@ -2372,7 +2400,7 @@ _key_action_move(Evas_Object *obj, const char *params)
                }
           }
      }
-   */
+
    return EINA_TRUE;
 }
 
@@ -3444,12 +3472,15 @@ _win_img_hide(void *data,
               Evas_Object *obj EINA_UNUSED,
               void *event_info EINA_UNUSED)
 {
-   /* TIZEN_ONLY(20180607): Restore legacy focus
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(data))
+     {
+        efl_ui_widget_focus_hide_handle(data);
+        return;
+     }
+   //
    Efl_Ui_Win *real_win = elm_widget_top_get(data);
    efl_ui_focus_manager_redirect_set(real_win, NULL);
-   */
-   efl_ui_widget_focus_hide_handle(data);
-   //
 }
 
 static void
@@ -3469,13 +3500,16 @@ _win_img_focus_in(void *data,
                   Evas_Object *obj EINA_UNUSED,
                   void *event_info EINA_UNUSED)
 {
-   /* TIZEN_ONLY(20180607): Restore legacy focus
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(data))
+     {
+        efl_ui_widget_focus_steal(data, NULL);
+        return;
+     }
+   //
    Efl_Ui_Win *real_win = elm_widget_top_get(data);
    efl_ui_focus_manager_redirect_set(real_win, data);
    efl_ui_focus_manager_focus_set(data, efl_ui_focus_manager_root_get(data));
-   */
-   efl_ui_widget_focus_steal(data, NULL);
-   //
 }
 
 static void
@@ -3484,12 +3518,15 @@ _win_img_focus_out(void *data,
                    Evas_Object *obj EINA_UNUSED,
                    void *event_info EINA_UNUSED)
 {
-   /* TIZEN_ONLY(20180607): Restore legacy focus
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(data))
+     {
+        efl_ui_widget_focused_object_clear(data);
+        return;
+     }
+   //
    Efl_Ui_Win *real_win = elm_widget_top_get(data);
    efl_ui_focus_manager_redirect_set(real_win, NULL);
-   */
-   efl_ui_widget_focused_object_clear(data);
-   //
 }
 
 static void
@@ -10339,12 +10376,13 @@ EAPI Eina_Bool
 elm_win_focus_get(const Efl_Ui_Win *obj)
 {
    EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, MY_CLASS), EINA_FALSE);
-   /* TIZEN_ONLY(20180607): Restore legacy focus
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
+     {
+        ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+        return ecore_evas_focus_get(sd->ee);
+     }
    return efl_ui_focus_object_focus_get(obj);
-   */
-   ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
-   return ecore_evas_focus_get(sd->ee);
-   //
 }
 
 EAPI Eina_Bool
index 15d804a..e37b3f5 100644 (file)
@@ -836,10 +836,10 @@ class @beta Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Ac
                                    that it's not covered by any other window.]]
       Efl.Gfx.Stack.lower_to_bottom; [[This action is ignored by the Window.]]
       Efl.Ui.Widget.theme_apply;
-      @empty Efl.Ui.Focus.Object.focus { get; }
+      Efl.Ui.Focus.Object.focus { get; }
       Efl.Ui.Focus.Object.on_focus_update;
       Efl.Ui.Widget.widget_input_event_handler;
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
       Efl.Access.Object.state_set { get; }
       Efl.Access.Object.i18n_name { get; }
       Efl.Access.Component.extents { get; }
index 7f986bd..d7d583d 100644 (file)
@@ -647,6 +647,11 @@ EOLIAN static Eina_Bool
 _elm_hoversel_item_elm_widget_item_item_focus_get(const Eo *eo_it EINA_UNUSED,
                                              Elm_Hoversel_Item_Data *it)
 {
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(VIEW(it)))
+     return elm_widget_focus_get(VIEW(it));
+   //
+
    return efl_ui_focus_object_focus_get(VIEW(it));
 }
 
@@ -931,10 +936,14 @@ _elm_hoversel_item_add(Eo *obj, Elm_Hoversel_Data *sd, const char *label, const
     evas_object_smart_callback_add(bt, "clicked", _on_item_clicked, item);
 
     //TIZEN_ONLY(20180607): Restore legacy focus
-    evas_object_smart_callback_add(bt, "focused", _item_focused_cb, item);
-    evas_object_smart_callback_add(bt, "unfocused", _item_unfocused_cb, item);
+    if (elm_widget_is_legacy(bt))
+      {
+         evas_object_smart_callback_add(bt, "focused", _item_focused_cb, item);
+         evas_object_smart_callback_add(bt, "unfocused", _item_unfocused_cb, item);
+      }
+    else
     //
-    efl_event_callback_add(bt, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _item_focus_changed, item);
+      efl_event_callback_add(bt, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _item_focus_changed, item);
 
 
    sd->items = eina_list_append(sd->items, eo_item);
index 353a867..6f83267 100644 (file)
@@ -149,24 +149,27 @@ _resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item_Data *it)
 static void
 _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
 {
-   /* TIZEN_ONLY(20180607): Restore legacy focus
-   Elm_Naviframe *n = it->base->widget;
-   efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(n), n);
-   */
-   Evas_Object *newest;
-   unsigned int order = 0;
-
-   newest = efl_ui_widget_newest_focus_order_get(VIEW(it), &order, EINA_TRUE);
-   if (newest)
-     elm_object_focus_set(newest, EINA_TRUE);
-   else
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(it->base->widget))
      {
-        if (elm_object_focus_allow_get(VIEW(it)))
-          elm_object_focus_set(VIEW(it), EINA_TRUE);
+        Evas_Object *newest;
+        unsigned int order = 0;
+
+        newest = efl_ui_widget_newest_focus_order_get(VIEW(it), &order, EINA_TRUE);
+        if (newest)
+          elm_object_focus_set(newest, EINA_TRUE);
         else
-          elm_object_focus_set(WIDGET(it), EINA_TRUE);
+          {
+             if (elm_object_focus_allow_get(VIEW(it)))
+               elm_object_focus_set(VIEW(it), EINA_TRUE);
+             else
+               elm_object_focus_set(WIDGET(it), EINA_TRUE);
+          }
+        return;
      }
    //
+   Elm_Naviframe *n = it->base->widget;
+   efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(n), n);
 }
 
 EOLIAN static void
@@ -1661,9 +1664,10 @@ _elm_naviframe_efl_canvas_group_group_add(Eo *obj, Elm_Naviframe_Data *priv)
 
    evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _on_obj_size_hints_changed, obj);
+   elm_widget_can_focus_set(obj, EINA_FALSE);
    //TIZEN_ONLY(20180607): Restore legacy focus
-   //elm_widget_can_focus_set(obj, EINA_FALSE);
-   elm_widget_can_focus_set(obj, EINA_TRUE);
+   if (elm_widget_is_legacy(obj))
+     elm_widget_can_focus_set(obj, EINA_TRUE);
    //
 }
 
@@ -1866,7 +1870,7 @@ _item_push_helper(Elm_Naviframe_Item_Data *item)
 
    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_item, top_item);
    //TIZEN_ONLY(20180607): Restore legacy focus
-   if (top_item)
+   if (top_item && elm_widget_is_legacy(obj))
      efl_ui_widget_focused_object_clear(VIEW(top_item));
    //
    _resize_object_reset(obj, item);
@@ -2066,7 +2070,8 @@ _elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Ite
    if (top_inserted)
      {
         //TIZEN_ONLY(20180607): Restore legacy focus
-        efl_ui_widget_focused_object_clear(VIEW(after));
+        if (elm_widget_is_legacy(obj))
+          efl_ui_widget_focused_object_clear(VIEW(after));
         //
         elm_widget_tree_unfocusable_set(VIEW(after), EINA_TRUE);
         _resize_object_reset(obj, it);
index cc18b73..f351f3c 100644 (file)
@@ -2239,8 +2239,11 @@ _elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv)
    efl_event_callback_array_add(priv->notify, _notify_cb(), obj);
 
    //TIZEN_ONLY(20180607): Restore legacy focus
-   elm_widget_can_focus_set(obj, EINA_TRUE);
-   elm_widget_can_focus_set(priv->main_layout, EINA_TRUE);
+   if (elm_widget_is_legacy(obj))
+     {
+        elm_widget_can_focus_set(obj, EINA_TRUE);
+        elm_widget_can_focus_set(priv->main_layout, EINA_TRUE);
+     }
    //
 
    _populate_theme_scroll(priv);
index 0e663c4..2cbeb85 100644 (file)
@@ -1364,7 +1364,16 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
 
    if (cursor_pos) elm_entry_cursor_pos_set(obj, cursor_pos);
 
-   if (efl_ui_focus_object_focus_get(obj))
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
+
+   if (focused)
+   //if (efl_ui_focus_object_focus_get(obj))
+   //
      {
         edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
         if (sd->scroll)
@@ -1785,7 +1794,16 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd)
    if (top && efl_isa(top, EFL_UI_WIN_CLASS))
      top_is_win = EINA_TRUE;
 
-   if (efl_ui_focus_object_focus_get(obj) && sd->editable)
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused = EINA_FALSE;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
+
+   if (focused && sd->editable)
+   //if (efl_ui_focus_object_focus_get(obj) && sd->editable)
+   //
      {
         evas_object_focus_set(sd->entry_edje, EINA_TRUE);
         edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
@@ -3461,7 +3479,15 @@ _entry_cursor_changed_signal_cb(void *data,
        (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
    sd->cur_changed = EINA_TRUE;
 
-   if (efl_ui_focus_object_focus_get(data))
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused;
+   if (elm_widget_is_legacy(data))
+     focused = elm_widget_focus_get(data);
+   else
+     focused = efl_ui_focus_object_focus_get(data);
+   if (focused)
+   //if (efl_ui_focus_object_focus_get(data))
+   //
      edje_object_signal_emit(sd->entry_edje, "elm,action,show,cursor", "elm");
    _cursor_geometry_recalc(data);
 
@@ -5997,13 +6023,16 @@ _elm_entry_editable_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool editable)
    efl_ui_widget_theme_apply(obj);
    _elm_entry_focus_update(obj, sd);
 
-   /* TIZEN_ONLY(20180607): Restore legacy focus
-   //legacy focus event emission
-   if (efl_ui_focus_object_focus_get(obj))
-     evas_object_smart_callback_call(obj, "focused", NULL);
-   else
-     evas_object_smart_callback_call(obj, "unfocused", NULL);
-   */
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj))
+   //
+     {
+        //legacy focus event emission
+        if (efl_ui_focus_object_focus_get(obj))
+          evas_object_smart_callback_call(obj, "focused", NULL);
+        else
+          evas_object_smart_callback_call(obj, "unfocused", NULL);
+     }
    elm_drop_target_del(obj, sd->drop_format,
                        _dnd_enter_cb, NULL,
                        _dnd_leave_cb, NULL,
index 2479b01..aa87424 100644 (file)
@@ -238,14 +238,13 @@ EAPI void
 elm_object_focus_next(Evas_Object        *obj,
                       Elm_Focus_Direction dir)
 {
-   //TIZEN_ONLY(20180607): Restore legacy focus
-   /*
    Eina_Bool legacy_focus_move = EINA_FALSE;
    Efl_Ui_Widget *o = NULL, *top;
    Efl_Ui_Focus_Object *logical;
    Efl_Ui_Focus_Manager *manager_top;
    API_ENTRY()
-
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   /*
    top = elm_object_top_widget_get(obj);
    EINA_SAFETY_ON_FALSE_RETURN(efl_isa(top, EFL_UI_WIN_CLASS));
 
@@ -313,7 +312,6 @@ elm_object_focus_next(Evas_Object        *obj,
           }
      }
    */
-   EINA_SAFETY_ON_NULL_RETURN(obj);
    efl_ui_widget_focus_cycle(obj, dir);
    //
 }
@@ -322,10 +320,10 @@ EAPI Evas_Object *
 elm_object_focus_next_object_get(const Evas_Object  *obj,
                                  Elm_Focus_Direction dir)
 {
-   //TIZEN_ONLY(20180607): Restore legacy focus
-   /*
    Efl_Ui_Widget *top = elm_object_top_widget_get(obj);
    API_ENTRY_VAL(NULL)
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   /*
 
    #define MAP(direction, field)  if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.field) return pd->legacy_focus.field;
    MAPPING()
@@ -333,7 +331,6 @@ elm_object_focus_next_object_get(const Evas_Object  *obj,
 
    return efl_ui_focus_manager_request_move(efl_ui_focus_util_active_manager(top), dir, NULL, EINA_FALSE);
    */
-   EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
    return efl_ui_widget_focus_next_object_get(obj, dir);
    //
 }
@@ -400,18 +397,18 @@ elm_object_focused_object_get(const Evas_Object *obj)
 EAPI Eina_Bool
 elm_object_focus_get(const Evas_Object *obj)
 {
-   /* TIZEN_ONLY(20180607): Restore legacy focus
-   API_ENTRY_VAL(EINA_FALSE)
+   //TIZEN_ONLY(20181205): disable focus manager stuff
+   //API_ENTRY_VAL(EINA_FALSE)
 
    if (!elm_widget_is(obj))
      return evas_object_focus_get(obj);
 
-   return _elm_widget_top_win_focused_get(obj) && (efl_ui_focus_object_child_focus_get(obj) | efl_ui_focus_object_focus_get(obj));
-   */
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
-   return elm_widget_focus_get(obj);
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
+     return elm_widget_focus_get(obj);
    //
+
+   return _elm_widget_top_win_focused_get(obj) && (efl_ui_focus_object_child_focus_get(obj) | efl_ui_focus_object_focus_get(obj));
 }
 
 EAPI void
@@ -430,13 +427,17 @@ elm_object_focus_set(Evas_Object *obj,
      }
    else if (elm_widget_is(obj))
      {
-        if (focus == elm_widget_focus_get(obj)) return;
+        if (elm_widget_is_legacy(obj))
+          {
+             if (focus == elm_widget_focus_get(obj)) return;
+
+             if (focus)
+               efl_ui_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
+             else
+               efl_ui_widget_focused_object_clear(obj);
+             return;
+          }
 
-        if (focus)
-          efl_ui_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
-        else
-          efl_ui_widget_focused_object_clear(obj);
-        /* TIZEN_ONLY(20191021): disable focus manager
         if (focus)
           efl_ui_focus_util_focus(obj);
         else
@@ -444,7 +445,6 @@ elm_object_focus_set(Evas_Object *obj,
              if (efl_ui_focus_manager_focus_get(efl_ui_focus_object_focus_manager_get(obj)) == obj)
                efl_ui_focus_manager_pop_history_stack(efl_ui_focus_object_focus_manager_get(obj));
           }
-        */
      }
    else
      {
@@ -484,7 +484,8 @@ void
 legacy_efl_ui_focus_manager_widget_legacy_signals(Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Manager *emittee)
 {
    //TIZEN_ONLY(20180607): disable focus manager stuff
-   return;
+   if (elm_widget_is_legacy(manager))
+     return;
    //
 
    Legacy_Manager_Focus_State *state = calloc(1, sizeof(Legacy_Manager_Focus_State));
@@ -532,7 +533,8 @@ void
 legacy_child_focus_handle(Efl_Ui_Focus_Object *object)
 {
    //TIZEN_ONLY(20180607): disable focus manager stuff
-   return;
+   if (elm_widget_is_legacy(object))
+     return;
    //
 
    Legacy_Object_Focus_State *state = calloc(1, sizeof(Legacy_Object_Focus_State));
@@ -555,7 +557,8 @@ void
 legacy_object_focus_handle(Efl_Ui_Focus_Object *object)
 {
    //TIZEN_ONLY(20180607): disable focus manager stuff
-   return;
+   if (elm_widget_is_legacy(object))
+     return;
    //
 
    efl_event_callback_add(object, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _focus_event_changed, NULL);
index 3e7a00c..ddbbd4b 100755 (executable)
@@ -134,10 +134,6 @@ static const Elm_Action key_actions[] = {
 static void
 _flush_focus_on_realization(Eo *widget, Elm_Gen_Item *it)
 {
-   //TIZEN_ONLY(20191021): disable focus manager
-   return;
-   //
-
    ELM_GENGRID_DATA_GET_OR_RETURN(widget, sd);
 
    if (sd->focus_on_realization == it)
@@ -2273,7 +2269,10 @@ _item_place(Elm_Gen_Item *it,
              _elm_gengrid_item_index_update(it);
              efl_event_callback_legacy_call
                (WIDGET(it), ELM_GENGRID_EVENT_REALIZED, EO_OBJ(it));
-             _flush_focus_on_realization(WIDGET(it), it);
+             //TIZEN_ONLY(20181205): disable focus manager stuff
+             //_flush_focus_on_realization(WIDGET(it), it);
+             if (!elm_widget_is_legacy(WIDGET(it)))
+               _flush_focus_on_realization(WIDGET(it), it);
           }
         if (it->parent)
           {
@@ -2539,7 +2538,10 @@ _group_item_place(Elm_Gengrid_Pan_Data *psd)
                   _elm_gengrid_item_index_update(it);
                   efl_event_callback_legacy_call
                     (WIDGET(it), ELM_GENGRID_EVENT_REALIZED, EO_OBJ(it));
-                  _flush_focus_on_realization(WIDGET(it), it);
+                  //TIZEN_ONLY(20181205): disable focus manager stuff
+                  //_flush_focus_on_realization(WIDGET(it), it);
+                  if (!elm_widget_is_legacy(WIDGET(it)))
+                    _flush_focus_on_realization(WIDGET(it), it);
                }
              //TIZEN_ONLY(20170131): Group on Top Feature is not tizen UI.
              /*
@@ -4179,6 +4181,54 @@ _key_action_move(Evas_Object *obj, const char *params)
                y += page_y;
           }
      }
+
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   else if (!elm_widget_is_legacy(obj))
+     {
+        if (_get_direction(dir, &direction))
+          {
+             if (mirrored)
+               {
+                 if (direction == ELM_FOCUS_RIGHT || direction == ELM_FOCUS_LEFT)
+                   direction = _direction_mirror(direction);
+               }
+             if (sd->reorder_mode)
+               {
+                  return _reorder_helper(sd, direction);
+               }
+             else
+               {
+                  Evas_Object *next = NULL;
+                  next = elm_object_item_focus_next_object_get(sd->focused_item,
+                                                               ELM_FOCUS_LEFT);
+                  if (next)
+                    {
+                       elm_object_focus_set(next, EINA_TRUE);
+                       return EINA_TRUE;
+                    }
+               }
+             return _focus_move(obj, sd, direction);
+
+          }
+        else if (_get_multi_direction(dir, &direction))
+          {
+             if (mirrored)
+               {
+                 if (direction == ELM_FOCUS_RIGHT || direction == ELM_FOCUS_LEFT)
+                   direction = _direction_mirror(direction);
+               }
+             if (direction == ELM_FOCUS_LEFT || direction == ELM_FOCUS_RIGHT)
+               {
+                  if (_elm_gengrid_item_edge_check(sd->focused_item, direction))
+                    return EINA_FALSE;
+               }
+             if (_item_multi_select(sd, direction)) return EINA_TRUE;
+             else if (_selection_single_move(obj, sd, direction)) return EINA_TRUE;
+             else return EINA_FALSE;
+          }
+        else
+          return EINA_FALSE;
+     }
    else if ((!strcmp(dir, "left") && !mirrored) ||
        (!strcmp(dir, "right") && mirrored))
      {
@@ -4710,6 +4760,9 @@ _elm_gengrid_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Gengrid_Data *sd)
    int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
    if (!int_ret) return EINA_FALSE;
 
+   //Fallback Legacy Focus
+   if (!elm_widget_is_legacy(obj)) return EINA_TRUE;
+
    if (elm_widget_focus_get(obj) && (sd->selected) &&
        (!sd->last_selected_item))
      {
@@ -4755,7 +4808,9 @@ _elm_gengrid_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Gengrid_Data *sd)
 EOLIAN static Eina_Bool
 _elm_gengrid_efl_ui_widget_focus_next_manager_is(Eo *obj, Elm_Gengrid_Data *_pd EINA_UNUSED)
 {
-   return _elm_gengrid_smart_focus_next_enable;
+   //Fallback Legacy Focus
+   if (elm_widget_is_legacy(obj)) return _elm_gengrid_smart_focus_next_enable;
+   else return efl_ui_widget_focus_next_manager_is(efl_super(obj, MY_CLASS));
 }
 
 EOLIAN static Eina_Bool
@@ -4764,6 +4819,10 @@ _elm_gengrid_efl_ui_widget_focus_next(Eo *obj, Elm_Gengrid_Data *sd, Efl_Ui_Focu
    Eina_List *items = NULL;
    Elm_Gen_Item *it;
 
+   //Fallback Legacy Focus
+   if (!elm_widget_is_legacy(obj))
+     return efl_ui_widget_focus_next(efl_super(obj, MY_CLASS), dir, next, next_item);
+
    EINA_INLIST_FOREACH(sd->items, it)
      {
         if (it->realized)
@@ -4777,7 +4836,10 @@ _elm_gengrid_efl_ui_widget_focus_next(Eo *obj, Elm_Gengrid_Data *sd, Efl_Ui_Focu
 EOLIAN static Eina_Bool
 _elm_gengrid_efl_ui_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Gengrid_Data *_pd EINA_UNUSED)
 {
-   return EINA_TRUE;
+   //Fallback Legacy Focus
+   if (!elm_widget_is_legacy(obj))
+     return efl_ui_widget_focus_direction_manager_is(efl_super(obj, MY_CLASS));
+   else return EINA_TRUE;
 }
 
 EOLIAN static Eina_Bool
@@ -4788,6 +4850,10 @@ _elm_gengrid_efl_ui_widget_focus_direction(Eo *obj, Elm_Gengrid_Data *sd EINA_UN
    Eina_Bool ret = EINA_FALSE;
    double c_weight = 0.0;
 
+   //Fallback Legacy Focus
+   if (!elm_widget_is_legacy(obj))
+     return efl_ui_widget_focus_direction(efl_super(obj, MY_CLASS), base, degree, direction, direction_item, weight);
+
    items = elm_gengrid_realized_items_get(obj);
    eo_item = elm_object_focused_item_get(base);
    if (eo_item)
@@ -5112,7 +5178,21 @@ _elm_gengrid_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Ei
                   sd->focus_on_realization = it;
                }
              */
-             _elm_gengrid_item_focused(eo_it);
+             if (elm_widget_is_legacy(obj))
+               _elm_gengrid_item_focused(eo_it);
+             else
+               {
+                  if (it->realized)
+                    {
+                       _elm_gengrid_item_focused(eo_it);
+                       sd->focus_on_realization = NULL;
+                       efl_ui_focus_manager_focus_set(obj, eo_it);
+                    }
+                  else
+                    {
+                       sd->focus_on_realization = it;
+                    }
+               }
           }
      }
    else
@@ -5557,6 +5637,10 @@ _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch(Eo *obj, Elm_Gengrid_Data
 {
    Elm_Object_Item *eo_it = NULL;
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return;
+   //
+
    if (!pd->items)
      {
         efl_ui_focus_manager_setup_on_first_touch(efl_super(obj, MY_CLASS), direction, entry);
@@ -5704,9 +5788,16 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
 
    obj = efl_constructor(efl_super(obj, MY_CLASS));
 
-   sd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS, obj,
-    efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
-    efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj))
+   //
+     {
+        sd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS, obj,
+         efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
+         efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
+
+        efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _gengrid_element_focused, obj);
+     }
 
    sd->obj = obj;
 
@@ -5714,7 +5805,6 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
    efl_access_object_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE);
 
-   efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _gengrid_element_focused, obj);
 
    return obj;
 }
@@ -7434,6 +7524,10 @@ _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd)
    Elm_Gen_Item *item;
    Eina_List *order = NULL;
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return;
+   //
+
    if (!pd->order_dirty) return;
    pd->order_dirty = EINA_FALSE;
 
@@ -7455,6 +7549,10 @@ _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd)
 EOLIAN static Eina_Bool
 _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
 {
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return EINA_FALSE;
+   //
+
    return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
 }
 
@@ -7464,6 +7562,10 @@ _elm_gengrid_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen
    Eina_List *n;
    Efl_Ui_Widget *wid;
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return;
+   //
+
    EINA_LIST_FOREACH(pd->contents, n, wid)
      {
         if (efl_isa(wid, EFL_UI_WIDGET_CLASS))
index 1c9ac80..e2845f5 100644 (file)
@@ -487,8 +487,9 @@ _item_content_realize(Elm_Gen_Item *it,
         if (content != old)
           {
              //TIZEN_ONLY(20180607): Restore legacy focus
-             //eina_hash_add(sd->content_item_map, &content, it->base->eo_obj);
+             if (!elm_widget_is_legacy(sd->obj))
              //
+               eina_hash_add(sd->content_item_map, &content, it->base->eo_obj);
              // FIXME: Genlist item doesn't update its size when the size of
              // content is changed, so deferred calculation for content should
              // be performed before realization.
@@ -531,8 +532,9 @@ out:
              *contents = eina_list_remove(*contents, old);
              evas_object_del(old);
              //TIZEN_ONLY(20180607): Restore legacy focus
-             //eina_hash_del_by_key(sd->content_item_map, &old);
+             if (!elm_widget_is_legacy(sd->obj))
              //
+               eina_hash_del_by_key(sd->content_item_map, &old);
           }
      }
 }
@@ -1810,8 +1812,11 @@ _content_cache_add(Elm_Gen_Item *it, Eina_List **cache)
      {
         *cache = eina_list_append(*cache, content);
         //TIZEN_ONLY(20180607): Restore legacy focus
-        //eina_hash_del_by_key(pd->content_item_map, &content);
-        //elm_widget_tree_unfocusable_set(content, EINA_TRUE);
+        if (!elm_widget_is_legacy(pd->obj))
+          {
+             eina_hash_del_by_key(pd->content_item_map, &content);
+             elm_widget_tree_unfocusable_set(content, EINA_TRUE);
+          }
         //
      }
 
@@ -3675,6 +3680,7 @@ _elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
    Eina_Bool int_ret = EINA_FALSE;
    Elm_Object_Item *eo_it = NULL;
    Eina_Bool is_sel = EINA_FALSE;
+   Eina_Bool focused;
 
    int_ret = efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS));
    if (!int_ret) return EINA_FALSE;
@@ -3686,14 +3692,21 @@ _elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
         sd->last_selected_item = eina_list_data_get(sd->selected);
      }
    */
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
 
-   if (elm_widget_focus_get(obj) && (sd->items) && (sd->selected) &&
+   if (focused && (sd->items) && (sd->selected) &&
        (!sd->last_selected_item))
      {
         sd->last_selected_item = eina_list_data_get(sd->selected);
      }
 
-   if (elm_widget_focus_get(obj) && !sd->mouse_down)
+   if (!elm_widget_is_legacy(obj))
+     return EINA_TRUE;
+
+   if (focused && !sd->mouse_down)
      {
         if (sd->last_focused_item)
           eo_it = sd->last_focused_item;
@@ -3723,6 +3736,9 @@ _elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
                   else
                     elm_object_item_focus_set(eo_it, EINA_TRUE);
                   _elm_widget_focus_highlight_start(obj);
+                  //set it again in the manager, there might be the case that the manager focus history and internal item foused logic are in different states
+                  if (!elm_widget_is_legacy(obj) && efl_ui_focus_manager_request_subchild(obj, eo_it))
+                    efl_ui_focus_manager_focus_set(obj, eo_it);
                }
           }
      }
@@ -3745,13 +3761,19 @@ static Eina_Bool _elm_genlist_smart_focus_next_enable = EINA_FALSE;
 EOLIAN static Eina_Bool
 _elm_genlist_efl_ui_widget_focus_next_manager_is(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED)
 {
-   return _elm_genlist_smart_focus_next_enable;
+   //Fallback Legacy Focus
+   if (elm_widget_is_legacy(obj))
+     return _elm_genlist_smart_focus_next_enable;
+   else return efl_ui_widget_focus_next_manager_is(efl_super(obj, ELM_GENLIST_CLASS));
 }
 
 EOLIAN static Eina_Bool
 _elm_genlist_efl_ui_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Genlist_Data *_pd EINA_UNUSED)
 {
-   return EINA_FALSE;
+   //Fallback Legacy Focus
+   if (elm_widget_is_legacy(obj))
+     return EINA_FALSE;
+   else return efl_ui_widget_focus_direction_manager_is(efl_super(obj, ELM_GENLIST_CLASS));
 }
 
 EOLIAN static Eina_Bool
@@ -3764,6 +3786,10 @@ _elm_genlist_efl_ui_widget_focus_next(Eo *obj, Elm_Genlist_Data *sd, Efl_Ui_Focu
    Eina_Bool done = EINA_FALSE;
    int ret;
 
+   //Fallback Legacy Focus
+   if (!elm_widget_is_legacy(obj))
+     return efl_ui_widget_focus_next(efl_super(obj, ELM_GENLIST_CLASS), dir, next, next_item);
+
    evas_object_geometry_get(sd->obj, &sx, &sy, &sw, &sh);
 
    EINA_INLIST_FOREACH(sd->blocks, itb)
@@ -6358,10 +6384,19 @@ _elm_genlist_efl_object_constructor(Eo *obj, Elm_Genlist_Data *sd)
    legacy_efl_ui_focus_manager_widget_legacy_signals(obj, obj);
    obj = efl_constructor(efl_super(obj, MY_CLASS));
 
-   sd->content_item_map = eina_hash_pointer_new(NULL);
-   sd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS, obj,
-    efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
-    efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj))
+   //
+     {
+        sd->content_item_map = eina_hash_pointer_new(NULL);
+        sd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS, obj,
+        efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
+        efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
+
+        efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE);
+
+        efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _genlist_element_focused, obj);
+     }
 
    sd->obj = obj;
 
@@ -6369,8 +6404,6 @@ _elm_genlist_efl_object_constructor(Eo *obj, Elm_Genlist_Data *sd)
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
    efl_access_object_role_set(obj, EFL_ACCESS_ROLE_LIST);
 
-   efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _genlist_element_focused, obj);
-
    return obj;
 }
 
@@ -6504,20 +6537,24 @@ _item_select(Elm_Gen_Item *it)
    if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
      {
         //TIZEN_ONLY(20180607): Restore legacy focus
-        //efl_ui_focus_manager_focus_set(obj, it->base->eo_obj);
-        Evas_Object *swallow_obj;
-        Eina_List *l;
-
-        EINA_LIST_FOREACH(it->contents, l, swallow_obj)
+        if (elm_widget_is_legacy(obj))
           {
-             if (elm_widget_is(swallow_obj) && elm_object_focus_get(swallow_obj))
+             Evas_Object *swallow_obj;
+             Eina_List *l;
+
+             EINA_LIST_FOREACH(it->contents, l, swallow_obj)
                {
-                  elm_object_focus_set(obj, EINA_FALSE);
-                  elm_object_focus_set(obj, EINA_TRUE);
-                  break;
+                  if (elm_widget_is(swallow_obj) && elm_object_focus_get(swallow_obj))
+                    {
+                       elm_object_focus_set(obj, EINA_FALSE);
+                       elm_object_focus_set(obj, EINA_TRUE);
+                       break;
+                    }
                }
+             goto item_deleted;
           }
         //
+        efl_ui_focus_manager_focus_set(obj, it->base->eo_obj);
      }
 
  item_deleted:
@@ -6693,7 +6730,15 @@ _elm_genlist_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Ei
      }
    else
      {
-        if (!efl_ui_focus_object_focus_get(obj))
+        //TIZEN_ONLY(20180607): Restore legacy focus
+        Eina_Bool focused;
+        if (elm_widget_is_legacy(obj))
+          focused = elm_widget_focus_get(obj);
+        else
+          focused = efl_ui_focus_object_focus_get(obj);
+        if (!focused)
+        //if (!efl_ui_focus_object_focus_get(obj))
+        //
           return;
         _elm_genlist_item_unfocused(eo_it);
      }
@@ -9338,8 +9383,10 @@ EOLIAN static Efl_Object*
 _elm_genlist_efl_object_provider_find(const Eo *obj, Elm_Genlist_Data *pd, const Efl_Object *klass)
 {
    //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj) && (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE))
    //if (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE)
-   //  return pd->provider;
+   //
+     return pd->provider;
    return efl_provider_find(efl_super(obj, ELM_GENLIST_CLASS), klass);
 }
 
@@ -9349,6 +9396,10 @@ _elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen
    Eina_List *n;
    Efl_Ui_Widget *wid;
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return;
+   //
+
    EINA_LIST_FOREACH(pd->contents, n, wid)
      {
         if (efl_isa(wid, EFL_UI_WIDGET_CLASS))
@@ -9362,6 +9413,10 @@ _elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen
 EOLIAN static Eina_Bool
 _elm_genlist_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Genlist_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
 {
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return EINA_FALSE;
+   //
+
    return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
 }
 
index 2925045..cab7dc2 100644 (file)
@@ -5594,6 +5594,9 @@ _filter_cb(const void *iterator EINA_UNUSED, void *data, void *fdata)
 EOLIAN static Eina_Iterator*
 _elm_interface_scrollable_efl_ui_focus_manager_border_elements_get(const Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED)
 {
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj)) return NULL;
+   //
    Eina_Iterator *border_elements;
    Eina_Rectangle *rect = calloc(1, sizeof(Eina_Rectangle));
 
index c82748d..7a1f55b 100644 (file)
@@ -687,8 +687,8 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Focus
    implements {
       class.constructor;
       Efl.Object.constructor;
-      @empty Efl.Ui.Focus.Manager.border_elements { get; }
-      @empty Efl.Ui.Widget_Focus_Manager.focus_manager_create;
+      Efl.Ui.Focus.Manager.border_elements { get; }
+      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
       Efl.Ui.I18n.mirrored { set; }
    }
    events {
index b3ac9aa..a6f0bf5 100644 (file)
@@ -1345,9 +1345,14 @@ _elm_list_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_List_Data *sd)
                   if (!_elm_config->item_select_on_focus_disable && is_sel)
                     elm_list_item_selected_set(EO_OBJ(it), EINA_TRUE);
                   else
-                    //TIZEN_ONLY(20180607): Restore legacy focus
-                    //_elm_list_item_focused(EO_OBJ(it));
-                    elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
+                    {
+                       //TIZEN_ONLY(20180607): Restore legacy focus
+                       if (elm_widget_is_legacy(WIDGET(it)))
+                         elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
+                       else
+                       //
+                         _elm_list_item_focused(EO_OBJ(it));
+                    }
                }
           }
      }
@@ -2391,8 +2396,9 @@ _item_new(Evas_Object *obj,
           (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
           obj);
         //TIZEN_ONLY(20180607): Restore legacy focus
-        //elm_widget_tree_unfocusable_set(it->icon, EINA_TRUE);
+        if (!elm_widget_is_legacy(obj))
         //
+          elm_widget_tree_unfocusable_set(it->icon, EINA_TRUE);
      }
    if (it->end)
      {
@@ -2401,8 +2407,9 @@ _item_new(Evas_Object *obj,
           (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb,
           obj);
         //TIZEN_ONLY(20180607): Restore legacy focus
-        //elm_widget_tree_unfocusable_set(it->end, EINA_TRUE);
+        if (!elm_widget_is_legacy(obj))
         //
+          elm_widget_tree_unfocusable_set(it->end, EINA_TRUE);
      }
 
    if (_elm_atspi_enabled())
index 0452de8..04b087d 100644 (file)
@@ -1089,9 +1089,6 @@ int tizen_util_probe_profile_wearable();
 #define TIZEN_PROFILE_WEARABLE (__builtin_expect(_tizen_profile_wearable != -1, 1)?_tizen_profile_wearable:tizen_util_probe_profile_wearable())
 //
 
-//TIZEN_ONLY(20191021): disable focus manager
-#define efl_ui_focus_object_focus_get elm_widget_focus_get
-
 /***********************************************************************************
  * TIZEN_ONLY_FEATURE: apply Tizen's color_class features.                         *
  ***********************************************************************************/
index 101ac5b..0ab9921 100644 (file)
@@ -1164,8 +1164,12 @@ _elm_scroller_efl_object_constructor(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED
    efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
    efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SCROLL_PANE);
-   efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focused_element, obj);
-   legacy_efl_ui_focus_manager_widget_legacy_signals(obj, obj);
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (!elm_widget_is_legacy(obj))
+     {
+        efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _focused_element, obj);
+        legacy_efl_ui_focus_manager_widget_legacy_signals(obj, obj);
+     }
 
    return obj;
 }
index 9387250..75d07a1 100644 (file)
@@ -438,11 +438,13 @@ _entry_value_apply(Evas_Object *obj)
    if (!sd->entry_visible) return;
 
    //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(obj))
      evas_object_smart_callback_del_full(sd->ent, "unfocused",
                                          _entry_unfocused_cb, obj);
+   else
+     efl_event_callback_del(sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED,
+                            _entry_focus_change, obj);
    //
-   efl_event_callback_del
-    (sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _entry_focus_change, obj);
    _entry_hide(obj);
    str = elm_object_text_get(sd->ent);
    if (!str) return;
@@ -736,18 +738,24 @@ _toggle_entry(Evas_Object *obj)
              _entry_show(sd);
              elm_entry_select_all(sd->ent);
              //TIZEN_ONLY(20180607): Restore legacy focus
-             elm_widget_focus_set(sd->ent, EINA_TRUE);
+             if (elm_widget_is_legacy(sd->ent))
+               elm_widget_focus_set(sd->ent, EINA_TRUE);
              //
              sd->entry_visible = EINA_TRUE;
           }
-        efl_event_callback_add
-           (sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _entry_focus_change, obj);
         //TIZEN_ONLY(20180607): Restore legacy focus
-        evas_object_smart_callback_add(sd->ent, "unfocused", _entry_unfocused_cb, obj);
+        if (elm_widget_is_legacy(sd->ent))
+          evas_object_smart_callback_add(sd->ent, "unfocused", _entry_unfocused_cb, obj);
+        else
         //
+          efl_event_callback_add
+             (sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _entry_focus_change, obj);
         sd->entry_visible = EINA_TRUE;
         elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
         evas_object_show(sd->ent);
+        //TIZEN_ONLY(20180607): Restore legacy focus
+        if (!elm_widget_is_legacy(obj))
+        //
           {
              Eina_List *items = NULL;
 
@@ -757,8 +765,9 @@ _toggle_entry(Evas_Object *obj)
              items = eina_list_append(items, sd->inc_button);
 
              efl_ui_focus_composition_elements_set(obj, items);
+
+             efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(obj), sd->ent);
          }
-         efl_ui_focus_manager_focus_set(efl_ui_focus_object_focus_manager_get(obj), sd->ent);
      }
 }
 
@@ -1391,6 +1400,9 @@ _elm_spinner_efl_canvas_group_group_add(Eo *obj, Elm_Spinner_Data *priv)
         elm_layout_content_set(obj, "elm.swallow.dec_button", priv->dec_button);
         elm_widget_sub_object_add(obj, priv->dec_button);
 
+        //TIZEN_ONLY(20180607): Restore legacy focus
+        if (!elm_widget_is_legacy(obj))
+        //
           {
              Eina_List *items = NULL;
 
index b99b142..e10c3eb 100644 (file)
@@ -824,7 +824,16 @@ _elm_toolbar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Toolbar_Data *sd)
    if (!int_ret) return EINA_FALSE;
    if (!sd->items) return EINA_FALSE;
 
-   if (efl_ui_focus_object_focus_get(obj))
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   Eina_Bool focused = EINA_FALSE;
+   if (elm_widget_is_legacy(obj))
+     focused = elm_widget_focus_get(obj);
+   else
+     focused = efl_ui_focus_object_focus_get(obj);
+
+   if (focused)
+   //if (efl_ui_focus_object_focus_get(obj))
+   //
      {
         evas_object_focus_set(wd->resize_obj, EINA_TRUE);
         if (sd->mouse_down) return EINA_TRUE;
@@ -883,10 +892,10 @@ _elm_toolbar_item_elm_widget_item_item_focus_set(Eo *eo_it, Elm_Toolbar_Item_Dat
         if (eo_it)
           _elm_toolbar_item_unfocused(eo_it);
      }
-
    //TIZEN_ONLY(20180607): Restore legacy focus
-   //evas_object_focus_set(VIEW(it), focused);
+   if (!elm_widget_is_legacy(obj))
    //
+     evas_object_focus_set(VIEW(it), focused);
 
    _elm_widget_item_highlight_in_theme(obj, EO_OBJ(it));
    _elm_widget_highlight_in_theme_update(obj);
index f040cbc..2a7e3a0 100644 (file)
@@ -84,6 +84,10 @@ _elm_widget_item_static_focus_efl_ui_focus_object_setup_order_non_recursive(Eo *
    Eo *logical_child;
    Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(wpd->widget)) return;
+   //
+
    efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, MY_CLASS));
 
    if (!pd->realized)
@@ -144,6 +148,10 @@ _elm_widget_item_static_focus_efl_object_constructor(Eo *obj, Elm_Widget_Item_St
    Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
    Eo *ret = efl_constructor(efl_super(obj, MY_CLASS));
 
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(wpd->widget)) return ret;
+   //
+
    if (efl_isa(wpd->widget, ELM_GENLIST_CLASS))
      {
         efl_event_callback_add(wpd->widget, ELM_GENLIST_EVENT_REALIZED, _list_realized_cb, obj);
@@ -161,6 +169,12 @@ EOLIAN static void
 _elm_widget_item_static_focus_efl_object_destructor(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
 {
    Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
+
+   //TIZEN_ONLY(20180607): Restore legacy focus
+   if (elm_widget_is_legacy(wpd->widget))
+     return efl_destructor(efl_super(obj, MY_CLASS));
+   //
+
    if (efl_isa(wpd->widget, ELM_GENLIST_CLASS))
      {
         efl_event_callback_del(wpd->widget, ELM_GENLIST_EVENT_REALIZED, _list_realized_cb, obj);
index c543894..09b9fd5 100644 (file)
@@ -9704,13 +9704,25 @@ _elm_genlist_efl_object_provider_find(const Eo *obj, Elm_Genlist_Data *pd, const
 EOLIAN static void
 _elm_genlist_item_efl_ui_focus_object_setup_order_non_recursive(Eo *obj, Elm_Gen_Item *pd)
 {
-   return;
+   Eina_List *n;
+   Efl_Ui_Widget*wid;
+
+   if (elm_widget_is_legacy(WIDGET(pd))) return;
+//   _item_realize(pd, EINA_FALSE);
+
+   EINA_LIST_FOREACH(pd->contents, n, wid)
+     {
+        if (efl_isa(wid, EFL_UI_WIDGET_CLASS))
+          _elm_widget_full_eval(wid);
+     }
+
+   efl_ui_focus_object_setup_order_non_recursive(efl_super(obj, ELM_GENLIST_ITEM_CLASS));
 }
 
 EOLIAN static Eina_Bool
 _elm_genlist_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Genlist_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED)
 {
-   return EINA_FALSE;
+   return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj);
 }
 
 // TIZEN only (20150914) : Accessibility: updated highlight change during genlist and list scroll