From: Benjamin Otte Date: Sun, 5 Mar 2023 23:13:53 +0000 (+0100) Subject: inspector: Make really sure we don't inspect ourselves X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~5^2~57^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=46552269075be2094e8ace17ee16c2d9f4743f8c;p=gtk4.git 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. --- 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 *