Enable use of GAMESCOPE_WAYLAND_DISPLAY

This commit is contained in:
Luke Jones
2025-02-02 20:02:51 +13:00
parent 5c2bcad7c6
commit dac35996b1
2 changed files with 8 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
use std::env::args;
use std::env::{self, args};
use std::path::{Path, PathBuf};
use std::process::exit;
use std::sync::{Arc, Mutex};
@@ -32,6 +32,12 @@ async fn main() -> Result<()> {
.format_timestamp(None)
.init();
// If we're running under gamescope we have to set WAYLAND_DISPLAY for winit to
// use
if let Ok(gamescope) = env::var("GAMESCOPE_WAYLAND_DISPLAY") {
env::set_var("WAYLAND_DISPLAY", gamescope);
}
// Try to open a proxy and check for app state first
{
let user_con = zbus::blocking::Connection::session()?;