diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c index 7e603772a1..8870ad7609 100644 --- a/src/bin/elementary/config.c +++ b/src/bin/elementary/config.c @@ -3962,6 +3962,19 @@ _cb_vsync(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED) } } +static void +_cb_withdrawn(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED) +{ + Eina_Bool val = elm_check_state_get(obj); + Eina_Bool sb = elm_config_agressive_withdrawn_get(); + + if (val != sb) + { + elm_config_agressive_withdrawn_set(val); + elm_config_all_flush(); + } +} + static void _status_config_rendering(Evas_Object *win, Evas_Object *naviframe) @@ -4030,6 +4043,13 @@ _status_config_rendering(Evas_Object *win, _cb_vsync, NULL); elm_check_state_set(ck, elm_config_vsync_get()); + CHECK_ADD("Aggressive withdrawn", + "When the application is iconified it will
" + "drop its ressource and switch to a paused state
" + "if the application handle that lifecycle state.", + _cb_withdrawn, NULL); + elm_check_state_set(ck, elm_config_agressive_withdrawn_get()); + evas_object_data_set(win, "rendering", bx); elm_naviframe_item_simple_push(naviframe, bx); } diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 26cddfba46..4c312b3107 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -3358,6 +3358,24 @@ elm_config_vsync_set(Eina_Bool enabled) _elm_config->vsync = enabled; } +EAPI Eina_Bool +elm_config_agressive_withdrawn_get(void) +{ + return _elm_config->auto_norender_withdrawn && + _elm_config->auto_norender_iconified_same_as_withdrawn && + _elm_config->auto_flush_withdrawn && + _elm_config->auto_dump_withdrawn; +} + +EAPI void +elm_config_agressive_withdrawn_set(Eina_Bool enabled) +{ + _elm_config->auto_norender_withdrawn = enabled; + _elm_config->auto_norender_iconified_same_as_withdrawn = enabled; + _elm_config->auto_flush_withdrawn = enabled; + _elm_config->auto_dump_withdrawn = enabled; +} + EAPI Eina_Bool elm_config_accel_preference_override_get(void) { diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h index 019975d721..aa83915d1b 100644 --- a/src/lib/elementary/elm_config.h +++ b/src/lib/elementary/elm_config.h @@ -1541,6 +1541,26 @@ EAPI Eina_Bool elm_config_vsync_get(void); */ EAPI void elm_config_vsync_set(Eina_Bool enabled); +/** + * Get the configure flag that will define if a window agressively drop its + * ressource when minimized. + * + * @return if it does. + * + * @since 1.21 + */ +EAPI Eina_Bool elm_config_agressive_withdrawn_get(void); + +/** + * Set the configure flag that will make a window agressively drop its + * ressource when minimized. + * + * @param enabled This should be @c EINA_TRUE if enabled, or @c EINA_FALSE if + * not. + * @since 1.21 + */ +EAPI void elm_config_agressive_withdrawn_set(Eina_Bool enabled); + /** * Get the acceleration override preference flag *