elm_win: loop auto throttle - only do this once a window has been shown etc 79/75179/1 submit/tizen/20160617.035339
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 17 Jun 2016 03:33:26 +0000 (12:33 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Fri, 17 Jun 2016 03:42:56 +0000 (12:42 +0900)
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

By Carsten Haitzler.

Signed-off-by: Hosang Kim <hosang12.kim@samsung.com>
Change-Id: I206e6d7e7b3aa21e7dc8d4071b8a515c62fbfbeb

src/lib/elm_win.c

index 74e9dc2..73f3dfa 100644 (file)
@@ -316,6 +316,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;
 
 // TIZEN_ONLY(20160218): Improve launching performance.
@@ -489,7 +490,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);
@@ -508,7 +509,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);
@@ -519,7 +520,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);
@@ -896,6 +897,7 @@ _elm_win_mouse_in(Ecore_Evas *ee)
    Elm_Win_Data *sd = _elm_win_associate_get(ee);
    if (!sd) return;
 
+   _elm_win_throttle_ok = EINA_TRUE;
    if (sd->resizing) sd->resizing = EINA_FALSE;
 }
 
@@ -1167,6 +1169,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);