Gamescope::is_legacy_version true by default. Comments fixes

This commit is contained in:
Ilia Malakhov 2023-07-29 00:36:27 +02:00
parent 4e47114090
commit 18744481b3

View file

@ -97,14 +97,14 @@ impl From<&JsonValue> for Gamescope {
impl Gamescope { impl Gamescope {
fn is_legacy_version() -> bool { fn is_legacy_version() -> bool {
// gamescope doesn't have --version, so parsing --help // gamescope doesn't have --version, so parsing --help instead
match Command::new("/usr/bin/gamescope").arg("--help").output() { match Command::new("/usr/bin/gamescope").arg("--help").output() {
Err(_) => false, Err(_) => true,
Ok(output) => String::from_utf8(output.stderr) Ok(output) => String::from_utf8(output.stderr)
.unwrap_or_default() .unwrap_or_default()
.lines() .lines()
.find(|s| s.contains("-F, --filter")) .find(|s| s.contains("-F, --filter"))
.is_none() // if no --filter, then it's old version .is_none() // if no --filter, then it's legacy version
} }
} }