mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
Fix #4: Add workaround for missing focused property in outputs
If there is an inactive input, then the `focused` property may be missing in sway's response to a `get_output` message. This fix uses a feature of serde where default values for missing fields can be defined. Here, the `Default::default` for booleans is used, which is `false`.
This commit is contained in:
parent
06eb9d29c2
commit
2497f0519f
1 changed files with 1 additions and 0 deletions
|
|
@ -105,6 +105,7 @@ fn check_success(stream: &UnixStream) {
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
struct Output {
|
struct Output {
|
||||||
name: String,
|
name: String,
|
||||||
|
#[serde(default)]
|
||||||
focused: bool,
|
focused: bool,
|
||||||
active: bool,
|
active: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue