summaryrefslogtreecommitdiff
path: root/capplets/appearance/appearance-main.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2024-03-27 19:40:18 -0400
committerlukefromdc <[email protected]>2024-05-26 14:00:01 -0400
commit1e8c08e51ea38d5faec5f352ea5d00c565a0a63d (patch)
treefc966c761e2a4c78bf42dc24103aaca73ff2c02c /capplets/appearance/appearance-main.c
parentcf67b6a462ceeaddea84130789fa5e73fe598fdd (diff)
downloadmate-control-center-1e8c08e51ea38d5faec5f352ea5d00c565a0a63d.tar.bz2
mate-control-center-1e8c08e51ea38d5faec5f352ea5d00c565a0a63d.tar.xz
appearance in wayland: Support changing theme, icon theme, and fonts
*If we are in a wayland session, write the gtk theme and icon theme to both org.mate and org.gnome *This changes wayland and xwayland themes simultaniously *Under wayland, set the application and document fonts for both MATE and GNOME *Otherwise some applications will ignore font changes set from the appearance capplet *Only load GNOME interface gsettings when running under wayland *fail gracefully if the gnome interface schema is not present *Do not depend on it but use it if it is present to allow setting themes in compositors such as wayfire that use the GNOME gsettings values
Diffstat (limited to 'capplets/appearance/appearance-main.c')
-rw-r--r--capplets/appearance/appearance-main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c
index 2a9b92eb..8e19c02b 100644
--- a/capplets/appearance/appearance-main.c
+++ b/capplets/appearance/appearance-main.c
@@ -31,6 +31,7 @@
#include "theme-thumbnail.h"
#include "activate-settings-daemon.h"
#include "capplet-util.h"
+#include <gdk/gdkx.h>
static AppearanceData *
init_appearance_data (int *argc, char ***argv, GOptionContext *context)
@@ -56,6 +57,21 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
data->filechooser_settings = g_settings_new (FILECHOOSER_SCHEMA);
data->interface_settings = g_settings_new (INTERFACE_SCHEMA);
+
+ data->interface_gnome_settings = NULL;
+ /*Load the gnome interface schema if we are running under wayland and it is present*/
+ if (!(GDK_IS_X11_DISPLAY (gdk_display_get_default())))
+ {
+ GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
+
+ if (source)
+ {
+ GSettingsSchema *schema = g_settings_schema_source_lookup (source, INTERFACE_GNOME_SCHEMA, TRUE);
+
+ if (schema)
+ data->interface_gnome_settings = g_settings_new_full (schema, NULL, NULL);
+ }
+ }
data->marco_settings = g_settings_new (MARCO_SCHEMA);
data->mouse_settings = g_settings_new (MOUSE_SCHEMA);
data->font_settings = g_settings_new (FONT_RENDER_SCHEMA);