widget: Get opacity without GtkStyleContext
authorTimm Bäder <mail@baedert.org>
Thu, 16 Jan 2020 12:17:35 +0000 (13:17 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 18 Jan 2020 07:49:52 +0000 (08:49 +0100)
GtkStyleContext is really just unnecessary here.

gtk/gtkwidget.c

index 2744ba6c90edab51553284f7a5a1321b24b8cc50..77cdb6b8da90e13483cc2a6b077dc1277ce721ce 100644 (file)
@@ -10830,15 +10830,14 @@ static void
 gtk_widget_update_alpha (GtkWidget *widget)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-  GtkStyleContext *context;
   gdouble opacity;
   guint8 alpha;
 
-  context = _gtk_widget_get_style_context (widget);
-  opacity =
-    _gtk_css_number_value_get (_gtk_style_context_peek_property (context,
-                                                                 GTK_CSS_PROPERTY_OPACITY),
-                               100);
+  opacity = _gtk_css_number_value_get (gtk_css_style_get_value (gtk_css_node_get_style (priv->cssnode),
+                                                                GTK_CSS_PROPERTY_OPACITY),
+                                       100);
+
+
   opacity = CLAMP (opacity, 0.0, 1.0);
   alpha = round (priv->user_alpha * opacity);