diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-23 15:12:38 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-23 15:12:38 -0500 |
commit | f9e613f8fda4cf835e7273e1bb4edbcce1776b26 (patch) | |
tree | 12bb76069b135631d8cdf12878d3631e995de768 /gtk/gtktext.c | |
parent | e13692c52f70aa1a16b0ba7d93e3d956b3e46de6 (diff) | |
download | gtk+-f9e613f8fda4cf835e7273e1bb4edbcce1776b26.tar.gz |
text: Don't compute invisible char in init
This causes us to create a pango layout and
validate the css style, a high-overhead
operation. Just do it when the entry is set
to be invisible.
Diffstat (limited to 'gtk/gtktext.c')
-rw-r--r-- | gtk/gtktext.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 45b9b3c82c..4227578b43 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -1726,6 +1726,7 @@ gtk_text_init (GtkText *self) priv->xalign = 0.0; priv->insert_pos = -1; priv->cursor_alpha = 1.0; + priv->invisible_char = 0; priv->history = gtk_text_history_new (&history_funcs, self); gtk_text_history_set_max_undo_levels (priv->history, DEFAULT_MAX_UNDO); @@ -1756,8 +1757,6 @@ gtk_text_init (GtkText *self) g_signal_connect (priv->im_context, "delete-surrounding", G_CALLBACK (gtk_text_delete_surrounding_cb), self); - gtk_text_update_cached_style_values (self); - priv->drag_gesture = gtk_gesture_drag_new (); g_signal_connect (priv->drag_gesture, "drag-update", G_CALLBACK (gtk_text_drag_gesture_update), self); @@ -5425,6 +5424,7 @@ gtk_text_set_visibility (GtkText *self, priv->visible = visible; g_object_notify (G_OBJECT (self), "visibility"); + gtk_text_update_cached_style_values (self); gtk_text_recompute (self); /* disable undo when invisible text is used */ |