Skip to content

Commit

Permalink
input_capture: Fix parsing of Zones
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Dec 18, 2023
1 parent aadd680 commit 55bfbea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/desktop/input_capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl ZonesChanged {

/// A region of a [`Zones`].
#[derive(Debug, Clone, Copy, Deserialize, Type)]
#[zvariant(signature = "uuii")]
#[zvariant(signature = "(uuii)")]
pub struct Region(u32, u32, i32, i32);

impl Region {
Expand All @@ -192,19 +192,22 @@ impl Region {
}

/// A response of [`InputCapture::zones`].
#[derive(Debug, Type, Deserialize)]
#[zvariant(signature = "a(uuii)u")]
pub struct Zones(Vec<Region>, u32);
#[derive(Debug, Type, DeserializeDict)]
#[zvariant(signature = "dict")]
pub struct Zones {
zones: Vec<Region>,
zone_set: u32,
}

impl Zones {
/// A list of regions.
pub fn regions(&self) -> &[Region] {
&self.0
&self.zones
}

/// A unique ID to be used in [`InputCapture::set_pointer_barriers`].
pub fn zone_set(&self) -> u32 {
self.1
self.zone_set
}
}

Expand Down

0 comments on commit 55bfbea

Please sign in to comment.