From dac35996b161f902bd91f4f8a7e231b01cd6303b Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Sun, 2 Feb 2025 20:02:51 +1300 Subject: [PATCH] Enable use of GAMESCOPE_WAYLAND_DISPLAY --- rog-control-center/src/main.rs | 8 +++++++- rog-control-center/translations/en/rog-control-center.po | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 106b5dbc..cf115d51 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -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()?; diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index d937833f..23478974 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-02-01 07:27+0000\n" +"POT-Creation-Date: 2025-02-01 07:31+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"