summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkscreen-wayland.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2014-06-05 16:34:43 +0200
committerFlorian Müllner <fmuellner@gnome.org>2014-06-06 15:32:59 +0200
commitadd67b516cb6cbd9b36454d880dd2d7156eced19 (patch)
tree395a155fa1f93a41b908b26532a2ed13ea8506af /gdk/wayland/gdkscreen-wayland.c
parentf4c963ef749e8476414f29a128ff2028eece571f (diff)
downloadgtk+-add67b516cb6cbd9b36454d880dd2d7156eced19.tar.gz
wayland: Explicitly handle classic mode for now
There are plans to add session-dependent defaults to GSettings (based on the newly standardized XDG_CURRENT_DESKTOP); until then, the WM uses a different schema for its button-layout setting in classic mode. So for the time being, do the same and pick the alternative schema when XDG_CURRENT_DESKTOP indicates that we are in a classic session. (It's not pretty, but hopefully won't be with us for too long ...) https://bugzilla.gnome.org/show_bug.cgi?id=731273
Diffstat (limited to 'gdk/wayland/gdkscreen-wayland.c')
-rw-r--r--gdk/wayland/gdkscreen-wayland.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 261ac20167..16b54b86f5 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -482,6 +482,9 @@ update_xft_settings (GdkScreen *screen)
}
}
+#define WM_SETTINGS_SCHEMA "org.gnome.desktop.wm.preferences"
+#define CLASSIC_WM_SETTINGS_SCHEMA "org.gnome.shell.extensions.classic-overrides"
+
typedef struct _TranslationEntry TranslationEntry;
struct _TranslationEntry {
const gchar *schema;
@@ -513,7 +516,8 @@ static TranslationEntry translations[] = {
{ "org.gnome.desktop.sound", "input-feedback-sounds", "gtk-enable-input-feedback-sounds", G_TYPE_BOOLEAN, { . b = FALSE } },
{ "org.gnome.desktop.privacy", "recent-files-max-age", "gtk-recent-files-max-age", G_TYPE_INT, { .i = 30 } },
{ "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
- { "org.gnome.desktop.wm.preferences", "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
+ { WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
+ { CLASSIC_WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
@@ -690,9 +694,19 @@ set_decoration_layout_from_entry (GdkScreen *screen,
GValue *value)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GSettings *settings;
-
- settings = (GSettings *)g_hash_table_lookup (screen_wayland->settings, entry->schema);
+ GSettings *settings = NULL;
+ const char *session;
+
+ /* Hack: until we get session-dependent defaults in GSettings,
+ * swap out the usual schema for the "classic" one when
+ * running in classic mode
+ */
+ session = g_getenv ("XDG_CURRENT_DESKTOP");
+ if (session && strstr (session, "GNOME-Classic"))
+ settings = (GSettings *)g_hash_table_lookup (screen_wayland->settings, CLASSIC_WM_SETTINGS_SCHEMA);
+
+ if (settings == NULL)
+ settings = (GSettings *)g_hash_table_lookup (screen_wayland->settings, WM_SETTINGS_SCHEMA);
if (settings)
{