ecore_wayland: fix ecore_wl_window_keyboard_state_set() 65/54865/5
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 18 Dec 2015 08:54:56 +0000 (17:54 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Wed, 23 Dec 2015 08:31:46 +0000 (17:31 +0900)
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
src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_window.c

index 2263663..8132b2c 100644 (file)
@@ -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);
index fbf3d68..e7d6608 100644 (file)
@@ -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;
           }
      }
index a24a2cd..f85f2d0 100644 (file)
@@ -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