(i guess bug report) about using cpua nd drawing while minimized.
SVN revision: 75776
* Patch in incomplete access support in segment control and spinner
+2012-08-28 Carsten Haitzler (The Rasterman)
+
+ * Track window states as a total count and be able to self-throttle
+ or suspend rendering as a result.
+
value "year_min" int: 2;
value "year_max" int: 137;
value "softcursor_mode" uchar: 0;
+ value "auto_norender_withdrawn" uchar: 0;
+ value "auto_norender_iconified_same_as_withdrawn" uchar: 0;
+ value "auto_flush_withdrawn" uchar: 0;
+ value "auto_dump_withdrawn" uchar: 0;
+ value "auto_throttle" uchar: 0;
+ value "auto_throttle_amount" double: 0.1;
group "color_palette" list {
group "Elm_Custom_Palette" struct {
value "palette_name" string: "default";
value "year_min" int: 2;
value "year_max" int: 137;
value "softcursor_mode" uchar: 0;
+ value "auto_norender_withdrawn" uchar: 1;
+ value "auto_norender_iconified_same_as_withdrawn" uchar: 1;
+ value "auto_flush_withdrawn" uchar: 1;
+ value "auto_dump_withdrawn" uchar: 1;
+ value "auto_throttle" uchar: 1;
+ value "auto_throttle_amount" double: 0.0666666666;
group "color_palette" list {
group "Elm_Custom_Palette" struct {
value "palette_name" string: "default";
value "weekend_start" int: 6;
value "weekend_len" int: 2;
value "softcursor_mode" uchar: 0;
+ value "auto_norender_withdrawn" uchar: 1;
+ value "auto_norender_iconified_same_as_withdrawn" uchar: 0;
+ value "auto_flush_withdrawn" uchar: 1;
+ value "auto_dump_withdrawn" uchar: 1;
+ value "auto_throttle" uchar: 0;
+ value "auto_throttle_amount" double: 0.0333333333;
group "color_palette" list {
group "Elm_Custom_Palette" struct {
value "palette_name" string: "default";
ELM_CONFIG_VAL(D, T, year_max, T_INT);
ELM_CONFIG_LIST(D, T, color_palette, _config_color_palette_edd);
ELM_CONFIG_VAL(D, T, softcursor_mode, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_norender_withdrawn, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_norender_iconified_same_as_withdrawn, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_flush_withdrawn, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_dump_withdrawn, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_throttle, T_UCHAR);
+ ELM_CONFIG_VAL(D, T, auto_throttle_amount, T_DOUBLE);
#undef T
#undef D
#undef T_INT
_elm_config->year_max = 137;
_elm_config->softcursor_mode = 0; /* 0 = auto, 1 = on, 2 = off */
_elm_config->color_palette = NULL;
+ _elm_config->auto_norender_withdrawn = 0;
+ _elm_config->auto_norender_iconified_same_as_withdrawn = 1;
+ _elm_config->auto_flush_withdrawn = 0;
+ _elm_config->auto_dump_withdrawn = 0;
+ _elm_config->auto_throttle = 0;
+ _elm_config->auto_throttle_amount = 0.1;
}
static const char *
if (s) _elm_config->desktop_entry = !!atoi(s);
s = getenv("ELM_ACCESS_MODE");
if (s) _elm_config->access_mode = ELM_ACCESS_MODE_ON;
+
+ s = getenv("ELM_AUTO_THROTTLE");
+ if (s) _elm_config->auto_throttle = EINA_TRUE;
+ s = getenv("ELM_AUTO_THROTTLE_AMOUNT");
+ if (s) _elm_config->auto_throttle_amount = _elm_atof(s);
+ s = getenv("ELM_AUTO_NORENDER_WITHDRAWN");
+ if (s) _elm_config->auto_norender_withdrawn = EINA_TRUE;
+ s = getenv("ELM_AUTO_NORENDER_ICONIFIED_SAME_AS_WITHDRAWN");
+ if (s) _elm_config->auto_norender_iconified_same_as_withdrawn = EINA_TRUE;
+ s = getenv("ELM_AUTO_FLUSH_WITHDRAWN");
+ if (s) _elm_config->auto_flush_withdrawn = EINA_TRUE;
+ s = getenv("ELM_AUTO_DUMP_WIDTHDRAWN");
+ if (s) _elm_config->auto_dump_withdrawn = EINA_TRUE;
}
EAPI Eina_Bool
double longpress_timeout;
unsigned char effect_enable;
unsigned char desktop_entry;
- Eina_Bool password_show_last;
+ unsigned char password_show_last;
double password_show_last_timeout;
- Eina_Bool glayer_zoom_finger_enable;
+ unsigned char glayer_zoom_finger_enable;
double glayer_zoom_finger_factor;
double glayer_zoom_wheel_factor;
double glayer_zoom_distance_tolerance;
double glayer_long_tap_start_timeout;
double glayer_double_tap_timeout;
int access_mode;
- Eina_Bool glayer_continues_enable;
+ unsigned char glayer_continues_enable;
int week_start;
int weekend_start;
int weekend_len;
int year_max;
Eina_List *color_palette;
unsigned char softcursor_mode;
+ unsigned char auto_norender_withdrawn;
+ unsigned char auto_norender_iconified_same_as_withdrawn;
+ unsigned char auto_flush_withdrawn;
+ unsigned char auto_dump_withdrawn;
+ unsigned char auto_throttle;
+ double auto_throttle_amount;
/* Not part of the EET file */
Eina_Bool is_mirrored : 1;
Eina_List *_elm_win_list = NULL;
int _elm_win_deferred_free = 0;
+static int _elm_win_count = 0;
+static int _elm_win_count_shown = 0;
+static int _elm_win_count_iconified = 0;
+static int _elm_win_count_withdrawn = 0;
+
+static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
+
+static Ecore_Job *_elm_win_state_eval_job = NULL;
+
+static void
+_elm_win_state_eval(void *data __UNUSED__)
+{
+ Eina_List *l;
+ Evas_Object *obj;
+
+ _elm_win_state_eval_job = NULL;
+
+ if (_elm_config->auto_norender_withdrawn)
+ {
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ {
+ if ((elm_win_withdrawn_get(obj)) ||
+ ((elm_win_iconified_get(obj) &&
+ (_elm_config->auto_norender_iconified_same_as_withdrawn))))
+ {
+ if (!evas_object_data_get(obj, "__win_auto_norender"))
+ {
+ Evas *evas = evas_object_evas_get(obj);
+
+ elm_win_norender_push(obj);
+ evas_object_data_set(obj, "__win_auto_norender", obj);
+
+ if (_elm_config->auto_flush_withdrawn)
+ {
+ edje_file_cache_flush();
+ edje_collection_cache_flush();
+ evas_image_cache_flush(evas);
+ evas_font_cache_flush(evas);
+ }
+ if (_elm_config->auto_dump_withdrawn)
+ {
+ evas_render_dump(evas);
+ }
+ }
+ }
+ else
+ {
+ if (evas_object_data_get(obj, "__win_auto_norender"))
+ {
+ elm_win_norender_pop(obj);
+ evas_object_data_del(obj, "__win_auto_norender");
+ }
+ }
+ }
+ }
+ if (_elm_config->auto_throttle)
+ {
+ if (_elm_win_count == 0)
+ {
+ if (_elm_win_auto_throttled)
+ {
+ ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
+ _elm_win_auto_throttled = EINA_FALSE;
+ }
+ }
+ else
+ {
+ if ((_elm_win_count_iconified + _elm_win_count_withdrawn) >=
+ _elm_win_count_shown)
+ {
+ if (!_elm_win_auto_throttled)
+ {
+ ecore_throttle_adjust(_elm_config->auto_throttle_amount);
+ _elm_win_auto_throttled = EINA_TRUE;
+ }
+ }
+ else
+ {
+ if (_elm_win_auto_throttled)
+ {
+ ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
+ _elm_win_auto_throttled = EINA_FALSE;
+ }
+ }
+ }
+ }
+}
+
+static void
+_elm_win_state_eval_queue(void)
+{
+ if (_elm_win_state_eval_job) ecore_job_del(_elm_win_state_eval_job);
+ _elm_win_state_eval_job = ecore_job_add(_elm_win_state_eval, NULL);
+}
+
// example shot spec (wait 0.1 sec then save as my-window.png):
// ELM_ENGINE="shot:delay=0.1:file=my-window.png"
obj = ELM_WIDGET_DATA(sd)->obj;
+ if (sd->withdrawn) _elm_win_count_withdrawn--;
+ if (sd->iconified) _elm_win_count_iconified--;
+
if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
{
sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
sd->maximized = ecore_evas_maximized_get(sd->ee);
ch_maximized = EINA_TRUE;
}
+
+ if (sd->withdrawn) _elm_win_count_withdrawn++;
+ if (sd->iconified) _elm_win_count_iconified++;
+ _elm_win_state_eval_queue();
+
if ((ch_withdrawn) || (ch_iconified))
{
if (sd->withdrawn)
{
ELM_WIN_DATA_GET(obj, sd);
+ if (!evas_object_visible_get(obj))
+ {
+ _elm_win_count_shown++;
+ _elm_win_state_eval_queue();
+ }
_elm_win_parent_sc->base.show(obj);
TRAP(sd, show);
{
ELM_WIN_DATA_GET(obj, sd);
+ if (evas_object_visible_get(obj))
+ {
+ _elm_win_count_shown--;
+ _elm_win_state_eval_queue();
+ }
_elm_win_parent_sc->base.hide(obj);
TRAP(sd, hide);
if (sd->autodel_clear) *(sd->autodel_clear) = -1;
_elm_win_list = eina_list_remove(_elm_win_list, obj);
-
+ if (sd->withdrawn) _elm_win_count_withdrawn--;
+ if (sd->iconified) _elm_win_count_iconified--;
+ if (evas_object_visible_get(obj)) _elm_win_count_shown--;
+ _elm_win_count--;
+ _elm_win_state_eval_queue();
+
if (sd->ee)
{
ecore_evas_callback_delete_request_set(sd->ee, NULL);
void
_elm_win_shutdown(void)
{
- while (_elm_win_list)
- evas_object_del(_elm_win_list->data);
+ while (_elm_win_list) evas_object_del(_elm_win_list->data);
+ if (_elm_win_state_eval_job)
+ {
+ ecore_job_del(_elm_win_state_eval_job);
+ _elm_win_state_eval_job = NULL;
+ }
}
void
const Eina_List *l;
Evas_Object *obj;
- EINA_LIST_FOREACH (_elm_win_list, l, obj)
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
elm_widget_access(obj, is_access);
}
Evas_Object *obj;
EINA_LIST_FOREACH(_elm_win_list, l, obj)
- {
- evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
- }
+ evas_object_smart_callback_call(obj, SIG_IOERR, NULL);
elm_exit();
}
#endif
#endif
_elm_win_list = eina_list_append(_elm_win_list, obj);
-
+ _elm_win_count++;
+
if (((fallback) && (!strcmp(fallback, "Software FB"))) ||
((!fallback) && (ENGINE_COMPARE(ELM_SOFTWARE_FB))))
{