mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-02 17:00:19 +00:00
inspector: Do not show transient nodes
This is kind of a hack the way it's implemented, but it's necessary for performance to ignore transient nodes as they get created all the time (via gtk_style_context_save()) and invalidate the whole treeview. And that causes resizes and redrawing of the treeview and performance of the inspector would go down the drain now that we display a larger part of the node tree.
This commit is contained in:
parent
81de33e906
commit
7cdfee71da
@ -18,6 +18,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gtktreemodelcssnode.h"
|
#include "gtktreemodelcssnode.h"
|
||||||
|
#include "gtk/gtkcsstransientnodeprivate.h"
|
||||||
|
|
||||||
struct _GtkTreeModelCssNodePrivate
|
struct _GtkTreeModelCssNodePrivate
|
||||||
{
|
{
|
||||||
@ -471,6 +472,9 @@ gtk_tree_model_css_node_connect_node (GtkTreeModelCssNode *model,
|
|||||||
{
|
{
|
||||||
GtkCssNode *child;
|
GtkCssNode *child;
|
||||||
|
|
||||||
|
if (GTK_IS_CSS_TRANSIENT_NODE (node))
|
||||||
|
return;
|
||||||
|
|
||||||
g_object_ref (node);
|
g_object_ref (node);
|
||||||
|
|
||||||
g_signal_connect_after (node, "node-added", G_CALLBACK (child_added_cb), model);
|
g_signal_connect_after (node, "node-added", G_CALLBACK (child_added_cb), model);
|
||||||
@ -520,6 +524,9 @@ gtk_tree_model_css_node_disconnect_node (GtkTreeModelCssNode *model,
|
|||||||
{
|
{
|
||||||
GtkCssNode *child;
|
GtkCssNode *child;
|
||||||
|
|
||||||
|
if (GTK_IS_CSS_TRANSIENT_NODE (node))
|
||||||
|
return;
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (child_added_cb), model);
|
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (child_added_cb), model);
|
||||||
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (child_removed_cb), model);
|
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (child_removed_cb), model);
|
||||||
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (notify_cb), model);
|
g_signal_handlers_disconnect_by_func (node, G_CALLBACK (notify_cb), model);
|
||||||
|
Loading…
Reference in New Issue
Block a user