[gtk/gtk-4-2: 12/91] immulticontext: Unset client widget on delegate change
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 12/91] immulticontext: Unset client widget on delegate change
- Date: Tue, 4 May 2021 02:05:40 +0000 (UTC)
commit 3c4c7896fc81a92634818c7ebb3ad9d84f62e2d5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Apr 2 22:24:19 2021 -0400
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.
gtk/gtkimmulticontext.c | 3 +++
1 file changed, 3 insertions(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]