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);
+#if 0
wsc_ctx->content_hint = hint;
wsc_ctx->content_purpose = purpose;
isf_wsc_context_autocapital_type_set (wsc_ctx, wsc_context_autocapital_type_get (wsc_ctx));
isf_wsc_context_input_panel_language_set (wsc_ctx, wsc_context_input_panel_language_get (wsc_ctx));
+#else
+ 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 old_hintbit, new_hintbit;
+
+ old_hintbit = wsc_ctx->content_hint & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION;
+ new_hintbit = hint & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION;
+ if (old_hintbit != new_hintbit) {
+ wsc_ctx->content_hint ^= new_hintbit;
+ g_info_manager->set_prediction_allow (WAYLAND_MODULE_CLIENT_ID, wsc_context_prediction_allow_get (wsc_ctx));
+ }
+
+ old_hintbit = wsc_ctx->content_hint & (WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION | WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE | WL_TEXT_INPUT_CONTENT_HINT_WORD_CAPITALIZATION);
+ new_hintbit = hint & (WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION | WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE | WL_TEXT_INPUT_CONTENT_HINT_WORD_CAPITALIZATION);
+ if (old_hintbit != new_hintbit) {
+ wsc_ctx->content_hint ^= new_hintbit;
+ isf_wsc_context_autocapital_type_set (wsc_ctx, wsc_context_autocapital_type_get (wsc_ctx));
+ }
+
+ old_hintbit = wsc_ctx->content_hint & WL_TEXT_INPUT_CONTENT_HINT_LATIN;
+ new_hintbit = hint & WL_TEXT_INPUT_CONTENT_HINT_LATIN;
+ if (old_hintbit != new_hintbit) {
+ wsc_ctx->content_hint ^= new_hintbit;
+ isf_wsc_context_input_panel_language_set (wsc_ctx, wsc_context_input_panel_language_get (wsc_ctx));
+ }
+
+ wsc_ctx->content_hint = hint;
+ }
+#endif
+
#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);