diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index d6679bddd7..adc5367a9e 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -75,6 +75,7 @@ struct _WaylandIMContext uint32_t serial; uint32_t reset_serial; + uint32_t content_purpose; }; static unsigned int @@ -643,6 +644,10 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx) wl_text_input_show_input_panel(imcontext->text_input); wl_text_input_activate(imcontext->text_input, seat, ecore_wl_window_surface_get(imcontext->window)); + + wl_text_input_set_content_type(imcontext->text_input, + WL_TEXT_INPUT_CONTENT_HINT_NONE, + imcontext->content_purpose); } } @@ -813,6 +818,47 @@ wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int } } +EAPI void +wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout) +{ + WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); + + switch (layout) { + case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_URL: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_URL; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_IP: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATE; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD; + break; + case ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME; + break; + default: + imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL; + break; + } +} WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager) { diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.h b/src/modules/ecore_imf/wayland/wayland_imcontext.h index fb6906c2e8..111dd5f010 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.h +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.h @@ -60,6 +60,9 @@ EAPI void wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx, int width, int height); +EAPI void wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, + Ecore_IMF_Input_Panel_Layout layout); + WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager); extern int _ecore_imf_wayland_log_dom; diff --git a/src/modules/ecore_imf/wayland/wayland_module.c b/src/modules/ecore_imf/wayland/wayland_module.c index 13d09f257b..d189d6b59f 100644 --- a/src/modules/ecore_imf/wayland/wayland_module.c +++ b/src/modules/ecore_imf/wayland/wayland_module.c @@ -64,7 +64,7 @@ static Ecore_IMF_Context_Class wayland_imf_class = NULL, /* autocapital_type_set */ NULL, /* control panel show */ NULL, /* control panel hide */ - NULL, /* input_panel_layout_set */ + wayland_im_context_input_panel_layout_set, /* input_panel_layout_set */ NULL, /* input_panel_layout_get, */ NULL, /* input_panel_language_set, */ NULL, /* input_panel_language_get, */