summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2013-01-14 09:46:25 +0000
committerCarsten Haitzler <raster@rasterman.com>2013-01-14 09:46:25 +0000
commit7e06d3529966a8ea27543507acdbe10e021fbcb3 (patch)
tree44118687d95d02bba32bf8b9d17681eb62c7908f
parent509342ab8e3c3582c2c2dee4284b3059ffdcb800 (diff)
let's try handling auto-throttle by counting up
shown/withdraw/iconified windows at the time we eval windows and then use just the shown count to disable throttling. :) SVN revision: 82748
-rw-r--r--src/lib/elm_win.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 2e3afce13..71fa3ede1 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -203,9 +203,6 @@ Eina_List *_elm_win_list = NULL;
203int _elm_win_deferred_free = 0; 203int _elm_win_deferred_free = 0;
204 204
205static int _elm_win_count = 0; 205static int _elm_win_count = 0;
206static int _elm_win_count_shown = 0;
207static int _elm_win_count_iconified = 0;
208static int _elm_win_count_withdrawn = 0;
209 206
210static Eina_Bool _elm_win_auto_throttled = EINA_FALSE; 207static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
211 208
@@ -216,6 +213,9 @@ _elm_win_state_eval(void *data __UNUSED__)
216{ 213{
217 Eina_List *l; 214 Eina_List *l;
218 Evas_Object *obj; 215 Evas_Object *obj;
216 int _elm_win_count_shown = 0;
217 int _elm_win_count_iconified = 0;
218 int _elm_win_count_withdrawn = 0;
219 219
220 _elm_win_state_eval_job = NULL; 220 _elm_win_state_eval_job = NULL;
221 221
@@ -269,8 +269,16 @@ _elm_win_state_eval(void *data __UNUSED__)
269 } 269 }
270 else 270 else
271 { 271 {
272 if ((_elm_win_count_iconified + _elm_win_count_withdrawn) 272 EINA_LIST_FOREACH(_elm_win_list, l, obj)
273 >= _elm_win_count_shown) 273 {
274 if (elm_win_withdrawn_get(obj))
275 _elm_win_count_withdrawn++;
276 else if (elm_win_iconified_get(obj))
277 _elm_win_count_iconified++;
278 else if (evas_object_visible_get(obj))
279 _elm_win_count_shown++;
280 }
281 if (_elm_win_count_shown <= 0)
274 { 282 {
275 if (!_elm_win_auto_throttled) 283 if (!_elm_win_auto_throttled)
276 { 284 {
@@ -939,9 +947,6 @@ _elm_win_state_change(Ecore_Evas *ee)
939 947
940 obj = sd->obj; 948 obj = sd->obj;
941 949
942 if (sd->withdrawn) _elm_win_count_withdrawn--;
943 if (sd->iconified) _elm_win_count_iconified--;
944
945 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee)) 950 if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
946 { 951 {
947 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee); 952 sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
@@ -972,9 +977,6 @@ _elm_win_state_change(Ecore_Evas *ee)
972 profile = ecore_evas_window_profile_get(sd->ee); 977 profile = ecore_evas_window_profile_get(sd->ee);
973 ch_profile = _elm_win_profile_set(sd, profile); 978 ch_profile = _elm_win_profile_set(sd, profile);
974 979
975 if (sd->withdrawn) _elm_win_count_withdrawn++;
976 if (sd->iconified) _elm_win_count_iconified++;
977
978 _elm_win_state_eval_queue(); 980 _elm_win_state_eval_queue();
979 981
980 if ((ch_withdrawn) || (ch_iconified)) 982 if ((ch_withdrawn) || (ch_iconified))
@@ -1197,10 +1199,7 @@ _elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1197 Elm_Win_Smart_Data *sd = _pd; 1199 Elm_Win_Smart_Data *sd = _pd;
1198 1200
1199 if (!evas_object_visible_get(obj)) 1201 if (!evas_object_visible_get(obj))
1200 { 1202 _elm_win_state_eval_queue();
1201 _elm_win_count_shown++;
1202 _elm_win_state_eval_queue();
1203 }
1204 eo_do_super(obj, evas_obj_smart_show()); 1203 eo_do_super(obj, evas_obj_smart_show());
1205 1204
1206 TRAP(sd, show); 1205 TRAP(sd, show);
@@ -1215,10 +1214,7 @@ _elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1215 Elm_Win_Smart_Data *sd = _pd; 1214 Elm_Win_Smart_Data *sd = _pd;
1216 1215
1217 if (evas_object_visible_get(obj)) 1216 if (evas_object_visible_get(obj))
1218 { 1217 _elm_win_state_eval_queue();
1219 _elm_win_count_shown--;
1220 _elm_win_state_eval_queue();
1221 }
1222 eo_do_super(obj, evas_obj_smart_hide()); 1218 eo_do_super(obj, evas_obj_smart_hide());
1223 1219
1224 TRAP(sd, hide); 1220 TRAP(sd, hide);
@@ -1433,9 +1429,6 @@ _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1433 if (sd->autodel_clear) *(sd->autodel_clear) = -1; 1429 if (sd->autodel_clear) *(sd->autodel_clear) = -1;
1434 1430
1435 _elm_win_list = eina_list_remove(_elm_win_list, obj); 1431 _elm_win_list = eina_list_remove(_elm_win_list, obj);
1436 if (sd->withdrawn) _elm_win_count_withdrawn--;
1437 if (sd->iconified) _elm_win_count_iconified--;
1438 if (evas_object_visible_get(obj)) _elm_win_count_shown--;
1439 _elm_win_count--; 1432 _elm_win_count--;
1440 _elm_win_state_eval_queue(); 1433 _elm_win_state_eval_queue();
1441 1434