Impose a limit on the size of IMEs to avoid client being fully obscured 68/144768/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 18 Aug 2017 01:19:00 +0000 (10:19 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 18 Aug 2017 04:43:45 +0000 (13:43 +0900)
Change-Id: Iff67f63e851fd0d774a47d804b2f858453175a76

src/legacy_support/websocket.cpp

index 4a01f12..20841ab 100644 (file)
 
 #define WEBSOCKET_PORT 7681
 
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#endif
+
 pthread_t g_ws_server_thread = (pthread_t)NULL;
 pthread_mutex_t g_ws_server_mutex = PTHREAD_MUTEX_INITIALIZER;
 
@@ -1141,6 +1145,23 @@ void CWebHelperAgentWebSocket::handle_recved_message(ISE_MESSAGE &message)
 
             LOGD("ISE_MESSAGE_COMMAND_SET_KEYBOARD_SIZES : %d %d %d %d",
                 portrait_width, portrait_height, landscape_width, landscape_height);
+
+#ifdef WAYLAND
+            /* Since the full screen IME makes the client application fully obscured,
+             * when it hides the client receives resume command and try to show IME again.
+             * So here we are adjusting the height value when the requested keyboard size
+             * is the same with the screen size, as a workaround */
+            int scr_w = 0, scr_h = 0;
+            ecore_wl_sync();
+            ecore_wl_screen_size_get(&scr_w, &scr_h);
+            if (scr_w == portrait_width && scr_h == portrait_height) {
+                portrait_height -= 1;
+            }
+            if (scr_h == landscape_width && scr_w == landscape_height) {
+                landscape_height -= 1;
+            }
+#endif
+
             set_keyboard_sizes(
                 portrait_width, portrait_height, landscape_width, landscape_height);
         }