aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 55fc032f..51ff0a5e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -69,8 +69,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
if cli.session {
// If we're starting as a session, assume that the intention is to start on a TTY. Remove
- // DISPLAY or WAYLAND_DISPLAY from our environment if they are set, since they will cause
- // the winit backend to be selected instead.
+ // DISPLAY, WAYLAND_DISPLAY or WAYLAND_SOCKET from our environment if they are set, since
+ // they will cause the winit backend to be selected instead.
if env::var_os("DISPLAY").is_some() {
warn!("running as a session but DISPLAY is set, removing it");
env::remove_var("DISPLAY");
@@ -79,6 +79,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
warn!("running as a session but WAYLAND_DISPLAY is set, removing it");
env::remove_var("WAYLAND_DISPLAY");
}
+ if env::var_os("WAYLAND_SOCKET").is_some() {
+ warn!("running as a session but WAYLAND_SOCKET is set, removing it");
+ env::remove_var("WAYLAND_SOCKET");
+ }
// Set the current desktop for xdg-desktop-portal.
env::set_var("XDG_CURRENT_DESKTOP", "niri");