From 9e2ed4104da71b0b9f9790095875c5e354e58c97 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 23 Jan 2019 18:31:55 +0100 Subject: [PATCH] wayland: Reset text-input state after commit This was wrongly done just before enable, which is not right as per the protocol. A side effect was that input purpose/hints were eagerly reset before being applied, thus not properly honored, noticed in the doing of emoji/numeric OSK panels. https://gitlab.gnome.org/GNOME/mutter/merge_requests/410 --- src/wayland/meta-wayland-text-input.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c index 7de9b91e2..c87f5a1e8 100644 --- a/src/wayland/meta-wayland-text-input.c +++ b/src/wayland/meta-wayland-text-input.c @@ -462,6 +462,7 @@ meta_wayland_text_input_reset (MetaWaylandTextInput *text_input) text_input->content_type_purpose = ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; text_input->text_change_cause = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD; text_input->cursor_rect = (cairo_rectangle_int_t) { 0, 0, 0, 0 }; + text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE; } static void @@ -485,8 +486,6 @@ text_input_commit_state (struct wl_client *client, if (text_input->enabled) { - meta_wayland_text_input_reset (text_input); - if (!clutter_input_focus_is_focused (focus)) { if (input_method) @@ -507,7 +506,10 @@ text_input_commit_state (struct wl_client *client, } if (!clutter_input_focus_is_focused (focus)) - return; + { + meta_wayland_text_input_reset (text_input); + return; + } if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE) { @@ -544,7 +546,7 @@ text_input_commit_state (struct wl_client *client, &cursor_rect); } - text_input->pending_state = META_WAYLAND_PENDING_STATE_NONE; + meta_wayland_text_input_reset (text_input); if (toggle_panel) clutter_input_focus_request_toggle_input_panel (focus);