[mutter/wip/carlosg/text-input-fixes: 2/2] wayland: Avoid clutter_input_focus method calls when unfocused



commit 6934b83f44ad31ff19bd81d663065bf983a842ff
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Feb 11 22:04:30 2018 +0100

    wayland: Avoid clutter_input_focus method calls when unfocused
    
    If text_input_enable() is called when there no active IM (eg. running plain
    mutter), some ClutterInputFocus method calls that are not allowed while
    unfocused will end up called, triggering critical warnings.
    
    If there is no IM return early here, all other calls are superfluous then.

 src/wayland/meta-wayland-text-input.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
index 798b3d2a9..63c11462d 100644
--- a/src/wayland/meta-wayland-text-input.c
+++ b/src/wayland/meta-wayland-text-input.c
@@ -301,6 +301,8 @@ text_input_enable (struct wl_client   *client,
       input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
       if (input_method)
         clutter_input_method_focus_in (input_method, focus);
+      else
+        return;
     }
 
   show_preedit = (flags & GTK_TEXT_INPUT_ENABLE_FLAGS_CAN_SHOW_PREEDIT) != 0;


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