efl_app: add "standby" event
authorMike Blumenkrantz <zmike@samsung.com>
Thu, 10 Jan 2019 20:48:10 +0000 (15:48 -0500)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 24 Jan 2019 05:20:18 +0000 (14:20 +0900)
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

src/lib/ecore/efl_app.eo
src/lib/elementary/efl_ui_win.c

index 303d1a6..860de3a 100644 (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]]
index cce9788..c0b6b44 100644 (file)
@@ -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