fix(wayland): toplevel states bytemucked to u8

This commit is contained in:
Nova
2023-01-04 08:25:54 -05:00
parent d7fa4e62b8
commit d715f2f9ed
2 changed files with 11 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ pub struct ToplevelState {
pub size: Vector2<u32>,
pub max_size: Option<Vector2<u32>>,
pub min_size: Option<Vector2<u32>>,
pub states: Vec<u8>,
pub states: Vec<u32>,
#[serde(skip_serializing)]
pub queued_state: Option<Box<ToplevelState>>,
}
@@ -524,7 +524,7 @@ impl PanelItem {
#[derive(Debug, Deserialize)]
struct ConfigureToplevelInfo {
size: Option<Vector2<u32>>,
states: Vec<u8>,
states: Vec<u32>,
bounds: Option<Vector2<u32>>,
}
@@ -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::<Vec<_>>(),
);
xdg_surface.configure(SERIAL_COUNTER.inc());
core_surface.flush_clients();

View File

@@ -245,7 +245,7 @@ impl Dispatch<XdgSurface, WaylandSurface, WaylandState> 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(