Merge pull request #10 from gfiroozeh/main
feat: add gamescope force-grab-cursor flag
This commit is contained in:
commit
4ea1a6a320
1 changed files with 13 additions and 3 deletions
|
@ -25,7 +25,8 @@ pub struct Gamescope {
|
|||
pub integer_scaling: bool,
|
||||
pub fsr: bool,
|
||||
pub nis: bool,
|
||||
pub window_type: WindowType
|
||||
pub window_type: WindowType,
|
||||
pub force_grab_cursor: bool,
|
||||
}
|
||||
|
||||
impl Default for Gamescope {
|
||||
|
@ -39,7 +40,8 @@ impl Default for Gamescope {
|
|||
integer_scaling: true,
|
||||
fsr: 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")
|
||||
.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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue