From 82e9e07511912d701247baa88b5964e5767da2d3 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 18 Sep 2020 14:47:22 +0900 Subject: [PATCH] Add more logs for wayland protocol debugging Change-Id: I64b1eb8a6f6efc56a2f243d1e21693d5115827f9 Signed-off-by: Jihoon Kim --- ism/extras/wayland_immodule/wayland_imcontext.c | 10 ++++++--- .../panelagent/wayland/isf_wsc_control_ui.cpp | 2 ++ .../wayland/wayland_panel_agent_module.cpp | 25 ++++++++++++++++------ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index bfe30fc..b24333e 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -1396,12 +1396,11 @@ commit_preedit(WaylandIMContext *imcontext) static Eina_Bool set_focus(Ecore_IMF_Context *ctx) { - LOGD("ctx : %p", ctx); WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); if (!imcontext) return EINA_FALSE; if (!imcontext->window) { - LOGW("window is not given"); + LOGW("ctx : %p, window is not given", ctx); return EINA_FALSE; } @@ -1427,6 +1426,7 @@ set_focus(Ecore_IMF_Context *ctx) imcontext->input = input; _focused_ctx = ctx; + LOGD("ctx : %p, activate wl_text_input : %p", ctx, imcontext->text_input); wl_text_input_activate(imcontext->text_input, seat, ecore_wl2_window_surface_get(imcontext->window)); @@ -1476,6 +1476,7 @@ set_focus_out(Ecore_IMF_Context *ctx) } } + LOGD("deactivate wl_text_input : %p", imcontext->text_input); // deactivate if (imcontext->text_input) wl_text_input_deactivate(imcontext->text_input, @@ -2999,8 +3000,11 @@ wayland_im_context_del (Ecore_IMF_Context *ctx) imcontext->mime_type = NULL; } - if (imcontext->text_input) + if (imcontext->text_input) { + LOGD("destroy wl_text_input : %p", imcontext->text_input); wl_text_input_destroy (imcontext->text_input); + imcontext->text_input = NULL; + } clear_preedit (imcontext); diff --git a/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp b/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp index 63875ec..711836d 100644 --- a/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp +++ b/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp @@ -202,6 +202,8 @@ void isf_wsc_context_input_panel_show (WSCContextISF* wsc_ctx) void isf_wsc_context_input_panel_hide (WSCContextISF *ctx) { int context_id = _get_context_id (ctx); + LOGD ("ctx : %p", ctx); + _isf_wsc_context_input_panel_hide (get_panel_client_id (), context_id); } diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index f9e171a..1b23206 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -751,6 +751,7 @@ wl_im_destroy () #endif if (wsc_ctx->im_ctx) { + LOGD("destroy wl_input_method_context : %p", wsc_ctx->im_ctx); wl_input_method_context_destroy (wsc_ctx->im_ctx); wsc_ctx->im_ctx = NULL; } @@ -804,8 +805,10 @@ _wsc_im_activate (void *data, struct wl_input_method *input_method, struct wl_in return; } - if (_need_wl_im_init) + if (_need_wl_im_init) { + LOGD("destroy wl_input_method_context"); wl_im_destroy (); + } #if ENABLE_GRAB_KEYBOARD wsc_ctx->xkb_context = xkb_context_new ((xkb_context_flags)0); @@ -825,7 +828,7 @@ _wsc_im_activate (void *data, struct wl_input_method *input_method, struct wl_in wsc_ctx->surrounding_text = NULL; wsc_ctx->remote_surrounding_text = NULL; wsc_ctx->surrounding_cursor = 0; - LOGD ("wsc_ctx->surrounding_cursor = %d", wsc_ctx->surrounding_cursor); + LOGD("inputmethod : %p, im context : %p, surrounding_cursor = %d", input_method, im_ctx, wsc_ctx->surrounding_cursor); wsc_ctx->preedit_str = strdup (""); wsc_ctx->content_hint = WL_TEXT_INPUT_CONTENT_HINT_NONE; @@ -857,6 +860,8 @@ _wsc_im_deactivate (void *data, struct wl_input_method *input_method, struct wl_ struct weescim *wsc = (weescim*)data; if (!wsc || !wsc->wsc_ctx) return; + LOGD("inputmethod : %p, im ctx : %p, focus out : %d", input_method, im_ctx, focus_out_event); + /* When the focus_in/input_panel_shutdown event is called, * it is not possible to know the information of wl_input_method to destroy */ _wl_im_ctx->wsc = wsc; @@ -877,6 +882,8 @@ _wsc_im_destroy (void *data, struct wl_input_method *input_method, struct wl_inp struct weescim *wsc = (weescim*)data; if (!wsc || !wsc->wsc_ctx) return; + LOGD("inputmethod : %p, im ctx : %p", input_method, im_ctx); + _wl_im_ctx->wsc = wsc; _wl_im_ctx->input_method = input_method; _wl_im_ctx->im_ctx = im_ctx; @@ -903,6 +910,8 @@ _wsc_im_hide_input_panel (void *data, struct wl_input_method *input_method, stru struct weescim *wsc = (weescim*)data; if (!wsc || !wsc->wsc_ctx) return; + LOGD("inputmethod : %p, im ctx : %p", input_method, im_ctx); + isf_wsc_context_input_panel_hide (wsc->wsc_ctx); } @@ -1244,7 +1253,7 @@ void isf_wsc_context_add (WSCContextISF *wsc_ctx) { SCIM_DEBUG_FRONTEND (1) << __FUNCTION__ << "...\n"; - LOGD (""); + WSCContextISF* context_scim = wsc_ctx; if (!context_scim) return; @@ -1261,6 +1270,8 @@ isf_wsc_context_add (WSCContextISF *wsc_ctx) return; } + LOGD ("ctx impl : %p", context_scim->impl); + context_scim->impl->preedit_caret = 0; context_scim->impl->cursor_x = 0; context_scim->impl->cursor_y = 0; @@ -1288,13 +1299,13 @@ void isf_wsc_context_del (WSCContextISF *wsc_ctx) { SCIM_DEBUG_FRONTEND (1) << __FUNCTION__ << "...\n"; - LOGD (""); - if (!_ic_list) return; WSCContextISF *context_scim = wsc_ctx; if (!context_scim) return; + LOGD ("ctx impl : %p", context_scim->impl); + if (context_scim->selection_text_fd_read_handler) { int fd = ecore_main_fd_handler_fd_get (context_scim->selection_text_fd_read_handler); if (fd >= 0) @@ -2971,8 +2982,10 @@ public: } void stop (void) { - if (_need_wl_im_init) + if (_need_wl_im_init) { + LOGD("destroy wl_input_method_context"); wl_im_destroy (); + } if (_wl_im_ctx) { delete _wl_im_ctx; -- 2.7.4