From 6934b83f44ad31ff19bd81d663065bf983a842ff Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 11 Feb 2018 22:04:30 +0100 Subject: [PATCH] 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;