From d8ba95fd1cd396ce05f6729bf5c1f999c47ccc02 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 10 Jan 2019 15:48:10 -0500 Subject: [PATCH] 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 Differential Revision: https://phab.enlightenment.org/D7593 --- src/lib/ecore/efl_app.eo | 1 + src/lib/elementary/efl_ui_win.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo index 303d1a6..860de3a 100644 --- a/src/lib/ecore/efl_app.eo +++ b/src/lib/ecore/efl_app.eo @@ -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]] diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index cce9788..c0b6b44 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -3554,11 +3554,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 -- 2.7.4