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
This commit is contained in:
Carsten Haitzler 2015-09-10 20:04:23 +09:00
parent be2ae5f410
commit 9d5b9872fb
1 changed files with 13 additions and 1 deletions

View File

@ -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