#include <appcore-common.h>
#include <aul.h>
+#if HAVE_X
#include <Ecore_X.h>
+#endif
#include <vconf.h>
#include "taskmanager.h"
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+ int ret = -1;
+
_fini_pthread();
if (ad->update_timer) {
ecore_timer_del(ad->update_timer);
ad->update_timer = NULL;
}
- _subt_einalist_item(ad, pid);
- _D("mode(%d) count(%d)\n", ad->mode, ad->endcnt);
+ ret = _subt_einalist_item(ad, pid);
+ _D("mode(%d) count(%d) pid(%d) \n", ad->mode, ad->endcnt, pid);
+
+ if (ret != -1) {
switch (ad->mode) {
default:
case MODE_END_INUSE:
break;
}
}
+}
static void _back_cb(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_add(gl, "scroll,drag,stop", _drag_stop_cb, ad);
evas_object_smart_callback_add(gl, "scroll,anim,start", _anim_start_cb, ad);
evas_object_smart_callback_add(gl, "scroll,anim,stop", _anim_stop_cb, ad);
-// evas_object_smart_callback_add(gl, "edge,bottom", _moved_cb, ad);
ad->gl = gl;
bt = elm_button_add(nv);
static void _get_win_geometry(struct appdata *ad)
{
- Ecore_X_Window focus_win;
- Ecore_X_Window root_win;
-
- focus_win = ecore_x_window_focus_get();
- root_win = ecore_x_window_root_get(focus_win);
- ecore_x_window_size_get(root_win, &ad->root_w, &ad->root_h);
+ Evas_Object *eo;
+ Ecore_Evas *ee;
+
+ ee = ecore_evas_ecore_evas_get(evas_object_evas_get(ad->win));
+ ecore_evas_screen_geometry_get(ee, 0, 0, &ad->root_w, &ad->root_h);
}
static void _vconf_noti_cb(keynode_t *node, 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)
{
pid_a = ev->data.l[1];
pid_d = ev->data.l[3];
+#if HAVE_X
a_deact = ecore_x_atom_get("_X_ILLUME_DEACTIVATE_WINDOW");
+#endif
/* when pid_a == pid_d, this is useless data */
if (pid_a == pid_d) {
return ECORE_CALLBACK_CANCEL;
}
+#endif
static Eina_Bool _ask_kill_process(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;
}