aboutsummaryrefslogtreecommitdiff
path: root/src/utils/spawning.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-06-04 08:26:51 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-06-07 13:12:50 -0700
commitf918eabe6a144e78c62c3fc0cfa7fe32e4623e5a (patch)
tree5ed62d6eb939ef5e84f1114dfa08fe289800df8f /src/utils/spawning.rs
parent0698f167e51c38bd6d50e73983a13a62d2f8eefe (diff)
downloadniri-f918eabe6a144e78c62c3fc0cfa7fe32e4623e5a.tar.gz
niri-f918eabe6a144e78c62c3fc0cfa7fe32e4623e5a.tar.bz2
niri-f918eabe6a144e78c62c3fc0cfa7fe32e4623e5a.zip
Implement xwayland-satellite integration
Diffstat (limited to 'src/utils/spawning.rs')
-rw-r--r--src/utils/spawning.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/spawning.rs b/src/utils/spawning.rs
index 286df68f..0e118785 100644
--- a/src/utils/spawning.rs
+++ b/src/utils/spawning.rs
@@ -16,6 +16,7 @@ use crate::utils::expand_home;
pub static REMOVE_ENV_RUST_BACKTRACE: AtomicBool = AtomicBool::new(false);
pub static REMOVE_ENV_RUST_LIB_BACKTRACE: AtomicBool = AtomicBool::new(false);
pub static CHILD_ENV: RwLock<Environment> = RwLock::new(Environment(Vec::new()));
+pub static CHILD_DISPLAY: RwLock<Option<String>> = RwLock::new(None);
static ORIGINAL_NOFILE_RLIMIT_CUR: Atomic<rlim_t> = Atomic::new(0);
static ORIGINAL_NOFILE_RLIMIT_MAX: Atomic<rlim_t> = Atomic::new(0);
@@ -116,6 +117,14 @@ fn spawn_sync(
process.env_remove("RUST_LIB_BACKTRACE");
}
+ // Set DISPLAY if needed.
+ let display = CHILD_DISPLAY.read().unwrap();
+ if let Some(display) = &*display {
+ process.env("DISPLAY", display);
+ } else {
+ process.env_remove("DISPLAY");
+ }
+
// Set configured environment.
let env = CHILD_ENV.read().unwrap();
for var in &env.0 {