X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fui_base%2Fappcore_ui_base.c;h=22de1ee434c4c0b37443861f529ec266f688fa29;hb=f60091e7d7cef681ae27e6242c2f12937a6239b5;hp=ccf47b82a47afbce57e72e9b8ff9ea5769f0e5fa;hpb=d1ff2f9edd114c72967e2caad2aa27fc1f062bef;p=platform%2Fcore%2Fappfw%2Fapp-core.git diff --git a/src/ui_base/appcore_ui_base.c b/src/ui_base/appcore_ui_base.c index ccf47b8..22de1ee 100644 --- a/src/ui_base/appcore_ui_base.c +++ b/src/ui_base/appcore_ui_base.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -455,7 +456,7 @@ static void __raise_win(void) win_id = __get_main_window(); - _DBG("Raise window: %d", win_id); + _INFO("Raise window: %d", win_id); win = ecore_wl2_display_window_find(ecore_wl2_connected_display_get(NULL), win_id); ecore_wl2_window_activate(win); } @@ -551,10 +552,21 @@ static void __unset_bg_state(void) _DBG("bg state: %d", __context.bg_state); } +static void __set_app_id(void) +{ + if (!tz_policy && __init_wl() < 0) + return; + + tizen_policy_set_appid(tz_policy, getpid(), __context.appid); + wl_display_roundtrip(dsp); + _DBG("set appid: %s", __context.appid); +} + static void __do_start(bundle *b) { const char *bg_launch; const char *below_app; + const char *rpc_port; if (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL) { if (__context.below_app) { @@ -585,8 +597,11 @@ static void __do_start(bundle *b) } if (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_AUTO_CONTROL) { - if (!__context.bg_state) - __raise_win(); + if (!__context.bg_state) { + rpc_port = bundle_get_val(b, AUL_K_RPC_PORT); + if (!rpc_port) + __raise_win(); + } } } @@ -619,7 +634,8 @@ EXPORT_API int appcore_ui_base_on_receive(aul_type type, bundle *b) return 0; } - if (type == AUL_TERMINATE_BGAPP && __context.state != AS_PAUSED) + if ((type == AUL_TERMINATE_BGAPP || type == AUL_TERMINATE_BG_INST) && + __context.state != AS_PAUSED) return 0; if (type == AUL_START) @@ -644,8 +660,10 @@ EXPORT_API int appcore_ui_base_on_receive(aul_type type, bundle *b) break; case AUL_TERMINATE: break; + case AUL_TERMINATE_BG_INST: + case AUL_TERMINATE_INST: case AUL_TERMINATE_BGAPP: - _DBG("[APP %d] is paused. TERMINATE", getpid()); + _DBG("[APP %d] TERMINATE", getpid()); __context.state = AS_DYING; aul_status_update(STATUS_DYING); if (__context.ops.base.exit) @@ -792,22 +810,29 @@ static void __group_lower() appcore_ui_base_group_remove(); } -EXPORT_API void appcore_ui_base_group_add() +EXPORT_API int appcore_ui_base_group_add() { static bool attached = false; + int ret; _DBG("__group_attach"); if (attached) - return; + return 0; int wid = __get_main_surface(); if (wid == 0) { _ERR("window wasn't ready"); - return; + return -1; + } + + ret = aul_app_group_set_window(wid); + if (ret < 0) { + _ERR("Failed to set app group window. error(%d)", ret); + return ret; } - aul_app_group_set_window(wid); attached = true; + return 0; } EXPORT_API void appcore_ui_base_group_remove() @@ -1004,6 +1029,9 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar } } + if (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_ID_CONTROL) + __set_app_id(); + return appcore_base_init(ops.base, argc, argv, data); }