shell: Set xdg_shell v4 bounds

This commit is contained in:
Victoria Brekenfeld 2023-03-31 14:04:35 +02:00
parent bc49507353
commit 8f6ad62017
4 changed files with 18 additions and 0 deletions

View file

@ -411,6 +411,13 @@ impl CosmicMapped {
}
}
pub fn set_bounds(&self, size: impl Into<Option<Size<i32, Logical>>>) {
let size = size.into();
for (surface, _) in self.windows() {
surface.set_bounds(size.clone())
}
}
pub fn configure(&self) {
for window in match &self.element {
CosmicMappedInternal::Stack(s) => {

View file

@ -120,6 +120,15 @@ impl CosmicSurface {
}
}
pub fn set_bounds(&self, size: impl Into<Option<Size<i32, Logical>>>) {
match self {
CosmicSurface::Wayland(window) => window.toplevel().with_pending_state(|state| {
state.bounds = size.into();
}),
_ => {}
}
}
pub fn is_activated(&self) -> bool {
match self {
CosmicSurface::Wayland(window) => window