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.
This commit is contained in:
Benjamin Otte 2023-03-06 00:13:53 +01:00
parent 0fa1e71ef0
commit 4655226907

View File

@ -1131,11 +1131,19 @@ toplevel_filter_func (gpointer item,
gpointer data) gpointer data)
{ {
GdkDisplay *display = data; GdkDisplay *display = data;
gpointer iw;
if (!GTK_IS_WINDOW (item)) if (!GTK_IS_WINDOW (item))
return FALSE; 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 * static GListModel *