diff options
-rwxr-xr-x | src/appcore-watch.c | 23 | ||||
-rwxr-xr-x | src/watch_app_main.c | 12 |
2 files changed, 17 insertions, 18 deletions
diff --git a/src/appcore-watch.c b/src/appcore-watch.c index 8fa1c6b..65a2160 100755 --- a/src/appcore-watch.c +++ b/src/appcore-watch.c @@ -35,6 +35,7 @@ #include <glib-object.h> #include <Ecore_Wayland.h> #include <widget_app.h> +#include <aul_rsm_provider.h> #include "appcore-watch.h" #include "appcore-watch-log.h" @@ -1142,8 +1143,6 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv) { int r; bundle *kb = NULL; - char *wayland_display = NULL; - char *xdg_runtime_dir = NULL; char *width_str = NULL; char *height_str = NULL; int width = 360; @@ -1165,25 +1164,9 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv) kb = bundle_import_from_argv(argc, argv); if (kb) { - bundle_get_str(kb, "XDG_RUNTIME_DIR", &xdg_runtime_dir); - bundle_get_str(kb, "WAYLAND_DISPLAY", &wayland_display); bundle_get_str(kb, "WATCH_WIDTH", &width_str); bundle_get_str(kb, "WATCH_HEIGHT", &height_str); - if (xdg_runtime_dir) { - _E("senenv: %s", xdg_runtime_dir); - setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1); - } else { - _E("failed to get xdgruntimedir"); - } - - if (wayland_display) { - _E("setenv: %s", wayland_display); - setenv("WAYLAND_DISPLAY", wayland_display, 1); - } else { - _E("failed to get waylanddisplay"); - } - if (width_str) width = atoi(width_str); @@ -1202,6 +1185,8 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv) r = watch_core_init(watch->name, &w_ops, argc, argv); _retv_if(r < 0, -1); + aul_rsm_provider_init(); + __widget_create(NULL, NULL, width, height, NULL); __watch_core_signal_init(); @@ -1222,6 +1207,8 @@ static void __after_loop(struct watch_priv *watch) if (watch->ops && watch->ops->terminate) watch->ops->terminate(watch->ops->data); + aul_rsm_provider_fini(); + elm_shutdown(); alarmmgr_fini(); diff --git a/src/watch_app_main.c b/src/watch_app_main.c index 95fe6f7..3763c9f 100755 --- a/src/watch_app_main.c +++ b/src/watch_app_main.c @@ -24,6 +24,8 @@ #include <Eina.h> #include <Evas.h> #include <Elementary.h> +#include <Ecore_Wayland.h> +#include <aul_rsm_provider.h> #include "appcore-watch.h" #include "appcore-watch-log.h" @@ -682,6 +684,8 @@ EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time, EXPORT_API int watch_app_get_elm_win(Evas_Object **win) { Evas_Object *ret_win; + struct wl_surface *surface; + Ecore_Wl_Window *wl_win; if (win == NULL) return watch_app_error(APP_ERROR_INVALID_PARAMETER, @@ -692,6 +696,14 @@ EXPORT_API int watch_app_get_elm_win(Evas_Object **win) return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL); + wl_win = elm_win_wl_window_get(ret_win); + if (wl_win == NULL) + _E("failed to get surface"); + + surface = ecore_wl_window_surface_get(wl_win); + + aul_rsm_provider_remote_enable(watch_core_get_appid(), surface); + *win = ret_win; return APP_ERROR_NONE; } |