raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=933dfca5bcda4943ecdd81ab09dc34989234f7f3

commit 933dfca5bcda4943ecdd81ab09dc34989234f7f3
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu Sep 10 20:04:23 2015 +0900

    elm - when focus goes back in to a window dont have scrollers jump
    
    there is an annoyance in elm that when focus goes back toa window it
    restores focus to the last focused widget. if that widget happens to
    be invisible in a scroller then this is really annoying as the
    scrollers reset. this makes restoring optional. only if there is a
    hilight object AND it's visible - then restore, otherwise don't and
    revert focus to the window itself again.
    
    @fix
---
 src/lib/elm_win.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 453bb2f..0ced87a 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -1084,7 +1084,19 @@ _elm_win_focus_in(Ecore_Evas *ee)
              elm_widget_focus_steal(obj);
           }
         else
-          elm_widget_focus_restore(obj);
+          {
+             Evas_Object *newest = NULL;
+             unsigned int newest_focus_order = 0;
+
+             newest = elm_widget_newest_focus_order_get
+               (obj, &newest_focus_order, EINA_TRUE);
+             if ((newest) &&
+                 _elm_win_focus_highlight_object_get(obj) &&
+                 _elm_widget_onscreen_is(newest))
+               elm_widget_focus_restore(obj);
+             else
+               evas_object_focus_set(obj, EINA_TRUE);
+          }
      }
    // FIXME: the event is deprecated but still in use.
    // Has to be removed in EFL2.0

-- 


Reply via email to