Skip to content

Commit

Permalink
appearance under wayland: fix customizing themes
Browse files Browse the repository at this point in the history
Since wayland compositors such as wayfire follow the GNOME interface gsettings values, we need to set them here too
  • Loading branch information
lukefromdc committed Jun 5, 2024
1 parent 1e8c08e commit fc7ec90
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions capplets/appearance/appearance-style.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "theme-thumbnail.h"
#include "capplet-util.h"
#include "appearance-style.h"
#include <gdk/gdkx.h>

#define GSETTINGS_SETTINGS "GSETTINGS_SETTINGS"
#define GSETTINGS_KEY "GSETTINGS_KEY"
Expand Down Expand Up @@ -152,6 +153,31 @@ treeview_selection_changed_callback (GtkTreeSelection *selection, guint data)

if (list_value) {
g_settings_set_string (settings, key, list_value);

/*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)
{
GSettings *interface_gnome_settings = NULL;
interface_gnome_settings = g_settings_new_full (schema, NULL, NULL);

if ((strcmp (key, GTK_THEME_KEY) == 0) ||
(strcmp (key, ICON_THEME_KEY) == 0) ||
(strcmp (key, CURSOR_THEME_KEY) == 0) ||
(strcmp (key, CURSOR_SIZE_KEY) == 0))
g_settings_set_string (interface_gnome_settings, key, list_value);

}
}
}
}
}
}
}
Expand Down

0 comments on commit fc7ec90

Please sign in to comment.