[gtk/wip/otte/css: 302/307] css: Track the scale factor via the root
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/css: 302/307] css: Track the scale factor via the root
- Date: Tue, 18 Feb 2020 20:05:18 +0000 (UTC)
commit f81fce05c83623b184d943ba157d52359a35d003
Author: Benjamin Otte <otte redhat com>
Date: Sun Feb 9 23:12:40 2020 +0100
css: Track the scale factor via the root
As a side effect, we don't need to track the scale factor in
GtkStyleContext anymore, so remove that code, too.
docs/reference/gtk/gtk4-sections.txt | 2 --
gtk/gtkcssimageicontheme.c | 6 ++--
gtk/gtkcssimagerecolor.c | 8 +++--
gtk/gtkcssimagescaled.c | 8 +++--
gtk/gtkcssnode.c | 2 +-
gtk/gtkcsswidgetnode.c | 4 +--
gtk/gtksettings.c | 42 ++++++-----------------
gtk/gtksettingsprivate.h | 3 +-
gtk/gtkstylecascade.c | 32 -----------------
gtk/gtkstylecascadeprivate.h | 5 ---
gtk/gtkstylecontext.c | 66 ++++--------------------------------
gtk/gtkstylecontext.h | 6 ----
gtk/gtkstyleprovider.c | 15 --------
gtk/gtkstyleproviderprivate.h | 2 --
gtk/gtkwidget.c | 11 +-----
gtk/gtkwindow.c | 5 ++-
16 files changed, 40 insertions(+), 177 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index a7b1be5e5e..f617020a2a 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4591,8 +4591,6 @@ gtk_style_context_has_class
gtk_style_context_list_classes
gtk_style_context_set_display
gtk_style_context_set_state
-gtk_style_context_set_scale
-gtk_style_context_get_scale
GtkStyleContextPrintFlags
gtk_style_context_to_string
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c
index 520876847e..c384a715b1 100644
--- a/gtk/gtkcssimageicontheme.c
+++ b/gtk/gtkcssimageicontheme.c
@@ -23,11 +23,11 @@
#include <math.h>
+#include "gtkiconthemeprivate.h"
#include "gtkcssiconthemevalueprivate.h"
#include "gtksettingsprivate.h"
#include "gtksnapshot.h"
-#include "gtkstyleproviderprivate.h"
-#include "gtkiconthemeprivate.h"
+#include "gtkwidget.h"
G_DEFINE_TYPE (GtkCssImageIconTheme, _gtk_css_image_icon_theme, GTK_TYPE_CSS_IMAGE)
@@ -151,7 +151,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
copy = g_object_new (GTK_TYPE_CSS_IMAGE_ICON_THEME, NULL);
copy->name = g_strdup (icon_theme->name);
copy->icon_theme = gtk_css_icon_theme_value_get_icon_theme (style->core->icon_theme);
- copy->scale = gtk_style_provider_get_scale (provider);
+ copy->scale = root ? gtk_widget_get_scale_factor (root) : 1;
gtk_icon_theme_lookup_symbolic_colors (style, ©->color, ©->success, ©->warning, ©->error);
return GTK_CSS_IMAGE (copy);
diff --git a/gtk/gtkcssimagerecolor.c b/gtk/gtkcssimagerecolor.c
index 368b016f9d..faa1be0080 100644
--- a/gtk/gtkcssimagerecolor.c
+++ b/gtk/gtkcssimagerecolor.c
@@ -20,13 +20,14 @@
#include "config.h"
#include "gtkcssimagerecolorprivate.h"
+
#include "gtkcssimageprivate.h"
#include "gtkcsspalettevalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkiconthemeprivate.h"
#include "gdkpixbufutilsprivate.h"
-
#include "gtkstyleproviderprivate.h"
+#include "gtkwidget.h"
G_DEFINE_TYPE (GtkCssImageRecolor, _gtk_css_image_recolor, GTK_TYPE_CSS_IMAGE)
@@ -214,7 +215,10 @@ gtk_css_image_recolor_compute (GtkCssImage *image,
int scale;
GError *error = NULL;
- scale = gtk_style_provider_get_scale (provider);
+ if (root)
+ scale = gtk_widget_get_scale_factor (root);
+ else
+ scale = 1;
if (recolor->palette)
palette = gtk_css_value_compute (recolor->palette, property_id, provider, root, style, parent_style);
diff --git a/gtk/gtkcssimagescaled.c b/gtk/gtkcssimagescaled.c
index a6ca7fe1ce..fddbb80bee 100644
--- a/gtk/gtkcssimagescaled.c
+++ b/gtk/gtkcssimagescaled.c
@@ -21,7 +21,7 @@
#include "gtkcssimagescaledprivate.h"
-#include "gtkstyleproviderprivate.h"
+#include "gtkwidget.h"
G_DEFINE_TYPE (GtkCssImageScaled, _gtk_css_image_scaled, GTK_TYPE_CSS_IMAGE)
@@ -110,8 +110,10 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
int i;
int best;
- scale = gtk_style_provider_get_scale (provider);
- scale = MAX(scale, 1);
+ if (root)
+ scale = gtk_widget_get_scale_factor (root);
+ else
+ scale = 1;
best = 0;
for (i = 0; i < scaled->n_images; i++)
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 9e13e6c058..7ba92ffc25 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -1378,7 +1378,7 @@ gtk_css_node_get_style_provider (GtkCssNode *cssnode)
if (cssnode->parent)
return gtk_css_node_get_style_provider (cssnode->parent);
- return GTK_STYLE_PROVIDER (_gtk_settings_get_style_cascade (gtk_settings_get_default (), 1));
+ return GTK_STYLE_PROVIDER (gtk_settings_get_style_cascade (gtk_settings_get_default ()));
}
GtkWidget *
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c
index 6c49d044d5..f7f7b4cbbe 100644
--- a/gtk/gtkcsswidgetnode.c
+++ b/gtk/gtkcsswidgetnode.c
@@ -115,8 +115,8 @@ gtk_css_widget_node_get_style_provider (GtkCssNode *node)
if (context)
return gtk_style_context_get_style_provider (context);
- cascade = _gtk_settings_get_style_cascade (gtk_widget_get_settings (widget_node->widget),
- gtk_widget_get_scale_factor (widget_node->widget));
+ cascade = gtk_settings_get_style_cascade (gtk_widget_get_settings (widget_node->widget));
+
return GTK_STYLE_PROVIDER (cascade);
}
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index b92773a209..09f6cbf811 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -123,7 +123,7 @@ struct _GtkSettingsPrivate
GData *queued_settings; /* of type GtkSettingsValue* */
GtkSettingsPropertyValue *property_values;
GdkDisplay *display;
- GSList *style_cascades;
+ GtkStyleCascade *style_cascade;
GtkCssProvider *theme_provider;
gint font_size;
gboolean font_size_absolute;
@@ -253,7 +253,7 @@ gtk_settings_init (GtkSettings *settings)
g_datalist_init (&priv->queued_settings);
object_list = g_slist_prepend (object_list, settings);
- priv->style_cascades = g_slist_prepend (NULL, _gtk_style_cascade_new ());
+ priv->style_cascade = _gtk_style_cascade_new ();
priv->theme_provider = gtk_css_provider_new ();
/* build up property array for all yet existing properties and queue
@@ -978,7 +978,7 @@ gtk_settings_finalize (GObject *object)
g_datalist_clear (&priv->queued_settings);
settings_update_provider (priv->display, &priv->theme_provider, NULL);
- g_slist_free_full (priv->style_cascades, g_object_unref);
+ g_object_unref (priv->style_cascade);
if (priv->font_options)
cairo_font_options_destroy (priv->font_options);
@@ -989,33 +989,11 @@ gtk_settings_finalize (GObject *object)
}
GtkStyleCascade *
-_gtk_settings_get_style_cascade (GtkSettings *settings,
- gint scale)
+gtk_settings_get_style_cascade (GtkSettings *settings)
{
GtkSettingsPrivate *priv = gtk_settings_get_instance_private (settings);
- GtkStyleCascade *new_cascade;
- GSList *list;
-
- g_return_val_if_fail (GTK_IS_SETTINGS (settings), NULL);
-
- for (list = priv->style_cascades; list; list = list->next)
- {
- if (_gtk_style_cascade_get_scale (list->data) == scale)
- return list->data;
- }
-
- /* We are guaranteed to have the special cascade with scale == 1.
- * It's created in gtk_settings_init()
- */
- g_assert (scale != 1);
-
- new_cascade = _gtk_style_cascade_new ();
- _gtk_style_cascade_set_parent (new_cascade, _gtk_settings_get_style_cascade (settings, 1));
- _gtk_style_cascade_set_scale (new_cascade, scale);
-
- priv->style_cascades = g_slist_prepend (priv->style_cascades, new_cascade);
-
- return new_cascade;
+
+ return priv->style_cascade;
}
static void
@@ -1023,7 +1001,6 @@ settings_init_style (GtkSettings *settings)
{
GtkSettingsPrivate *priv = gtk_settings_get_instance_private (settings);
static GtkCssProvider *css_provider = NULL;
- GtkStyleCascade *cascade;
/* Add provider for user file */
if (G_UNLIKELY (!css_provider))
@@ -1043,12 +1020,13 @@ settings_init_style (GtkSettings *settings)
g_free (css_path);
}
- cascade = _gtk_settings_get_style_cascade (settings, 1);
- _gtk_style_cascade_add_provider (cascade,
+ priv->style_cascade = _gtk_style_cascade_new ();
+
+ _gtk_style_cascade_add_provider (priv->style_cascade,
GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
- _gtk_style_cascade_add_provider (cascade,
+ _gtk_style_cascade_add_provider (priv->style_cascade,
GTK_STYLE_PROVIDER (priv->theme_provider),
GTK_STYLE_PROVIDER_PRIORITY_SETTINGS);
diff --git a/gtk/gtksettingsprivate.h b/gtk/gtksettingsprivate.h
index 73a362a1be..d58b01d983 100644
--- a/gtk/gtksettingsprivate.h
+++ b/gtk/gtksettingsprivate.h
@@ -29,8 +29,7 @@ G_BEGIN_DECLS
const cairo_font_options_t *
gtk_settings_get_font_options (GtkSettings *settings);
GdkDisplay *_gtk_settings_get_display (GtkSettings *settings);
-GtkStyleCascade *_gtk_settings_get_style_cascade (GtkSettings *settings,
- gint scale);
+GtkStyleCascade *gtk_settings_get_style_cascade (GtkSettings *settings);
typedef enum
{
diff --git a/gtk/gtkstylecascade.c b/gtk/gtkstylecascade.c
index f3f57bd7f7..81d1b2ada9 100644
--- a/gtk/gtkstylecascade.c
+++ b/gtk/gtkstylecascade.c
@@ -121,14 +121,6 @@ gtk_style_cascade_get_color (GtkStyleProvider *provider,
return NULL;
}
-static int
-gtk_style_cascade_get_scale (GtkStyleProvider *provider)
-{
- GtkStyleCascade *cascade = GTK_STYLE_CASCADE (provider);
-
- return cascade->scale;
-}
-
static GtkCssKeyframes *
gtk_style_cascade_get_keyframes (GtkStyleProvider *provider,
const char *name)
@@ -182,7 +174,6 @@ static void
gtk_style_cascade_provider_iface_init (GtkStyleProviderInterface *iface)
{
iface->get_color = gtk_style_cascade_get_color;
- iface->get_scale = gtk_style_cascade_get_scale;
iface->get_keyframes = gtk_style_cascade_get_keyframes;
iface->lookup = gtk_style_cascade_lookup;
}
@@ -222,8 +213,6 @@ style_provider_data_clear (gpointer data_)
static void
_gtk_style_cascade_init (GtkStyleCascade *cascade)
{
- cascade->scale = 1;
-
cascade->providers = g_array_new (FALSE, FALSE, sizeof (GtkStyleProviderData));
g_array_set_clear_func (cascade->providers, style_provider_data_clear);
}
@@ -319,24 +308,3 @@ _gtk_style_cascade_remove_provider (GtkStyleCascade *cascade,
}
}
-void
-_gtk_style_cascade_set_scale (GtkStyleCascade *cascade,
- int scale)
-{
- gtk_internal_return_if_fail (GTK_IS_STYLE_CASCADE (cascade));
-
- if (cascade->scale == scale)
- return;
-
- cascade->scale = scale;
-
- gtk_style_provider_changed (GTK_STYLE_PROVIDER (cascade));
-}
-
-int
-_gtk_style_cascade_get_scale (GtkStyleCascade *cascade)
-{
- gtk_internal_return_val_if_fail (GTK_IS_STYLE_CASCADE (cascade), 1);
-
- return cascade->scale;
-}
diff --git a/gtk/gtkstylecascadeprivate.h b/gtk/gtkstylecascadeprivate.h
index ad2f7e69d0..61f3521829 100644
--- a/gtk/gtkstylecascadeprivate.h
+++ b/gtk/gtkstylecascadeprivate.h
@@ -39,7 +39,6 @@ struct _GtkStyleCascade
GtkStyleCascade *parent;
GArray *providers;
- int scale;
};
struct _GtkStyleCascadeClass
@@ -53,10 +52,6 @@ GtkStyleCascade * _gtk_style_cascade_new (void);
void _gtk_style_cascade_set_parent (GtkStyleCascade *cascade,
GtkStyleCascade *parent);
-void _gtk_style_cascade_set_scale (GtkStyleCascade *cascade,
- int scale);
-int _gtk_style_cascade_get_scale (GtkStyleCascade *cascade);
-
void _gtk_style_cascade_add_provider (GtkStyleCascade *cascade,
GtkStyleProvider *provider,
guint priority);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index c5dabf7b47..d12e67e997 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -213,7 +213,7 @@ gtk_style_context_init (GtkStyleContext *context)
g_error ("Can't create a GtkStyleContext without a display connection");
gtk_style_context_set_cascade (context,
- _gtk_settings_get_style_cascade (gtk_settings_get_for_display
(priv->display), 1));
+ gtk_settings_get_style_cascade (gtk_settings_get_for_display
(priv->display)));
}
static void
@@ -310,7 +310,7 @@ gtk_style_context_has_custom_cascade (GtkStyleContext *context)
GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
GtkSettings *settings = gtk_settings_get_for_display (priv->display);
- return priv->cascade != _gtk_settings_get_style_cascade (settings, _gtk_style_cascade_get_scale
(priv->cascade));
+ return priv->cascade != gtk_settings_get_style_cascade (settings);
}
GtkCssStyle *
@@ -380,9 +380,8 @@ gtk_style_context_add_provider (GtkStyleContext *context,
GtkStyleCascade *new_cascade;
new_cascade = _gtk_style_cascade_new ();
- _gtk_style_cascade_set_scale (new_cascade, _gtk_style_cascade_get_scale (priv->cascade));
_gtk_style_cascade_set_parent (new_cascade,
- _gtk_settings_get_style_cascade (gtk_settings_get_for_display
(priv->display), 1));
+ gtk_settings_get_style_cascade (gtk_settings_get_for_display
(priv->display)));
_gtk_style_cascade_add_provider (new_cascade, provider, priority);
gtk_style_context_set_cascade (context, new_cascade);
g_object_unref (new_cascade);
@@ -476,7 +475,7 @@ gtk_style_context_add_provider_for_display (GdkDisplay *display,
g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
g_return_if_fail (!GTK_IS_SETTINGS (provider) || _gtk_settings_get_display (GTK_SETTINGS (provider)) ==
display);
- cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1);
+ cascade = gtk_settings_get_style_cascade (gtk_settings_get_for_display (display));
_gtk_style_cascade_add_provider (cascade, provider, priority);
}
@@ -497,7 +496,7 @@ gtk_style_context_remove_provider_for_display (GdkDisplay *display,
g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
g_return_if_fail (!GTK_IS_SETTINGS (provider));
- cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1);
+ cascade = gtk_settings_get_style_cascade (gtk_settings_get_for_display (display));
_gtk_style_cascade_remove_provider (cascade, provider);
}
@@ -578,56 +577,6 @@ gtk_style_context_get_state (GtkStyleContext *context)
return gtk_css_node_get_state (priv->cssnode);
}
-/**
- * gtk_style_context_set_scale:
- * @context: a #GtkStyleContext
- * @scale: scale
- *
- * Sets the scale to use when getting image assets for the style.
- **/
-void
-gtk_style_context_set_scale (GtkStyleContext *context,
- gint scale)
-{
- GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
-
- g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-
- if (scale == _gtk_style_cascade_get_scale (priv->cascade))
- return;
-
- if (gtk_style_context_has_custom_cascade (context))
- {
- _gtk_style_cascade_set_scale (priv->cascade, scale);
- }
- else
- {
- GtkStyleCascade *new_cascade;
-
- new_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (priv->display),
- scale);
- gtk_style_context_set_cascade (context, new_cascade);
- }
-}
-
-/**
- * gtk_style_context_get_scale:
- * @context: a #GtkStyleContext
- *
- * Returns the scale used for assets.
- *
- * Returns: the scale
- **/
-gint
-gtk_style_context_get_scale (GtkStyleContext *context)
-{
- GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
-
- g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
-
- return _gtk_style_cascade_get_scale (priv->cascade);
-}
-
/*
* gtk_style_context_save_to_node:
* @context: a #GtkStyleContext
@@ -877,13 +826,12 @@ gtk_style_context_set_display (GtkStyleContext *context,
if (gtk_style_context_has_custom_cascade (context))
{
- display_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display), 1);
+ display_cascade = gtk_settings_get_style_cascade (gtk_settings_get_for_display (display));
_gtk_style_cascade_set_parent (priv->cascade, display_cascade);
}
else
{
- display_cascade = _gtk_settings_get_style_cascade (gtk_settings_get_for_display (display),
- _gtk_style_cascade_get_scale (priv->cascade));
+ display_cascade = gtk_settings_get_style_cascade (gtk_settings_get_for_display (display));
gtk_style_context_set_cascade (context, display_cascade);
}
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 551bee924e..851a78081d 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -859,12 +859,6 @@ void gtk_style_context_set_state (GtkStyleContext *context,
GDK_AVAILABLE_IN_ALL
GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
-GDK_AVAILABLE_IN_ALL
-void gtk_style_context_set_scale (GtkStyleContext *context,
- gint scale);
-GDK_AVAILABLE_IN_ALL
-gint gtk_style_context_get_scale (GtkStyleContext *context);
-
GDK_AVAILABLE_IN_ALL
GList * gtk_style_context_list_classes (GtkStyleContext *context);
diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c
index 6b6c6d2752..88d83a263f 100644
--- a/gtk/gtkstyleprovider.c
+++ b/gtk/gtkstyleprovider.c
@@ -123,21 +123,6 @@ gtk_style_provider_changed (GtkStyleProvider *provider)
g_signal_emit (provider, signals[CHANGED], 0);
}
-int
-gtk_style_provider_get_scale (GtkStyleProvider *provider)
-{
- GtkStyleProviderInterface *iface;
-
- gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), 1);
-
- iface = GTK_STYLE_PROVIDER_GET_INTERFACE (provider);
-
- if (!iface->get_scale)
- return 1;
-
- return iface->get_scale (provider);
-}
-
void
gtk_style_provider_emit_error (GtkStyleProvider *provider,
GtkCssSection *section,
diff --git a/gtk/gtkstyleproviderprivate.h b/gtk/gtkstyleproviderprivate.h
index a665ef81c2..8c8986ba5e 100644
--- a/gtk/gtkstyleproviderprivate.h
+++ b/gtk/gtkstyleproviderprivate.h
@@ -40,7 +40,6 @@ struct _GtkStyleProviderInterface
const char *name);
GtkCssKeyframes * (* get_keyframes) (GtkStyleProvider *provider,
const char *name);
- int (* get_scale) (GtkStyleProvider *provider);
void (* lookup) (GtkStyleProvider *provider,
const GtkCountingBloomFilter *filter,
GtkCssNode *node,
@@ -57,7 +56,6 @@ GtkCssValue * gtk_style_provider_get_color (GtkStyleProvid
const char *name);
GtkCssKeyframes * gtk_style_provider_get_keyframes (GtkStyleProvider *provider,
const char *name);
-int gtk_style_provider_get_scale (GtkStyleProvider *provider);
void gtk_style_provider_lookup (GtkStyleProvider *provider,
const GtkCountingBloomFilter *filter,
GtkCssNode *node,
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f7ecb1e042..becb58469a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3556,9 +3556,7 @@ gtk_widget_realize (GtkWidget *widget)
gtk_widget_update_alpha (widget);
- if (priv->context)
- gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
- else
+ if (!priv->context)
gtk_widget_get_style_context (widget);
gtk_widget_pop_verify_invariants (widget);
@@ -6847,13 +6845,8 @@ gtk_widget_get_child_visible (GtkWidget *widget)
void
_gtk_widget_scale_changed (GtkWidget *widget)
{
- GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (priv->context)
- gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
-
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_SCALE_FACTOR]);
gtk_widget_forall (widget, (GtkCallback)_gtk_widget_scale_changed, NULL);
@@ -11238,8 +11231,6 @@ gtk_widget_get_style_context (GtkWidget *widget)
priv->context = gtk_style_context_new_for_node (priv->cssnode);
- gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
-
display = _gtk_widget_get_display (widget);
if (display)
gtk_style_context_set_display (priv->context, display);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 37836d360f..4c66c92809 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5216,7 +5216,10 @@ check_scale_changed (GtkWindow *window)
old_scale = priv->scale;
priv->scale = gtk_widget_get_scale_factor (widget);
if (old_scale != priv->scale)
- _gtk_widget_scale_changed (widget);
+ {
+ gtk_css_node_invalidate (gtk_widget_get_css_node (widget), GTK_CSS_CHANGE_ROOT);
+ _gtk_widget_scale_changed (widget);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]