From: Jimmy Huang Date: Mon, 11 Feb 2013 22:07:12 +0000 (-0800) Subject: Added #ifdefs to functions that are only works in X X-Git-Tag: accepted/2.0alpha-wayland/20130215.202436~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F2742%2F1;p=profile%2Fivi%2Ftaskmanager.git Added #ifdefs to functions that are only works in X Added #ifdefs to functions that are only works in X so they are not compiled. These functions make calls to libslp-utilx and ecore_x library that either segfaults or do not work properly when running in wayland, they include: set_notification(), _unset_notification_level(), _set_launch_effect(), _key_grab() Signed-off-by: Jimmy Huang --- diff --git a/src/_genlist.c b/src/_genlist.c index 74bab7a..a2e29af 100755 --- a/src/_genlist.c +++ b/src/_genlist.c @@ -21,7 +21,9 @@ #include #include #include +#if HAVE_X #include +#endif #include #include #include @@ -276,7 +278,9 @@ _D("func\n"); selected = 0; } else { +#if HAVE_X _unset_notification_level(info->ad->win); +#endif if (!strcmp(info->pkg_name, "org.tizen.phone")) { /* exception : Because dialer doesn't need bundle diff --git a/src/_logic.c b/src/_logic.c index 45b7d87..2c02838 100755 --- a/src/_logic.c +++ b/src/_logic.c @@ -205,6 +205,8 @@ static void _set_vconf_noti(void *data) _vconf_noti_cb, NULL); } +/* X specific */ +#if HAVE_X /* this func is to exit taskmanager after launching application */ static Eina_Bool __climsg_cb(void *data, int type, void *event) { @@ -240,6 +242,7 @@ static Eina_Bool __climsg_cb(void *data, int type, void *event) return ECORE_CALLBACK_CANCEL; } +#endif static Eina_Bool _ask_kill_process(void *data) { @@ -339,12 +342,16 @@ Eina_Bool _create_idler_cb(void *data) evas_object_show(ad->win); +#if HAVE_X _key_grab(ad); +#endif _init_pthread(); _get_win_geometry(ad); _set_vconf_noti(ad); +#if HAVE_X ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __climsg_cb, ad); +#endif return ECORE_CALLBACK_CANCEL; } diff --git a/src/taskmanager.c b/src/taskmanager.c index afad212..77eaf42 100755 --- a/src/taskmanager.c +++ b/src/taskmanager.c @@ -22,7 +22,9 @@ #include #include #include +#if HAVE_X #include +#endif #include #include #include @@ -109,6 +111,8 @@ Eina_Bool _exit_cb(void *data) return ECORE_CALLBACK_CANCEL; } +/* X Specific */ +#if HAVE_X void _key_grab(struct appdata *ad) { int ret = 0; @@ -122,7 +126,10 @@ void _key_grab(struct appdata *ad) ret = utilx_grab_key(disp, xwin, KEY_SELECT, SHARED_GRAB); retm_if(ret < 0, "Failed to grab home key\n"); } +#endif +/* X Specific */ +#if HAVE_X int _set_launch_effect(Evas_Object *win) { Ecore_X_Window xwin = 0; @@ -152,7 +159,10 @@ int _set_launch_effect(Evas_Object *win) ecore_x_icccm_name_class_set(xwin, "TASK_MANAGER", "TASK_MANAGER"); return 0; } +#endif +/* X Specific */ +#if HAVE_X int _unset_notification_level(Evas_Object *win) { Ecore_X_Window xwin; @@ -161,8 +171,11 @@ int _unset_notification_level(Evas_Object *win) ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NORMAL); return 0; } +#endif +/* X Specific */ +#if HAVE_X int _set_notification_level(Evas_Object *win, Utilx_Notification_Level level) { Ecore_X_Window xwin = 0; @@ -172,6 +185,7 @@ int _set_notification_level(Evas_Object *win, Utilx_Notification_Level level) utilx_set_system_notification_level(ecore_x_display_get(), xwin, level); return 0; } +#endif int app_create(void *data) { @@ -184,8 +198,10 @@ int app_create(void *data) elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW); ad->win = win; +#if HAVE_X _set_launch_effect(win); // _set_notification_level(win, UTILX_NOTIFICATION_LEVEL_NORMAL); +#endif elm_theme_extension_add(NULL, EDJ_THEME); diff --git a/src/taskmanager.h b/src/taskmanager.h index 47d9635..c1d47a0 100755 --- a/src/taskmanager.h +++ b/src/taskmanager.h @@ -16,13 +16,17 @@ +/* Set to run in wayland only */ +#define HAVE_X 0 #ifndef __TASKMANAGER_H__ #define __TASKMANAGER_H__ #include #include +#if HAVE_X #include +#endif #include #if !defined(PACKAGE) @@ -120,8 +124,10 @@ enum task_status { }; Evas_Object *load_edj(Evas_Object *parent, const char *file, const char *group); +#if HAVE_X int _unset_notification_level(Evas_Object *win); int _set_notification_level(Evas_Object *win, Utilx_Notification_Level level); +#endif Eina_Bool _exit_cb(void *data); #endif