Added temporary solution for custom conformant 87/98487/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 15 Nov 2016 12:00:43 +0000 (21:00 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 17 Nov 2016 10:52:11 +0000 (02:52 -0800)
Change-Id: I01f8bb534ae09757c85f5150599678eacac002bd

ism/extras/wayland_immodule/wayland_imcontext.c

index bc622b9..c2cd1af 100644 (file)
@@ -106,6 +106,7 @@ static Ecore_IMF_Input_Panel_State _input_panel_state    = ECORE_IMF_INPUT_PANEL
 static Ecore_Event_Handler *_win_focus_out_handler       = NULL;
 static Ecore_Event_Handler *_conformant_change_handler   = NULL;
 
+static Eina_Bool             _custom_conformant_event     = EINA_FALSE;
 static Eina_Bool             _received_will_hide_event    = EINA_FALSE;
 static Eina_Bool             _conformant_reset_done       = EINA_FALSE;
 static Evas                 *_active_context_canvas       = NULL;
@@ -1359,7 +1360,7 @@ static Eina_Bool _conformant_change_cb(void *data, int ev_type, void *ev)
     if (!(e->state)) {
         LOGD("_conformant_reset_done = 0, registering _render_post_cb : %p %p\n", _active_context_canvas, window);
         _conformant_reset_done = EINA_FALSE;
-        if (_active_context_canvas && ecore_wl_window_conformant_get(window)) {
+        if (_active_context_canvas && ecore_wl_window_conformant_get(window) && !_custom_conformant_event) {
             evas_event_callback_add(_active_context_canvas, EVAS_CALLBACK_RENDER_POST, _render_post_cb, ctx);
         }
     } else {
@@ -3060,6 +3061,29 @@ wayland_im_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *da
     WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
     if (!imcontext) return;
 
+    if (data && length > 0) {
+        const char *custom_conformant_enabled = "conformant:custom,enabled";
+        const char *custom_conformant_disabled = "conformant:custom,disabled";
+        const char *custom_conformant_finished = "conformant:custom,finished";
+
+        if(strncmp(data, custom_conformant_enabled, strlen(custom_conformant_enabled)) == 0) {
+            _custom_conformant_event = EINA_TRUE;
+            return;
+        }
+        if(strncmp(data, custom_conformant_disabled, strlen(custom_conformant_disabled)) == 0) {
+            _custom_conformant_event = EINA_FALSE;
+            return;
+        }
+        if(strncmp(data, custom_conformant_finished, strlen(custom_conformant_finished)) == 0) {
+            if (_custom_conformant_event) {
+                _conformant_reset_done = EINA_TRUE;
+                LOGD("[conformant:custom,finished], _conformant_reset_done = 1\n");
+                send_will_hide_ack(NULL);
+            }
+            return;
+        }
+    }
+
     if (imcontext->imdata)
         free(imcontext->imdata);