elm - loop auto throttle - only do this once a window has been shown etc

only start throttling ocne we have a window and it has rendered or
been focused or mouse has gone in - then we are surely really visible
and sane and only start throttling if no windows are visible then. if
auto throttle is on this can improve startup time by the trottle amount
This commit is contained in:
Carsten Haitzler 2016-06-14 18:03:32 +09:00
parent 6b74aad023
commit f156737e8f
1 changed files with 10 additions and 3 deletions

View File

@ -317,6 +317,7 @@ static const Elm_Action key_actions[] = {
Eina_List *_elm_win_list = NULL;
int _elm_win_deferred_free = 0;
static Eina_Bool _elm_win_throttle_ok = EINA_FALSE;
static int _elm_win_count = 0;
static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
@ -488,7 +489,7 @@ _elm_win_state_eval(void *data EINA_UNUSED)
throttle = EINA_TRUE;
if (_elm_win_count == 0)
{
if (_elm_win_auto_throttled)
if ((_elm_win_throttle_ok) && (_elm_win_auto_throttled))
{
_elm_process_state = ELM_PROCESS_STATE_FOREGROUND;
ecore_event_add(ELM_EVENT_PROCESS_FOREGROUND, NULL, NULL, NULL);
@ -507,7 +508,7 @@ _elm_win_state_eval(void *data EINA_UNUSED)
}
if (_elm_win_count_shown <= 0)
{
if (!_elm_win_auto_throttled)
if ((_elm_win_throttle_ok) && (!_elm_win_auto_throttled))
{
_elm_process_state = ELM_PROCESS_STATE_BACKGROUND;
ecore_event_add(ELM_EVENT_PROCESS_BACKGROUND, NULL, NULL, NULL);
@ -518,7 +519,7 @@ _elm_win_state_eval(void *data EINA_UNUSED)
}
else
{
if (_elm_win_auto_throttled)
if ((_elm_win_throttle_ok) && (_elm_win_auto_throttled))
{
_elm_process_state = ELM_PROCESS_STATE_FOREGROUND;
ecore_event_add(ELM_EVENT_PROCESS_FOREGROUND, NULL, NULL, NULL);
@ -884,6 +885,7 @@ _elm_win_pre_render(Ecore_Evas *ee)
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
if (!sd) return;
_elm_win_throttle_ok = EINA_TRUE;
if (sd->deferred_resize_job)
_elm_win_resize_job(sd->obj);
}
@ -903,6 +905,7 @@ _elm_win_mouse_in(Ecore_Evas *ee)
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
if (!sd) return;
_elm_win_throttle_ok = EINA_TRUE;
if (sd->resizing) sd->resizing = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WL2
if (sd->wl.win)
@ -1122,6 +1125,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
if ((!sd) || (sd->modal_count)) return;
_elm_win_throttle_ok = EINA_TRUE;
obj = sd->obj;
_elm_widget_top_win_focused_set(obj, EINA_TRUE);
@ -1762,6 +1766,7 @@ _elm_win_evas_render_pre(void *data,
{
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
eo_event_callback_call(win, EFL_CANVAS_EVENT_RENDER_PRE, NULL);
}
@ -1773,6 +1778,7 @@ _elm_win_evas_focus_in(void *data,
{
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
eo_event_callback_call(win, EFL_CANVAS_EVENT_FOCUS_IN, NULL);
}
@ -1796,6 +1802,7 @@ _elm_win_evas_object_focus_in(void *data,
Eo *object = event_info;
Eo *win = data;
_elm_win_throttle_ok = EINA_TRUE;
eo_event_callback_call(win, EFL_CANVAS_EVENT_OBJECT_FOCUS_IN, object);
}