From 46552269075be2094e8ace17ee16c2d9f4743f8c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 6 Mar 2023 00:13:53 +0100 Subject: [PATCH] inspector: Make really sure we don't inspect ourselves The problem here is that new windows appear in the list before the window's dispay gets set and we don't update the filter when the display changes (would need watches support for the filtermodel). So add this somewhat hacky method. --- gtk/inspector/object-tree.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c index a7920b9875..0c0c9e28ab 100644 --- a/gtk/inspector/object-tree.c +++ b/gtk/inspector/object-tree.c @@ -1131,11 +1131,19 @@ toplevel_filter_func (gpointer item, gpointer data) { GdkDisplay *display = data; + gpointer iw; if (!GTK_IS_WINDOW (item)) return FALSE; - return gtk_widget_get_display (item) == display; + if (gtk_widget_get_display (item) != display) + return FALSE; + + iw = g_object_get_data (G_OBJECT (display), "-gtk-inspector"); + if (iw == item) + return FALSE; + + return TRUE; } static GListModel * -- 2.30.2