Added #ifdefs to functions that are only works in X 42/2742/1 I4ea88ee7
authorJimmy Huang <jimmy.huang@intel.com>
Mon, 11 Feb 2013 22:07:12 +0000 (14:07 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Mon, 11 Feb 2013 22:07:12 +0000 (14:07 -0800)
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 <jimmy.huang@intel.com>
src/_genlist.c
src/_logic.c
src/taskmanager.c
src/taskmanager.h

index 74bab7a..a2e29af 100755 (executable)
@@ -21,7 +21,9 @@
 #include <unistd.h>
 #include <appcore-efl.h>
 #include <vconf.h>
+#if HAVE_X
 #include <utilX.h>
+#endif
 #include <aul.h>
 #include <Ecore_X.h>
 #include <Eina.h>
@@ -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
index 45b7d87..2c02838 100755 (executable)
@@ -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;
 }
index afad212..77eaf42 100755 (executable)
@@ -22,7 +22,9 @@
 #include <appcore-efl.h>
 #include <Elementary.h>
 #include <Ecore_X.h>
+#if HAVE_X
 #include <utilX.h>
+#endif
 #include <vconf.h>
 #include <aul.h>
 #include <sysman.h>
@@ -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);
 
index 47d9635..c1d47a0 100755 (executable)
 
 
 
+/* Set to run in wayland only */
+#define HAVE_X 0
 
 #ifndef __TASKMANAGER_H__
 #define __TASKMANAGER_H__
 
 #include <Elementary.h>
 #include <Ecore_X.h>
+#if HAVE_X
 #include <utilX.h>
+#endif
 #include <bundle.h>
 
 #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