Commit 5037d134 authored by Benjamin Otte's avatar Benjamin Otte

window: Only update the inspector once

Instead of queueing a new idle handler every time we call
gtk_window_update_debugging(), only queue one if none is queued that.

Saves a lot of work, in particular when templates create context menus
for every row in a large listbox as in the gtk-demo listbox example.
parent 207e5930
......@@ -12051,21 +12051,24 @@ warn_response (GtkDialog *dialog,
}
}
static guint gtk_window_update_debugging_id;
static gboolean
update_debugging (gpointer data)
{
gtk_inspector_window_rescan (inspector_window);
gtk_window_update_debugging_id = 0;
return G_SOURCE_REMOVE;
}
static void
gtk_window_update_debugging (void)
{
if (inspector_window)
if (inspector_window &&
gtk_window_update_debugging_id == 0)
{
guint id;
id = gdk_threads_add_idle (update_debugging, NULL);
g_source_set_name_by_id (id, "[gtk+] gtk_window_update_debugging");
gtk_window_update_debugging_id = gdk_threads_add_idle (update_debugging, NULL);
g_source_set_name_by_id (gtk_window_update_debugging_id, "[gtk+] gtk_window_update_debugging");
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment