aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-10 20:04:23 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-10 20:04:23 +0900
commit9d5b9872fb031407fb534c0244f5b3597d96a5e5 (patch)
treee732b19526be606e19f798954bae9177d8ddd6c5 /legacy/elementary/src/lib/elm_win.c
parentelm autofocus show - fix cases where focus is inside containers (diff)
downloadefl-9d5b9872fb031407fb534c0244f5b3597d96a5e5.tar.gz
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
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 453bb2f317..0ced87af53 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/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