diff options
author | Benjamin Otte <otte@redhat.com> | 2023-03-06 00:13:53 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-03-06 00:13:53 +0100 |
commit | 46552269075be2094e8ace17ee16c2d9f4743f8c (patch) | |
tree | 277decd97d5dbf5537de96ce96ed313bcda8fa6b /gtk/inspector | |
parent | 0fa1e71ef0c01a1e09993c3e6c368fd8eba15e66 (diff) | |
download | gtk+-46552269075be2094e8ace17ee16c2d9f4743f8c.tar.gz |
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.
Diffstat (limited to 'gtk/inspector')
-rw-r--r-- | gtk/inspector/object-tree.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 * |