diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index 74ba5ae6b9f..79960b3e4a4 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -466,6 +466,14 @@ impl WindowOps for WaylandWindow { Ok(()) }); } + + fn maximize(&self) { + WaylandConnection::with_window_inner(self.0, move |inner| Ok(inner.maximize())); + } + + fn restore(&self) { + WaylandConnection::with_window_inner(self.0, move |inner| Ok(inner.restore())); + } } #[derive(Default, Clone, Debug)] pub(crate) struct PendingEvent { @@ -1208,6 +1216,18 @@ impl WaylandWindowInner { _ => log::warn!("unhandled FrameAction: {:?}", action), } } + + fn maximize(&mut self) { + if let Some(window) = self.window.as_mut() { + window.set_maximized(); + } + } + + fn restore(&mut self) { + if let Some(window) = self.window.as_mut() { + window.unset_maximized(); + } + } } impl WaylandState {