mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
inspector: Force a full redraw for debug nodes
Without this, debug nodes randomly are missing in the tree, where we are reusing older render nodes.
This commit is contained in:
parent
582e74737c
commit
61ad0147bd
@ -584,6 +584,31 @@ gtk_inspector_window_enable_debugging (GtkWindow *window,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
force_one_full_redraw (GtkWidget *w)
|
||||||
|
{
|
||||||
|
gtk_widget_queue_draw (w);
|
||||||
|
for (w = gtk_widget_get_first_child (w); w; w = gtk_widget_get_next_sibling (w))
|
||||||
|
force_one_full_redraw (w);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
force_full_redraw (GtkInspectorWindow *window)
|
||||||
|
{
|
||||||
|
GListModel *toplevels;
|
||||||
|
|
||||||
|
toplevels = gtk_window_get_toplevels ();
|
||||||
|
for (unsigned int i = 0; i < g_list_model_get_n_items (toplevels); i++)
|
||||||
|
{
|
||||||
|
GtkWidget *w = GTK_WIDGET (g_list_model_get_item (toplevels, i));
|
||||||
|
|
||||||
|
if (gtk_widget_get_display (w) == window->inspected_display)
|
||||||
|
force_one_full_redraw (w);
|
||||||
|
|
||||||
|
g_object_unref (w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
|
gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
|
||||||
{
|
{
|
||||||
@ -671,6 +696,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
|
|||||||
gtk_widget_class_bind_template_callback (widget_class, go_up_cb);
|
gtk_widget_class_bind_template_callback (widget_class, go_up_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, go_down_cb);
|
gtk_widget_class_bind_template_callback (widget_class, go_down_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, go_next_cb);
|
gtk_widget_class_bind_template_callback (widget_class, go_next_cb);
|
||||||
|
gtk_widget_class_bind_template_callback (widget_class, force_full_redraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkDisplay *
|
static GdkDisplay *
|
||||||
|
@ -618,7 +618,9 @@
|
|||||||
<property name="name">recorder</property>
|
<property name="name">recorder</property>
|
||||||
<property name="title" translatable="yes">Recorder</property>
|
<property name="title" translatable="yes">Recorder</property>
|
||||||
<property name="child">
|
<property name="child">
|
||||||
<object class="GtkInspectorRecorder" id="widget_recorder"/>
|
<object class="GtkInspectorRecorder" id="widget_recorder">
|
||||||
|
<signal name="notify::debug-nodes" handler="force_full_redraw" swapped='true'/>
|
||||||
|
</object>
|
||||||
</property>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
Loading…
Reference in New Issue
Block a user