efl_app: add "standby" event

this event is called on the app object when all windows have been destroyed
so that the app can decide to take further action, e.g., doing a deep clean of
cache or flushing configuration

@feature
ref T5494

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7593
This commit is contained in:
Mike Blumenkrantz 2019-01-10 15:48:10 -05:00 committed by Cedric BAIL
parent 79d15acca0
commit 5ab4784bbd
2 changed files with 6 additions and 3 deletions

View File

@ -39,6 +39,7 @@ class Efl.App (Efl.Loop)
events {
pause: void; [[Called when the application is not going be displayed or otherwise used by a user for some time]]
resume: void; [[Called before a window is rendered after a pause event]]
standby: void; [[Called when the application's windows are all destroyed]]
terminate: void; [[Called before starting the shutdown of the application]]
signal,usr1: void; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]]
signal,usr2: void; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]]

View File

@ -2985,11 +2985,13 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
efl_canvas_group_del(efl_super(obj, MY_CLASS));
if ((!_elm_win_list) &&
(elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
if (!_elm_win_list)
{
_elm_win_flush_cache_and_exit(obj);
if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)
_elm_win_flush_cache_and_exit(obj);
}
if (!_elm_win_list)
efl_event_callback_call(efl_app_main_get(EFL_APP_CLASS), EFL_APP_EVENT_STANDBY, NULL);
}
EOLIAN static void