summaryrefslogtreecommitdiff
path: root/gtk/gtktooltip.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-12-30 09:52:13 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-12-30 09:52:13 -0500
commit772ac2b0c587b9bd0927d339550341a547b70057 (patch)
tree388abbc03e9371b94511968fedbd3186759379aa /gtk/gtktooltip.c
parent68b3b66c03804b15b8ed80970abfa7f3b3bff0d6 (diff)
downloadgtk+-772ac2b0c587b9bd0927d339550341a547b70057.tar.gz
tooltip: Never set a window to be its own parent
We do get events on the tooltip window too, and we better ignore them, or bad things may happen, such as widgets that are their own parents and cause infinite loops. Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2339
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r--gtk/gtktooltip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 88cf89651d..1112e6a374 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -495,6 +495,9 @@ gtk_tooltip_set_surface (GtkTooltip *tooltip,
if (tooltip->native == native)
return;
+ if (GTK_IS_TOOLTIP_WINDOW (native))
+ return;
+
if (tooltip->native)
g_object_weak_unref (G_OBJECT (tooltip->native), native_weak_notify, tooltip);