diff --git a/clutter/clutter-settings-private.h b/clutter/clutter-settings-private.h index 0e1c463f9..244122c1f 100644 --- a/clutter/clutter-settings-private.h +++ b/clutter/clutter-settings-private.h @@ -11,6 +11,10 @@ void _clutter_settings_set_backend (ClutterSettings *settings, void _clutter_settings_read_from_key_file (ClutterSettings *settings, GKeyFile *key_file); +void clutter_settings_set_property_internal (ClutterSettings *settings, + const char *property, + GValue *value); + G_END_DECLS #endif /* __CLUTTER_SETTINGS_PRIVATE_H__ */ diff --git a/clutter/clutter-settings.c b/clutter/clutter-settings.c index 7b0032978..a269c3a89 100644 --- a/clutter/clutter-settings.c +++ b/clutter/clutter-settings.c @@ -355,7 +355,10 @@ clutter_settings_set_property (GObject *gobject, case PROP_WINDOW_SCALING_FACTOR: if (!self->fixed_scaling_factor) - self->window_scaling_factor = g_value_get_int (value); + { + self->window_scaling_factor = g_value_get_int (value); + self->fixed_scaling_factor = TRUE; + } break; case PROP_UNSCALED_FONT_DPI: @@ -369,6 +372,24 @@ clutter_settings_set_property (GObject *gobject, } } +void +clutter_settings_set_property_internal (ClutterSettings *self, + const char *property, + GValue *value) +{ + + property = g_intern_string (property); + + if (property == I_("window-scaling-factor") && + self->fixed_scaling_factor) + return; + + g_object_set_property (G_OBJECT (self), property, value); + + if (property == I_("window-scaling-factor")) + self->fixed_scaling_factor = FALSE; +} + static void clutter_settings_get_property (GObject *gobject, guint prop_id, diff --git a/clutter/gdk/clutter-backend-gdk.c b/clutter/gdk/clutter-backend-gdk.c index 7a719aa0b..7f14feb6e 100644 --- a/clutter/gdk/clutter-backend-gdk.c +++ b/clutter/gdk/clutter-backend-gdk.c @@ -65,6 +65,7 @@ #include "clutter-event-private.h" #include "clutter-main.h" #include "clutter-private.h" +#include "clutter-settings-private.h" #define clutter_backend_gdk_get_type _clutter_backend_gdk_get_type G_DEFINE_TYPE (ClutterBackendGdk, clutter_backend_gdk, CLUTTER_TYPE_BACKEND); @@ -88,9 +89,9 @@ clutter_backend_gdk_init_settings (ClutterBackendGdk *backend_gdk) gdk_screen_get_setting (backend_gdk->screen, CLUTTER_SETTING_GDK_NAME(i), &val); - g_object_set_property (G_OBJECT (settings), - CLUTTER_SETTING_PROPERTY(i), - &val); + clutter_settings_set_property_internal (settings, + CLUTTER_SETTING_PROPERTY (i), + &val); g_value_unset (&val); } } @@ -112,9 +113,9 @@ _clutter_backend_gdk_update_setting (ClutterBackendGdk *backend_gdk, gdk_screen_get_setting (backend_gdk->screen, CLUTTER_SETTING_GDK_NAME (i), &val); - g_object_set_property (G_OBJECT (settings), - CLUTTER_SETTING_PROPERTY (i), - &val); + clutter_settings_set_property_internal (settings, + CLUTTER_SETTING_PROPERTY (i), + &val); g_value_unset (&val); break; diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 5e5d50658..c9478c405 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -63,6 +63,7 @@ #include "clutter-event-private.h" #include "clutter-main.h" #include "clutter-private.h" +#include "clutter-settings-private.h" #define clutter_backend_x11_get_type _clutter_backend_x11_get_type @@ -203,9 +204,9 @@ clutter_backend_x11_xsettings_notify (const char *name, CLUTTER_SETTING_X11_NAME (i), CLUTTER_SETTING_PROPERTY (i)); - g_object_set_property (G_OBJECT (settings), - CLUTTER_SETTING_PROPERTY (i), - &value); + clutter_settings_set_property_internal (settings, + CLUTTER_SETTING_PROPERTY (i), + &value); g_value_unset (&value);