diff --git a/xfce4-session/main.c b/xfce4-session/main.c index 75e3a02e..726b09e8 100644 --- a/xfce4-session/main.c +++ b/xfce4-session/main.c @@ -89,6 +89,7 @@ static void setup_environment (void) { const gchar *lang; + const gchar *dname; const gchar *sm; gchar *authfile; int fd; @@ -106,7 +107,10 @@ setup_environment (void) xfsm_enable_verbose (); /* pass correct DISPLAY to children, in case of --display in argv */ - g_setenv ("DISPLAY", gdk_display_get_name (gdk_display_get_default ()), TRUE); + dname = gdk_display_get_name (gdk_display_get_default ()); + if (g_strcmp0 (dname, "Wayland") == 0) + dname = g_getenv ("DISPLAY"); + g_setenv ("DISPLAY", dname, TRUE); /* this is for compatibility with the GNOME Display Manager */ lang = g_getenv ("GDM_LANG");