summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-04-02 22:24:19 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-04-02 22:24:19 -0400
commit91bcf6f0ba49a94c568b5a172c3e03a5081c6a89 (patch)
treee72c1e980a45d15dd497f91a426a3670a776a644
parenta228b2de64d50a205e069c6ba6559d5b7e9599d7 (diff)
downloadgtk+-91bcf6f0ba49a94c568b5a172c3e03a5081c6a89.tar.gz
immulticontext: Unset client widget on delegate change
Forgetting to do so was causing the Wayland im context to leave behind a dead event controller. This was showing up as a crash when closing the inspector after changing the im-module property of a GtkText widget. The crash was delayed until closing the inspector because the inspector keeps a ref on the event controllers of the currently shown widget.
-rw-r--r--gtk/gtkimmulticontext.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index 40b80d42d4..f26f1dd05c 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -205,6 +205,9 @@ gtk_im_multicontext_set_delegate (GtkIMMulticontext *multicontext,
gtk_im_multicontext_delete_surrounding_cb,
multicontext);
+ if (priv->client_widget)
+ gtk_im_context_set_client_widget (priv->delegate, NULL);
+
g_object_unref (priv->delegate);
priv->delegate = NULL;