Merge branch '4-workaround-missing-focused-field' into 'master'

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`.

Closes #4

See merge request hyask/swaysome!1
This commit is contained in:
Skia 2022-05-22 23:20:56 +00:00
commit 0d19f3f651

View file

@ -105,6 +105,7 @@ fn check_success(stream: &UnixStream) {
#[derive(Serialize, Deserialize)]
struct Output {
name: String,
#[serde(default)]
focused: bool,
active: bool,
}