elm_conform: fix condition for recalculating vkbd area. 41/64641/5 accepted/tizen/common/20160408.185631 accepted/tizen/ivi/20160411.005020 accepted/tizen/mobile/20160411.005002 accepted/tizen/tv/20160411.004917 accepted/tizen/wearable/20160411.004950 submit/tizen/20160408.074339
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 4 Apr 2016 09:37:27 +0000 (18:37 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Fri, 8 Apr 2016 07:41:05 +0000 (00:41 -0700)
Vkbd geometry is not (0, 0, 0, 0), when vkbd is hidden in Wayland.

@tizen_fix

Signed-off-by: Hosang Kim <hosang12.kim@samsung.com>
Change-Id: Icc481af1580d735480d69410391b8072fdbf46da

src/lib/elm_conform.c

index 1a804dd..7d90f13 100644 (file)
@@ -221,8 +221,9 @@ _conformant_part_sizing_eval(Evas_Object *obj,
 #endif
 //
         DBG("[KEYPAD]: size(%d,%d, %dx%d).", sx, sy, sw, sh);
-        _conformant_part_size_hints_set
-          (obj, sd->virtualkeypad, sx, sy, sw, sh);
+        if (sd->virtualkeypad)
+          _conformant_part_size_hints_set
+             (obj, sd->virtualkeypad, sx, sy, sw, sh);
      }
 
    if (part_type & ELM_CONFORMANT_SOFTKEY_PART)
@@ -238,7 +239,8 @@ _conformant_part_sizing_eval(Evas_Object *obj,
                sx = sy = sw = sh = 0;
           }
 #endif
-        _conformant_part_size_hints_set(obj, sd->softkey, sx, sy, sw, sh);
+        if (sd->softkey)
+          _conformant_part_size_hints_set(obj, sd->softkey, sx, sy, sw, sh);
      }
    if (part_type & ELM_CONFORMANT_CLIPBOARD_PART)
      {
@@ -253,7 +255,8 @@ _conformant_part_sizing_eval(Evas_Object *obj,
                sx = sy = sw = sh = 0;
           }
 #endif
-        _conformant_part_size_hints_set(obj, sd->clipboard, sx, sy, sw, sh);
+        if (sd->clipboard)
+          _conformant_part_size_hints_set(obj, sd->clipboard, sx, sy, sw, sh);
      }
 }
 
@@ -699,12 +702,17 @@ _move_resize_cb(void *data EINA_UNUSED,
                 void *event_info EINA_UNUSED)
 {
    Conformant_Part_Type part_type;
+   ELM_CONFORMANT_DATA_GET(obj, sd);
+   Elm_Win_Keyboard_Mode mode;
 
    part_type = (ELM_CONFORMANT_INDICATOR_PART |
                 ELM_CONFORMANT_SOFTKEY_PART |
-                ELM_CONFORMANT_VIRTUAL_KEYPAD_PART |
                 ELM_CONFORMANT_CLIPBOARD_PART);
 
+   mode = elm_win_keyboard_mode_get(sd->win);
+   if (mode == ELM_WIN_KEYBOARD_ON)
+     part_type |= ELM_CONFORMANT_VIRTUAL_KEYPAD_PART;
+
    _conformant_part_sizing_eval(obj, part_type);
 }
 
@@ -944,10 +952,10 @@ _on_conformant_changed(void *data,
    /* object is already freed */
    if (!sd) return;
 
+   mode = elm_win_keyboard_mode_get(obj);
+
    if (property & CONFORMANT_KEYBOARD_STATE)
      {
-        mode = elm_win_keyboard_mode_get(obj);
-
         if (mode == ELM_WIN_KEYBOARD_ON)
           {
              _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
@@ -960,13 +968,13 @@ _on_conformant_changed(void *data,
           {
              evas_object_size_hint_min_set(sd->virtualkeypad, -1, 0);
              evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
-             _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
              elm_widget_display_mode_set(data, EVAS_DISPLAY_MODE_NONE);
              eo_do(data, eo_event_callback_call(
                    ELM_CONFORMANT_EVENT_VIRTUALKEYPAD_STATE_OFF, NULL));
           }
      }
-   if (property & CONFORMANT_KEYBOARD_GEOMETRY)
+   if ((property & CONFORMANT_KEYBOARD_GEOMETRY) &&
+       (mode == ELM_WIN_KEYBOARD_ON))
      {
         _conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
      }