Patched to run under Wayland environment 28/2728/1
authorJimmy Huang <jimmy.huang@intel.com>
Fri, 8 Feb 2013 00:40:34 +0000 (16:40 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Fri, 8 Feb 2013 00:40:34 +0000 (16:40 -0800)
- Removed X specific calls that do not work in wayland
- Use ELM_ENGINE to determine backend instead of LAUNCHER_ENGINE

Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
src/menu_screen.c

index 20e4beb..4d5ceec 100644 (file)
@@ -35,7 +35,7 @@
 #include "page_scroller.h"
 #include "util.h"
 
-#define STR_ENV_ENGINE "LAUNCHER_ENGINE"
+#define STR_ENV_ENGINE "ELM_ENGINE"
 #define STR_ENV_FPS "LAUNCHER_FPS"
 
 #define LAYOUT_EDJE_PORTRAIT EDJEDIR"/layout_portrait.edj"
@@ -63,7 +63,7 @@ static struct {
        .is_done = false,
 };
 
-
+static void _set_scale(void);
 
 Evas *menu_screen_get_evas(void)
 {
@@ -126,6 +126,8 @@ static menu_screen_error_e _create_canvas(char *name, char *title)
        }
        elm_win_borderless_set(menu_screen_info.win, EINA_TRUE);
 
+#if 0
+       /* X Specific */
        ecore_x_icccm_name_class_set(elm_win_xwindow_get(menu_screen_info.win), "MENU_SCREEN", "MENU_SCREEN");
        ATOM_WM_WINDOW_ROLE = ecore_x_atom_get("WM_WINDOW_ROLE");
        if (ATOM_WM_WINDOW_ROLE) {
@@ -133,6 +135,10 @@ static menu_screen_error_e _create_canvas(char *name, char *title)
        } else {
                _D("Failed to set the window role as MENU_SCREEN");
        }
+#endif
+
+       /* have to call this after elm_win_add() in wayland */
+       _set_scale();
 
        menu_screen_info.evas = evas_object_evas_get(menu_screen_info.win);
        if (!menu_screen_info.evas) {
@@ -162,10 +168,13 @@ static void _destroy_canvas(void)
 
 static int _dead_cb(int pid, void *data)
 {
+#if 0
+       /* X Specific */
        utilx_hide_fake_effect(
                ecore_x_display_get(),
                ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
        );
+#endif
 
        return EXIT_SUCCESS;
 }
@@ -288,7 +297,11 @@ static bool _create_cb(void *data)
 {
        Evas_Object *layout;
 
+#if 0
+       /* Move this call to be executed after window is created */
        _set_scale();
+#endif
+
        retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), EXIT_FAILURE);
        elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW);
 
@@ -358,10 +371,13 @@ static void _resume_cb(void *data)
                _E("Failed to set memory/idle/top to 1");
        }
 
+#if 0
+       /* X Specific */
        utilx_hide_fake_effect(
                ecore_x_display_get(),
                ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
        );
+#endif
 
        menu_screen_info.state = APP_STATE_RESUME;
 }
@@ -376,10 +392,13 @@ static void _service_cb(service_h service, void *data)
                _E("Failed to set memory/idle/top to 1");
        }
 
+#if 0
+       /* X Specific */
        utilx_hide_fake_effect(
                ecore_x_display_get(),
                ecore_x_window_root_get(ecore_evas_window_get(menu_screen_info.ee))
        );
+#endif
 }