diff --git a/legacy/elementary/src/lib/elm_general.h b/legacy/elementary/src/lib/elm_general.h index ac751c73c5..3946b68950 100644 --- a/legacy/elementary/src/lib/elm_general.h +++ b/legacy/elementary/src/lib/elm_general.h @@ -77,6 +77,9 @@ typedef enum * should quit automatically. @see * Elm_Policy_Quit. */ + ELM_POLICY_EXIT, /**< defines elm_exit() behaviour. @see Elm_Policy_Exit. + * @since 1.8 + */ ELM_POLICY_LAST } Elm_Policy; /**< Elementary policy identifiers/groups enumeration. @see elm_policy_set() */ @@ -89,6 +92,13 @@ typedef enum * window is closed */ } Elm_Policy_Quit; /**< Possible values for the #ELM_POLICY_QUIT policy */ +typedef enum +{ + ELM_POLICY_EXIT_NONE = 0, /**< just quit the main loop on elm_exit() */ + ELM_POLICY_EXIT_WINDOWS_DEL /**< delete all the windows after quitting + * the main loop */ +} Elm_Policy_Exit; /**< Possible values for the #ELM_POLICY_EXIT policy */ + typedef enum { ELM_FOCUS_PREVIOUS, diff --git a/legacy/elementary/src/lib/elm_main.c b/legacy/elementary/src/lib/elm_main.c index 11e9083227..3e4dd17d27 100644 --- a/legacy/elementary/src/lib/elm_main.c +++ b/legacy/elementary/src/lib/elm_main.c @@ -847,6 +847,15 @@ EAPI void elm_exit(void) { ecore_main_loop_quit(); + + if (elm_policy_get(ELM_POLICY_EXIT) == ELM_POLICY_EXIT_WINDOWS_DEL) + { + Eina_List *l, *l_next; + Evas_Object *win; + + EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win) + evas_object_del(win); + } } //FIXME: Use Elm_Policy Parameter when 2.0 is released.