summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Huang <jimmy.huang@intel.com>2013-02-11 14:07:12 -0800
committerJimmy Huang <jimmy.huang@intel.com>2013-02-11 14:07:12 -0800
commit72a02b5e34428b89e58c97db3bd894b11504dc37 (patch)
tree69290243430f1b47b1b47dcf32cf0b65cf737f2c
parentd49c013d34e441131b44dc0edf92010a752f9fe2 (diff)
downloadtaskmanager-72a02b5e34428b89e58c97db3bd894b11504dc37.tar.gz
taskmanager-72a02b5e34428b89e58c97db3bd894b11504dc37.tar.bz2
taskmanager-72a02b5e34428b89e58c97db3bd894b11504dc37.zip
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 <jimmy.huang@intel.com>
-rwxr-xr-xsrc/_genlist.c4
-rwxr-xr-xsrc/_logic.c7
-rwxr-xr-xsrc/taskmanager.c16
-rwxr-xr-xsrc/taskmanager.h6
4 files changed, 33 insertions, 0 deletions
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 <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
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 <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);
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 <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