xwayland: Expose DISPLAY variable to clients
This commit is contained in:
parent
51f53aa899
commit
e5f4911bb6
3 changed files with 23 additions and 2 deletions
|
|
@ -77,6 +77,9 @@ pub fn setup_socket(handle: LoopHandle<Data>, state: &State) -> Result<()> {
|
|||
.into_string()
|
||||
.map_err(|_| anyhow!("wayland socket is no valid utf-8 string?"))?,
|
||||
);
|
||||
if let Some(display) = state.common.xwayland_state.values().find_map(|s| s.display) {
|
||||
env.insert(String::from("DISPLAY"), format!(":{}", display));
|
||||
}
|
||||
let message = serde_json::to_string(&Message::SetEnv { variables: env })
|
||||
.with_context(|| "Failed to encode environment variables into json")?;
|
||||
let bytes = message.into_bytes();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue