From 53ec0f918d503f1cf581315a8c9f89c8433ff695 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 18 Dec 2015 17:54:56 +0900 Subject: [PATCH] ecore_wayland: fix ecore_wl_window_keyboard_state_set() Fix parameter of ecore_wl_window_keyboard_state_set(). Also clipboard and indicator is fixed, too. Change-Id: Ib2d2531b7b475b1e3b505fda4f2280881699e1c9 --- src/lib/ecore_wayland/Ecore_Wayland.h | 4 ++-- src/lib/ecore_wayland/ecore_wl.c | 20 ++++++++++++++++---- src/lib/ecore_wayland/ecore_wl_window.c | 11 ++++------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 2263663..8132b2c 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -1146,12 +1146,12 @@ EAPI Ecore_Wl_Indicator_Opacity_Mode ecore_wl_window_indicator_opacity_get(Ecore EAPI void ecore_wl_window_clipboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h); EAPI Eina_Bool ecore_wl_window_clipboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h); -EAPI void ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Eina_Bool on); +EAPI void ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Ecore_Wl_Clipboard_State state); EAPI Ecore_Wl_Clipboard_State ecore_wl_window_clipboard_state_get(Ecore_Wl_Window *win); EAPI void ecore_wl_window_keyboard_geometry_set(Ecore_Wl_Window *win, int x, int y, int w, int h); EAPI Eina_Bool ecore_wl_window_keyboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h); -EAPI void ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Eina_Bool on); +EAPI void ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Ecore_Wl_Virtual_Keyboard_State state); EAPI Ecore_Wl_Virtual_Keyboard_State ecore_wl_window_keyboard_state_get(Ecore_Wl_Window *win); EAPI void ecore_wl_window_rotation_preferred_rotation_set(Ecore_Wl_Window *win, int rot); diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index fbf3d68..e7d6608 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -1318,7 +1318,9 @@ _ecore_wl_cb_conformant_area(void *data EINA_UNUSED, struct tizen_policy *tizen_ Ecore_Wl_Window *win = NULL; int org_x, org_y, org_w, org_h; Eina_Bool changed = EINA_FALSE; + Ecore_Wl_Indicator_State ind_state; Ecore_Wl_Virtual_Keyboard_State kbd_state; + Ecore_Wl_Clipboard_State clip_state; if (!surface) return; win = ecore_wl_window_surface_find(surface); @@ -1332,9 +1334,14 @@ _ecore_wl_cb_conformant_area(void *data EINA_UNUSED, struct tizen_policy *tizen_ ecore_wl_window_indicator_geometry_set(win, x, y, w, h); changed = EINA_TRUE; } - if (state != ecore_wl_window_indicator_state_get(win)) + + /* The given state is based on the visibility value of indicator. + * Thus we need to add 1 to it before comparing with indicator state. + */ + ind_state = ecore_wl_window_indicator_state_get(win); + if ((state + 1) != ind_state) { - ecore_wl_window_indicator_state_set(win, state); + ecore_wl_window_indicator_state_set(win, state + 1); changed = EINA_TRUE; } } @@ -1365,9 +1372,14 @@ _ecore_wl_cb_conformant_area(void *data EINA_UNUSED, struct tizen_policy *tizen_ ecore_wl_window_clipboard_geometry_set(win, x, y, w, h); changed = EINA_TRUE; } - if (state != ecore_wl_window_clipboard_state_get(win)) + + /* The given state is based on the visibility value of clipboard window. + * Thus we need to add 1 to it before comparing with clipboard state. + */ + clip_state = ecore_wl_window_clipboard_state_get(win); + if ((state + 1) != clip_state) { - ecore_wl_window_clipboard_state_set(win, state); + ecore_wl_window_clipboard_state_set(win, state + 1); changed = EINA_TRUE; } } diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index a24a2cd..f85f2d0 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -1752,14 +1752,12 @@ ecore_wl_window_clipboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int } EAPI void -ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Eina_Bool on) +ecore_wl_window_clipboard_state_set(Ecore_Wl_Window *win, Ecore_Wl_Clipboard_State state) { LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!win) return; - if (on) win->clipboard.state = ECORE_WL_CLIPBOARD_STATE_ON; - else if(!on) win->clipboard.state = ECORE_WL_CLIPBOARD_STATE_OFF; - + win->clipboard.state = state; } EAPI Ecore_Wl_Clipboard_State @@ -1802,13 +1800,12 @@ ecore_wl_window_keyboard_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int } EAPI void -ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Eina_Bool on) +ecore_wl_window_keyboard_state_set(Ecore_Wl_Window *win, Ecore_Wl_Virtual_Keyboard_State state) { LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!win) return; - if (on) win->keyboard.state = ECORE_WL_VIRTUAL_KEYBOARD_STATE_ON; - else if (!on) win->keyboard.state = ECORE_WL_VIRTUAL_KEYBOARD_STATE_OFF; + win->keyboard.state = state; } EAPI Ecore_Wl_Virtual_Keyboard_State -- 2.7.4