wayland: reimplement maximize and restore

It was removed with wayland reimplementation in #4777
This commit is contained in:
Cosimo Matteini authored and Wez Furlong committed 2024-11-28 10:58:03 -07:00
1 parent e9473edd3e
commit a7ff718c7c
1 file changed
+20
+20
View File
@@ -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 {