shell: Set xdg_shell v4 bounds
This commit is contained in:
parent
bc49507353
commit
8f6ad62017
4 changed files with 18 additions and 0 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue