summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2022-07-06 18:31:37 +0200
committerBastien Nocera <hadess@hadess.net>2022-07-13 11:34:11 +0000
commitc960ce46125f819379fe659883dafa0087d24fe3 (patch)
tree1ca1b9738ee5218d67c44d79b500cdaaae3c3283
parent5e1202c3d37ce05622992251c116b54ffa6875c3 (diff)
downloadgnome-settings-daemon-c960ce46125f819379fe659883dafa0087d24fe3.tar.gz
plugins: Unset GDK_BACKEND envvar if a specific backend is needed
This currently affects only the xsettings plugin, which needs GDK to use the x11 backend. It already calls gdk_set_allowed_backends ("x11") for this purpose; however, if GDK_BACKEND=wayland (or any other non-x11 backend possibly) happened to be in the environment, GDK would fail to initialize at all. This would prevent the xsettings plugin from starting up. Big thanks to Olivier Fourdan for figuring this out! Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2022283 Bug: https://bugs.debian.org/1008992
-rw-r--r--plugins/common/daemon-skeleton-gtk.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/common/daemon-skeleton-gtk.h b/plugins/common/daemon-skeleton-gtk.h
index 596281df..4e67706e 100644
--- a/plugins/common/daemon-skeleton-gtk.h
+++ b/plugins/common/daemon-skeleton-gtk.h
@@ -229,6 +229,9 @@ main (int argc, char **argv)
}
gdk_set_allowed_backends (GDK_BACKEND);
+
+ /* GDK would fail to initialize with e.g. GDK_BACKEND=wayland */
+ g_unsetenv ("GDK_BACKEND");
#endif
error = NULL;