static TOOLBAR_MODE_T kbd_mode = TOOLBAR_HELPER_MODE;
WSCContextISF *input_panel_ctx = NULL;
static bool _support_hw_keyboard_mode = false;
-static Ecore_IMF_Input_Panel_Layout _prev_input_panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
static int _get_context_id (WSCContextISF *ctx)
{
}
void
-isf_wsc_context_input_panel_layout_set (WSCContextISF *ctx, Ecore_IMF_Input_Panel_Layout layout, Eina_Bool ctx_changed)
+isf_wsc_context_input_panel_layout_set (WSCContextISF *ctx, Ecore_IMF_Input_Panel_Layout layout)
{
WSCContextISF *context_scim = ctx;
if (context_scim == get_focused_ic ()) {
- if (!ctx_changed && _prev_input_panel_layout == layout)
- return;
-
LOGD ("layout type : %d\n", layout);
- _prev_input_panel_layout = layout;
_isf_wsc_context_input_panel_layout_set (_get_context_id (ctx), layout);
}
}
void isf_wsc_context_input_panel_show (WSCContextISF *ctx);
void isf_wsc_context_input_panel_hide (WSCContextISF *ctx);
void isf_wsc_context_input_panel_language_set (WSCContextISF *ctx, Ecore_IMF_Input_Panel_Lang lang);
- void isf_wsc_context_input_panel_layout_set (WSCContextISF *ctx, Ecore_IMF_Input_Panel_Layout layout, Eina_Bool ctx_changed);
+ void isf_wsc_context_input_panel_layout_set (WSCContextISF *ctx, Ecore_IMF_Input_Panel_Layout layout);
Ecore_IMF_Input_Panel_Layout isf_wsc_context_input_panel_layout_get (WSCContextISF *ctx);
void isf_wsc_context_input_panel_caps_mode_set (WSCContextISF *ctx, unsigned int mode);
void isf_wsc_context_input_panel_caps_lock_mode_set (WSCContextISF *ctx, Eina_Bool mode);
static ConfigPointer _config;
static WSCContextISF *_focused_ic = 0;
-static WSCContextISF *_prev_layout_set_ic = 0;
static bool _scim_initialized = false;
static void
_wsc_im_ctx_content_type (void *data, struct wl_input_method_context *im_ctx, uint32_t hint, uint32_t purpose)
{
- Eina_Bool ctx_changed = EINA_FALSE;
WSCContextISF *wsc_ctx = (WSCContextISF*)data;
if (!wsc_ctx) return;
- LOGD ("im_context = %p hint = %d purpose = %d\n", im_ctx, hint, purpose);
+ LOGD ("im_context = %p hint = %04x purpose = %d\n", im_ctx, hint, purpose);
- wsc_ctx->content_hint = hint;
- wsc_ctx->content_purpose = purpose;
+ // Set layout
+ if (wsc_ctx->content_purpose != purpose) {
+ wsc_ctx->content_purpose = purpose;
+ isf_wsc_context_input_panel_layout_set (wsc_ctx, wsc_context_input_panel_layout_get (wsc_ctx));
+ }
+
+ if (wsc_ctx->content_hint != hint) {
+ uint32_t hint_copy, old_hintbit, new_hintbit;
+ const uint32_t autocap_type = WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION |
+ WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE |
+ WL_TEXT_INPUT_CONTENT_HINT_WORD_CAPITALIZATION;
- ctx_changed = (_prev_layout_set_ic == wsc_ctx ? EINA_FALSE : EINA_TRUE);
- isf_wsc_context_input_panel_layout_set (wsc_ctx,
- wsc_context_input_panel_layout_get (wsc_ctx), ctx_changed);
- _prev_layout_set_ic = wsc_ctx;
+ hint_copy = wsc_ctx->content_hint;
+ wsc_ctx->content_hint = hint;
- g_info_manager->set_prediction_allow (WAYLAND_MODULE_CLIENT_ID,
- wsc_context_prediction_allow_get (wsc_ctx));
+ // Set prediction allow
+ old_hintbit = hint_copy & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION;
+ new_hintbit = hint & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION;
+ if (old_hintbit != new_hintbit) {
+ g_info_manager->set_prediction_allow (WAYLAND_MODULE_CLIENT_ID, wsc_context_prediction_allow_get (wsc_ctx));
+ }
- isf_wsc_context_autocapital_type_set (wsc_ctx, wsc_context_autocapital_type_get (wsc_ctx));
+ // Set autocapital type
+ old_hintbit = hint_copy & autocap_type;
+ new_hintbit = hint & autocap_type;
+ if (old_hintbit != new_hintbit) {
+ isf_wsc_context_autocapital_type_set (wsc_ctx, wsc_context_autocapital_type_get (wsc_ctx));
+ }
+
+ // Set language
+ old_hintbit = hint_copy & WL_TEXT_INPUT_CONTENT_HINT_LATIN;
+ new_hintbit = hint & WL_TEXT_INPUT_CONTENT_HINT_LATIN;
+ if (old_hintbit != new_hintbit) {
+ isf_wsc_context_input_panel_language_set (wsc_ctx, wsc_context_input_panel_language_get (wsc_ctx));
+ }
+ }
- isf_wsc_context_input_panel_language_set (wsc_ctx, wsc_context_input_panel_language_get (wsc_ctx));
#if ENABLE_REMOTE_INPUT
isf_wsc_context_send_entry_metadata (wsc_ctx, wsc_context_input_hint_get (wsc_ctx), wsc_context_input_panel_layout_get (wsc_ctx),
wsc_context_input_panel_layout_variation_get (wsc_ctx), wsc_context_autocapital_type_get (wsc_ctx), wsc_ctx->return_key_disabled);