layout/floating: allow size altering if window was maximized (#2038)
This commit is contained in:
parent
06ece0fdcd
commit
9ad5c916f3
2 changed files with 17 additions and 0 deletions
|
|
@ -182,6 +182,21 @@ impl CosmicSurface {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn last_server_size(&self) -> Option<Size<i32, Logical>> {
|
||||
match self.0.underlying_surface() {
|
||||
WindowSurface::Wayland(toplevel) => with_states(toplevel.wl_surface(), |states| {
|
||||
let attributes = states
|
||||
.data_map
|
||||
.get::<XdgToplevelSurfaceData>()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap();
|
||||
attributes.current_server_state().size
|
||||
}),
|
||||
WindowSurface::X11(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn global_geometry(&self) -> Option<Rectangle<i32, Global>> {
|
||||
*self
|
||||
.0
|
||||
|
|
|
|||
|
|
@ -686,6 +686,8 @@ impl FloatingLayout {
|
|||
&& let Some(pending_size) = window.pending_size()
|
||||
{
|
||||
mapped_geometry.size = pending_size.as_local();
|
||||
} else if let Some(server_size) = window.active_window().last_server_size() {
|
||||
mapped_geometry.size = server_size.as_local();
|
||||
}
|
||||
*window.last_geometry.lock().unwrap() = Some(mapped_geometry);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue