powerkey popup : remove main popup, when sub poup is activated 99/90899/2 accepted/tizen/3.0/mobile/20161015.034207 accepted/tizen/3.0/tv/20161016.005810 accepted/tizen/3.0/wearable/20161015.084418 accepted/tizen/common/20161005.165223 accepted/tizen/mobile/20161005.081009 accepted/tizen/tv/20161005.081023 accepted/tizen/wearable/20161005.081041 submit/tizen/20161005.051118 submit/tizen_3.0_mobile/20161015.000006 submit/tizen_3.0_tv/20161015.000005 submit/tizen_3.0_wearable/20161015.000006
authorchangjoo.lee <changjoo.lee@samsung.com>
Wed, 5 Oct 2016 01:43:35 +0000 (10:43 +0900)
committerchangjoo.lee <changjoo.lee@samsung.com>
Wed, 5 Oct 2016 02:32:08 +0000 (11:32 +0900)
Change-Id: I5a316a2b1ece801dbba653c79c70debbbd2bdd8b
Signed-off-by: changjoo.lee <changjoo.lee@samsung.com>
src/powerkey/powerkey-mobile.c

index 8f116de..411d38f 100755 (executable)
@@ -52,8 +52,21 @@ static char *items[] = {
        "IDS_COM_SK_RESTART_ABB"
 };
 
+static void remove_other_powerkey_popups(const struct popup_ops *ops)
+{
+       if (ops != &powerkey_ops)
+               unload_simple_popup(&powerkey_ops);
+
+       if (ops != &poweroff_ops)
+               unload_simple_popup(&poweroff_ops);
+
+       if (ops != &restart_ops)
+               unload_simple_popup(&restart_ops);
+}
+
 static int restart_launch(bundle *b, const struct popup_ops *ops)
 {
+       remove_other_powerkey_popups(ops);
        return 0;
 }
 
@@ -272,12 +285,15 @@ static void unregister_handlers(const struct popup_ops *ops)
 
 static int powerkey_list_launch(bundle *b, const struct popup_ops *ops)
 {
+       unregister_handlers(ops);
+       remove_other_powerkey_popups(ops);
        register_handlers(ops);
        return 0;
 }
 
 static int poweroff_launch(bundle *b, const struct popup_ops *ops)
 {
+       remove_other_powerkey_popups(ops);
        register_handlers(ops);
        return 0;
 }