elementary: add an interface to enable/disable PAUSE/RESUME application state.
If you want to have EFL application behave in a more efficient way. Like dropping memory usage or stopping unecessary network operation, this option should be on and the application should listen on PAUSE/RESUME event on the main loop.
This commit is contained in:
parent
fcdbc07fe3
commit
cd1f5915d2
|
@ -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<br>"
|
||||
"drop its ressource and switch to a paused state<br>"
|
||||
"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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue