Skip to content

Commit

Permalink
wayland: reimplement maximize and restore
Browse files Browse the repository at this point in the history
It was removed with wayland reimplementation in #4777
  • Loading branch information
devmatteini authored and wez committed Nov 28, 2024
1 parent e9473ed commit a7ff718
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions window/src/os/wayland/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a7ff718

Please sign in to comment.