From 0a8f2f920d09d257ae2ae75fcc4d13bd70bc03c6 Mon Sep 17 00:00:00 2001 From: Yunjin Lee Date: Tue, 6 Dec 2016 19:38:29 +0900 Subject: [PATCH] Set window level for the case several popups are launched at the same time Change-Id: I4961c149e84ba369e3983326aeadd631d171ac4d Signed-off-by: Yunjin Lee --- packaging/askuser.spec | 1 + src/agent/notification-daemon/CMakeLists.txt | 7 +++--- src/agent/notification-daemon/GuiRunner.cpp | 34 ++++++++-------------------- src/agent/notification-daemon/GuiRunner.h | 1 - 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/packaging/askuser.spec b/packaging/askuser.spec index 8997078..9d41fd1 100644 --- a/packaging/askuser.spec +++ b/packaging/askuser.spec @@ -27,6 +27,7 @@ BuildRequires: pkgconfig(security-privilege-manager) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(capi-ui-efl-util) BuildRequires: coregl BuildRequires: edje-bin diff --git a/src/agent/notification-daemon/CMakeLists.txt b/src/agent/notification-daemon/CMakeLists.txt index 866d672..574eaf3 100644 --- a/src/agent/notification-daemon/CMakeLists.txt +++ b/src/agent/notification-daemon/CMakeLists.txt @@ -9,6 +9,7 @@ PKG_CHECK_MODULES(ASKUSER_NOTIFICATION_DEP security-privilege-manager pkgmgr-info vconf + capi-ui-efl-util ) INCLUDE_DIRECTORIES(SYSTEM @@ -42,9 +43,9 @@ TARGET_LINK_LIBRARIES(${TARGET_ASKUSER_NOTIFICATION} ) ADD_CUSTOM_TARGET(popup_custom.edj - COMMAND edje_cc -no-save res/popup_custom.edc res/popup_custom.edj - DEPENDS res/popup_custom.edc - ) + COMMAND edje_cc -no-save res/popup_custom.edc res/popup_custom.edj + DEPENDS res/popup_custom.edc + ) ADD_DEPENDENCIES(${PROJECT_NAME} popup_custom.edj) INSTALL(TARGETS ${TARGET_ASKUSER_NOTIFICATION} DESTINATION ${BIN_INSTALL_DIR}) diff --git a/src/agent/notification-daemon/GuiRunner.cpp b/src/agent/notification-daemon/GuiRunner.cpp index a078cb1..e7addd5 100644 --- a/src/agent/notification-daemon/GuiRunner.cpp +++ b/src/agent/notification-daemon/GuiRunner.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "Policy.h" namespace AskUser { @@ -38,16 +39,17 @@ void GuiRunner::unfocused(void *data, Evas_Object *, void *) GuiRunner *runner = static_cast(data); if (runner->m_shouldRaise) - elm_win_raise(runner->m_win); + evas_object_show(runner->m_win);//elm_win_raise(runner->m_win); else elm_exit(); + } void GuiRunner::winClose() { ALOGD("Window close"); m_shouldRaise = false; - elm_win_lower(m_win); + evas_object_hide(m_win); } // responseMap[allow][always] @@ -141,11 +143,13 @@ void GuiRunner::initialize() elm_init(0, NULL); //placeholder - m_win = elm_win_add(NULL, popupTitle, ELM_WIN_DOCK); + m_win = elm_win_add(NULL, popupTitle, ELM_WIN_NOTIFICATION); if (!m_win) { ALOGE("EFL : Failed to add window"); throw Exception("Elementary failed"); } + efl_util_set_notification_window_level(m_win, EFL_UTIL_NOTIFICATION_LEVEL_2); + elm_win_autodel_set(m_win, EINA_TRUE); elm_win_override_set(m_win, EINA_TRUE); elm_win_alpha_set(m_win, EINA_TRUE); @@ -288,30 +292,14 @@ void GuiRunner::setLocale() ALOGE("textdomain failed"); } -void GuiRunner::refresh() -{ - char *popupTitle = dgettext(PROJECT_NAME, "IDS_IDLE_HEADER_PRIVACY_REQUEST"); - char *checkBoxText = dgettext(PROJECT_NAME, "IDS_ST_OPT_DONT_SHOW_AGAIN"); -#ifdef MOBILE_UI - elm_object_part_text_set(m_popup, "title,text", popupTitle); - elm_object_text_set(m_denyButton, dgettext(PROJECT_NAME, "IDS_IDLE_BUTTON_DENY")); - elm_object_text_set(m_allowButton, dgettext(PROJECT_NAME, "IDS_IDLE_BUTTON_ALLOW_ABB7")); -#elif defined(CIRCLE_UI) - elm_object_part_text_set(m_layout, "elm.text.title", popupTitle); -#endif - elm_object_text_set(m_checkbox, checkBoxText); - elm_check_state_set(m_checkbox, EINA_FALSE); -} - NResponseType GuiRunner::popupRun(const std::string &app, const std::string &perm) { try { setLocale(); - if (!m_initialized) { - initialize(); - } - refresh(); + initialize(); + m_running = true; + std::string appId; std::string pkgLabel; identifyApp(app, appId, pkgLabel); @@ -335,8 +323,6 @@ NResponseType GuiRunner::popupRun(const std::string &app, const std::string &per evas_object_show(m_popup); evas_object_show(m_win); - elm_win_raise(m_win); - ALOGD("Showing popup"); elm_run(); ALOGD("Popup closed"); diff --git a/src/agent/notification-daemon/GuiRunner.h b/src/agent/notification-daemon/GuiRunner.h index d84fd8e..50bbe79 100644 --- a/src/agent/notification-daemon/GuiRunner.h +++ b/src/agent/notification-daemon/GuiRunner.h @@ -41,7 +41,6 @@ public: GuiRunner() = default; void initialize(); void setLocale(); - void refresh(); void addDismissFd(int fd, DissmissCb cb, void *data); void delDismissFd(int fd); ~GuiRunner(); -- 2.7.4