feat: add gamescope force-grab-cursor flag
This commit is contained in:
parent
fe514ad8ac
commit
b03b5ca9a3
1 changed files with 13 additions and 3 deletions
|
@ -25,7 +25,8 @@ pub struct Gamescope {
|
||||||
pub integer_scaling: bool,
|
pub integer_scaling: bool,
|
||||||
pub fsr: bool,
|
pub fsr: bool,
|
||||||
pub nis: bool,
|
pub nis: bool,
|
||||||
pub window_type: WindowType
|
pub window_type: WindowType,
|
||||||
|
pub force_grab_cursor: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Gamescope {
|
impl Default for Gamescope {
|
||||||
|
@ -39,7 +40,8 @@ impl Default for Gamescope {
|
||||||
integer_scaling: true,
|
integer_scaling: true,
|
||||||
fsr: false,
|
fsr: false,
|
||||||
nis: false,
|
nis: false,
|
||||||
window_type: WindowType::default()
|
window_type: WindowType::default(),
|
||||||
|
force_grab_cursor: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +81,11 @@ impl From<&JsonValue> for Gamescope {
|
||||||
|
|
||||||
window_type: value.get("window_type")
|
window_type: value.get("window_type")
|
||||||
.map(WindowType::from)
|
.map(WindowType::from)
|
||||||
.unwrap_or(default.window_type)
|
.unwrap_or(default.window_type),
|
||||||
|
|
||||||
|
force_grab_cursor: value.get("force_grab_cursor")
|
||||||
|
.and_then(JsonValue::as_bool)
|
||||||
|
.unwrap_or(default.force_grab_cursor),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,6 +179,10 @@ impl Gamescope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.force_grab_cursor {
|
||||||
|
gamescope += " --force-grab-cursor"
|
||||||
|
}
|
||||||
|
|
||||||
Some(gamescope)
|
Some(gamescope)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue