[gtk] Force-create style contexts in realize



commit 97ec29d3f55d214c0b394a438feab77b2553ee5a
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 13 21:14:01 2020 -0500

    Force-create style contexts in realize
    
    This is necessary as long as style contexts are
    required for proper css change tracking.
    
    Fixes #2435

 gtk/gtkwidget.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 9f8876beb5..36baa66c3d 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3539,6 +3539,8 @@ gtk_widget_realize (GtkWidget *widget)
 
       if (priv->context)
        gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
+      else
+        gtk_widget_get_style_context (widget);
 
       gtk_widget_pop_verify_invariants (widget);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]