fix for applying wayland (removing X)
[apps/home/settings.git] / setting-common / src / setting-common-draw-popup.c
index 832b371..654be26 100755 (executable)
 
 #include <setting-common-draw-widget.h>
 #include <glib.h>
-#include <utilX.h>
-#include <Ecore_X.h>
 #include <efl_assist.h>
 #include <notification.h>
 #include <notification_internal.h>
 
-#define SUPPORT_BACK_KEY_GRAB  1
+#include <Elementary.h>
+
+#define SUPPORT_BACK_KEY_GRAB  0
 static void __ignore_back_key_cb(void *data, Evas_Object *obj, void *event_info);
 
 EXPORT_PUBLIC void popup_handle_hardkey(void *data, Evas_Object *popup)
@@ -83,10 +83,12 @@ static void __hardkey_keyup_cb(void *data, Evas *e, Evas_Object *obj, void *even
 {
        SETTING_TRACE_BEGIN;
        Evas_Event_Key_Down *ev = event_info;
+       #if 0
        if (!strcmp(ev->keyname, KEY_BACK)) {
                /*evas_object_hide(obj); // you can call evas_object_del(obj); to remove popup if you want */
                popup_handle_hardkey(data, obj);
        }
+       #endif
 }
 
 EXPORT_PUBLIC void ea_popup_back_cb_2(void *data, Evas_Object *obj, void *event_info)
@@ -269,13 +271,14 @@ EXPORT_PUBLIC void __popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *e
 
 {
        SETTING_TRACE_BEGIN;
+#if SUPPORT_BACK_KEY_GRAB
        Ecore_X_Display *disp = ecore_x_display_get();
        Ecore_X_Window xwin = elm_win_xwindow_get(obj);
        int ret = utilx_ungrab_key(disp, xwin, KEY_HOME);
        if (ret) {
                SETTING_TRACE_ERROR("KEY_HOME ungrab error ret[%d]", ret);
        }
-
+#endif
 }
 
 /**
@@ -306,12 +309,14 @@ EXPORT_PUBLIC void __popup_event_set(Evas_Object *popup, void *data,
        }
 
        if (keygrab_flag) {
+#if SUPPORT_BACK_KEY_GRAB
                Ecore_X_Display *disp = ecore_x_display_get();
                Ecore_X_Window xwin = elm_win_xwindow_get(popup);
                int ret = utilx_grab_key(disp, xwin, KEY_HOME, TOP_POSITION_GRAB);
                if (ret) {
                        SETTING_TRACE_ERROR("KEY_HOME grab error ret[%d]", ret);
                }
+#endif
                evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __popup_del_cb, NULL);
                ea_object_event_callback_add(popup, EA_CALLBACK_BACK, __ignore_back_key_cb, NULL);
        }
@@ -338,7 +343,7 @@ static Evas_Object *__add_progressbar(void *data, Evas_Object *parent,
        int value = 0;
        vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &value);
        if (!value) {
-#if 0
+#if SUPPORT_BACK_KEY_GRAB
                Ecore_X_Display *disp = ecore_x_display_get();
                Ecore_X_Window xwin = elm_win_xwindow_get(popup);
                int ret = utilx_grab_key(disp, xwin, KEY_BACK, TOP_POSITION_GRAB);
@@ -898,7 +903,7 @@ Evas_Object *setting_create_popup_with_gif(void *data,
 #else
        Evas_Object *scroller = elm_genlist_add(parent);
        retvm_if(scroller == NULL, NULL, "Cannot set scroller object  as contento of layout");
-       elm_genlist_realization_mode_set(scroller, EINA_TRUE);
+       //elm_genlist_realization_mode_set(scroller, EINA_TRUE);
        elm_object_style_set(scroller, "dialogue");
        elm_genlist_clear(scroller);    /* first to clear list */
        elm_genlist_mode_set(scroller, ELM_LIST_COMPRESS);
@@ -1130,7 +1135,7 @@ Evas_Object *setting_create_popup_with_image_check(void *data,
 #endif
        Evas_Object *scroller = elm_genlist_add(parent);
        retvm_if(scroller == NULL, NULL, "Cannot set scroller object  as contento of layout");
-       elm_genlist_realization_mode_set(scroller, EINA_TRUE);
+       //elm_genlist_realization_mode_set(scroller, EINA_TRUE);
        elm_object_style_set(scroller, "dialogue");
        elm_genlist_clear(scroller);    /* first to clear list */
        elm_genlist_mode_set(scroller, ELM_LIST_COMPRESS);