From 46b3d21fca3e5997da390c25ed697c27476656e9 Mon Sep 17 00:00:00 2001 From: Nova Date: Wed, 4 Jan 2023 08:25:54 -0500 Subject: [PATCH] fix(wayland): toplevel states bytemucked to u8 --- src/wayland/panel_item.rs | 13 ++++++++++--- src/wayland/xdg_shell.rs | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wayland/panel_item.rs b/src/wayland/panel_item.rs index 3ee5e24..cfc96d1 100644 --- a/src/wayland/panel_item.rs +++ b/src/wayland/panel_item.rs @@ -78,7 +78,7 @@ pub struct ToplevelState { pub size: Vector2, pub max_size: Option>, pub min_size: Option>, - pub states: Vec, + pub states: Vec, #[serde(skip_serializing)] pub queued_state: Option>, } @@ -524,7 +524,7 @@ impl PanelItem { #[derive(Debug, Deserialize)] struct ConfigureToplevelInfo { size: Option>, - states: Vec, + states: Vec, bounds: Option>, } @@ -538,7 +538,14 @@ impl PanelItem { } } let size = info.size.unwrap_or(Vector2::from([0; 2])); - xdg_toplevel.configure(size.x as i32, size.y as i32, info.states); + xdg_toplevel.configure( + size.x as i32, + size.y as i32, + info.states + .into_iter() + .flat_map(|state| state.to_ne_bytes()) + .collect::>(), + ); xdg_surface.configure(SERIAL_COUNTER.inc()); core_surface.flush_clients(); diff --git a/src/wayland/xdg_shell.rs b/src/wayland/xdg_shell.rs index 7127cd9..152b72c 100644 --- a/src/wayland/xdg_shell.rs +++ b/src/wayland/xdg_shell.rs @@ -245,7 +245,7 @@ impl Dispatch for WaylandState { if toplevel.version() >= EVT_WM_CAPABILITIES_SINCE { toplevel.wm_capabilities(vec![]); } - toplevel.configure(0, 0, vec![1]); + toplevel.configure(0, 0, vec![]); xdg_surface.configure(SERIAL_COUNTER.inc()); let (node, item) = PanelItem::create(