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) {
|
pub fn configure(&self) {
|
||||||
for window in match &self.element {
|
for window in match &self.element {
|
||||||
CosmicMappedInternal::Stack(s) => {
|
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 {
|
pub fn is_activated(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
CosmicSurface::Wayland(window) => window
|
CosmicSurface::Wayland(window) => window
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ impl FloatingLayout {
|
||||||
|
|
||||||
let layers = layer_map_for_output(&output);
|
let layers = layer_map_for_output(&output);
|
||||||
let geometry = layers.non_exclusive_zone();
|
let geometry = layers.non_exclusive_zone();
|
||||||
|
mapped.set_bounds(geometry.size);
|
||||||
let last_geometry = mapped.last_geometry.lock().unwrap().clone();
|
let last_geometry = mapped.last_geometry.lock().unwrap().clone();
|
||||||
|
|
||||||
if let Some(size) = last_geometry.map(|g| g.size) {
|
if let Some(size) = last_geometry.map(|g| g.size) {
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,7 @@ impl TilingLayout {
|
||||||
) {
|
) {
|
||||||
let output = seat.active_output();
|
let output = seat.active_output();
|
||||||
window.output_enter(&output, window.bbox());
|
window.output_enter(&output, window.bbox());
|
||||||
|
window.set_bounds(output.geometry().size);
|
||||||
self.map_internal(window, &output, Some(focus_stack));
|
self.map_internal(window, &output, Some(focus_stack));
|
||||||
self.refresh();
|
self.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue