[mutter] wayland/text-input: Ignore text-input state commit when not focused



commit 49fea735aa6e8ca70927c69c15bc9615d8f0f3b2
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Oct 23 14:13:33 2018 +0200

    wayland/text-input: Ignore text-input state commit when not focused
    
    We might unset focus, or already be out of focus (e.g. an X11 client or
    clutter text entry is focused) when a text-input state is committed by
    the client. We handled this before, except when text input was
    explicitly disabled by the client, the Wayland text-input was in focus
    by the input method, and it focused itself out.
    
    Simplify the logic a bit by just dropping the state on the floor in all
    cases where after any potential focus changes were done, we are not
    focused.
    
    Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/353

 src/wayland/meta-wayland-text-input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index 868143021..5bf06e2e0 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -503,7 +503,8 @@ text_input_commit_state (struct wl_client   *client,
           clutter_input_method_focus_out (input_method);
         }
     }
-  else if (!clutter_input_focus_is_focused (focus))
+
+  if (!clutter_input_focus_is_focused (focus))
     return;
 
   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]