From 5416ec269c4b4485786add8bd8c249c4e31e2ecf Mon Sep 17 00:00:00 2001 From: "junkyu.han" Date: Sat, 13 Jun 2015 11:53:08 +0900 Subject: [PATCH] modify local variation Change-Id: I9aaaccf093bac697e96841f0b95bed62478b6c38 --- src/key.c | 26 ++++++++++---------------- src/menu_screen.c | 30 +++++++++++++++++------------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/key.c b/src/key.c index 9c18633..15685de 100644 --- a/src/key.c +++ b/src/key.c @@ -197,16 +197,15 @@ HAPI void key_unregister(void) HAPI void key_grab_home(void) { + Evas_Object *win = NULL; + int setkey_ret = 0; if (EINA_TRUE == key_info.home_grabbed) return; - //Ecore_X_Window win = elm_win_xwindow_get(menu_screen_get_win()); - //Display* dpy = ecore_x_display_get(); - - //int ret = utilx_grab_key(dpy, win, KEY_SELECT, TOP_POSITION_GRAB); - //ret_if(0 != ret); - - //ret = utilx_grab_key(dpy, win, KEY_BACK, TOP_POSITION_GRAB); - //ret_if(0 != ret); + win = menu_screen_get_win(); + setkey_ret = elm_win_keygrab_set(win, KEY_BACK, 0, 0, 0, ELM_WIN_KEYGRAB_TOPMOST); + ret_if(!setkey_ret); + setkey_ret = elm_win_keygrab_set(win, KEY_SELECT, 0, 0, 0, ELM_WIN_KEYGRAB_TOPMOST); + ret_if(!setkey_ret); key_info.home_grabbed = EINA_TRUE; } @@ -215,16 +214,11 @@ HAPI void key_grab_home(void) HAPI void key_ungrab_home(void) { + Evas_Object *win = NULL; if (key_info.home_grabbed == EINA_FALSE) return; - /*Ecore_X_Window win = elm_win_xwindow_get(menu_screen_get_win()); - Display* dpy = ecore_x_display_get(); - - int ret = utilx_ungrab_key(dpy, win, KEY_SELECT); - ret_if(0 != ret); - - ret = utilx_ungrab_key(dpy, win, KEY_BACK); - ret_if(0 != ret);*/ + elm_win_keygrab_unset(win, KEY_SELECT, 0, 0); + elm_win_keygrab_unset(win, KEY_BACK, 0, 0); key_info.home_grabbed = EINA_FALSE; } diff --git a/src/menu_screen.c b/src/menu_screen.c index 2575adb..51b0eb0 100755 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -239,16 +239,18 @@ static menu_screen_error_e _create_canvas(char *name, char *title) elm_win_borderless_set(menu_screen_info.win, EINA_TRUE); elm_win_screen_size_get(menu_screen_info.win, NULL, NULL, &menu_screen_info.root_width, &menu_screen_info.root_height); - //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) { -// ecore_x_window_prop_string_set(elm_win_xwindow_get(menu_screen_info.win), ATOM_WM_WINDOW_ROLE, "MENU_SCREEN"); -// } else { -// _D("Failed to set the window role as MENU_SCREEN"); -// } +#if 0 + 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) { + ecore_x_window_prop_string_set(elm_win_xwindow_get(menu_screen_info.win), ATOM_WM_WINDOW_ROLE, "MENU_SCREEN"); + } else { + _D("Failed to set the window role as MENU_SCREEN"); + } +#endif - //elm_win_role_set(menu_screen_info.win, "MENU_SCREEN"); - //evas_object_resize(menu_screen_info.win, menu_screen_get_root_width(), menu_screen_get_root_height()); + elm_win_role_set(menu_screen_info.win, "MENU_SCREEN"); + evas_object_resize(menu_screen_info.win, menu_screen_get_root_width(), menu_screen_get_root_height()); menu_screen_info.evas = evas_object_evas_get(menu_screen_info.win); if (!menu_screen_info.evas) { @@ -318,7 +320,12 @@ static void _create_bg(void) evas_object_show(rect); bg = evas_object_image_add(menu_screen_get_evas()); - goto_if(!bg, ERROR); + if (!bg) { + if (rect) { + evas_object_del(rect); + } + goto ERROR; + } evas_object_image_load_orientation_set(bg, EINA_TRUE); evas_object_data_set(menu_screen_get_win(), "bg", bg); } @@ -356,9 +363,6 @@ ERROR: if (buf) { free(buf); } - if (rect) { - evas_object_del(rect); - } } -- 2.7.4