diff options
author | Victor Kareh <[email protected]> | 2018-05-25 22:54:26 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-05-31 11:00:49 +0200 |
commit | 0034a564167dff8d5e487c9a3842a07cef4c9ede (patch) | |
tree | c4be0ac9127e0fc9729778c4d22edb02695ec074 /plugins/xsettings/msd-xsettings-manager.c | |
parent | 01b8f126e7199c3baa11110e44862c65280c9414 (diff) | |
download | mate-settings-daemon-0034a564167dff8d5e487c9a3842a07cef4c9ede.tar.bz2 mate-settings-daemon-0034a564167dff8d5e487c9a3842a07cef4c9ede.tar.xz |
Make setting QT_SCALE_FACTOR optional.
When enabling org.mate.interface window-scaling-factor-qt-sync (default), m-s-d will attempt to set QT_SCALE_FACTOR during the init phase.
When disabled, the user can then choose to control this env var elsewhere.
Diffstat (limited to 'plugins/xsettings/msd-xsettings-manager.c')
-rw-r--r-- | plugins/xsettings/msd-xsettings-manager.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c index e1005ef..05822e9 100644 --- a/plugins/xsettings/msd-xsettings-manager.c +++ b/plugins/xsettings/msd-xsettings-manager.c @@ -54,6 +54,7 @@ #define CURSOR_THEME_KEY "cursor-theme" #define CURSOR_SIZE_KEY "cursor-size" #define SCALING_FACTOR_KEY "window-scaling-factor" +#define SCALING_FACTOR_QT_KEY "window-scaling-factor-qt-sync" #define FONT_RENDER_SCHEMA "org.mate.font-rendering" #define FONT_ANTIALIASING_KEY "antialiasing" @@ -525,14 +526,18 @@ scale_change_workarounds (MateXSettingsManager *manager, int new_scale) /* This is only useful during the Initialization phase, so we guard against * unnecessarily attempting to set it later. */ if (!manager->priv->window_scale) { - /* Set env variables to properly scale QT applications */ - if (!update_user_env_variable ("QT_AUTO_SCREEN_SCALE_FACTOR", "0", &error)) { - g_warning ("There was a problem when setting QT_AUTO_SCREEN_SCALE_FACTOR=0: %s", error->message); - g_clear_error (&error); - } - if (!update_user_env_variable ("QT_SCALE_FACTOR", new_scale == 2 ? "2" : "1", &error)) { - g_warning ("There was a problem when setting QT_SCALE_FACTOR=%d: %s", new_scale, error->message); - g_clear_error (&error); + GSettings *gsettings; + gsettings = g_hash_table_lookup (manager->priv->gsettings, INTERFACE_SCHEMA); + /* If enabled, set env variables to properly scale QT applications */ + if (g_settings_get_boolean (gsettings, SCALING_FACTOR_QT_KEY)) { + if (!update_user_env_variable ("QT_AUTO_SCREEN_SCALE_FACTOR", "0", &error)) { + g_warning ("There was a problem when setting QT_AUTO_SCREEN_SCALE_FACTOR=0: %s", error->message); + g_clear_error (&error); + } + if (!update_user_env_variable ("QT_SCALE_FACTOR", new_scale == 2 ? "2" : "1", &error)) { + g_warning ("There was a problem when setting QT_SCALE_FACTOR=%d: %s", new_scale, error->message); + g_clear_error (&error); + } } } else { /* Restart marco */ |