From e3fa72473be5ea3a7f5deb7ebb3c74673e17cce4 Mon Sep 17 00:00:00 2001 From: Zofia Abramowska Date: Fri, 9 Dec 2016 14:48:42 +0100 Subject: [PATCH] Delete window before reinitialization Additionally: * Remove dismiss descriptors inside ecore loop * Properly iterate over loop before exit Change-Id: I0c5b16498dbf904db8c649623a2e3d98989a3462 --- src/agent/notification-daemon/GuiRunner.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/agent/notification-daemon/GuiRunner.cpp b/src/agent/notification-daemon/GuiRunner.cpp index e7addd5..5b3be20 100644 --- a/src/agent/notification-daemon/GuiRunner.cpp +++ b/src/agent/notification-daemon/GuiRunner.cpp @@ -36,12 +36,18 @@ namespace Notification { void GuiRunner::unfocused(void *data, Evas_Object *, void *) { + ALOGD("Unfocused"); GuiRunner *runner = static_cast(data); if (runner->m_shouldRaise) - evas_object_show(runner->m_win);//elm_win_raise(runner->m_win); - else + evas_object_show(runner->m_win); + else { + for (auto &fdCbData : runner->m_fdCbDataMap) { + ecore_main_fd_handler_del(fdCbData.second.handler); + } + ecore_main_loop_iterate(); elm_exit(); + } } @@ -142,7 +148,6 @@ void GuiRunner::initialize() char *checkBoxText = dgettext(PROJECT_NAME, "IDS_ST_OPT_DONT_SHOW_AGAIN"); elm_init(0, NULL); - //placeholder m_win = elm_win_add(NULL, popupTitle, ELM_WIN_NOTIFICATION); if (!m_win) { ALOGE("EFL : Failed to add window"); @@ -329,6 +334,9 @@ NResponseType GuiRunner::popupRun(const std::string &app, const std::string &per m_running = false; m_shouldRaise = false; + + evas_object_del(m_win); + m_win = nullptr; } catch (const std::exception &e) { m_popupResponse = NResponseType::Error; m_errorMsg = std::move(e.what()); -- 2.7.4