mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-22 01:19:21 +01:00
fix(wm): always preserve resize on monocle toggle
This commit ensures that the Vec of resize adjustment Rects will never be truncated when monocle mode is enabled for a container. fix #1257
This commit is contained in:
@@ -458,7 +458,16 @@ impl Workspace {
|
||||
// number of layouts / containers. This should never actually truncate as the remove_window
|
||||
// function takes care of cleaning up resize dimensions when destroying empty containers
|
||||
let container_count = self.containers().len();
|
||||
self.resize_dimensions_mut().resize(container_count, None);
|
||||
|
||||
// since monocle is a toggle, we never want to truncate the resize dimensions since it will
|
||||
// almost always be toggled off and the container will be reintegrated into layout
|
||||
//
|
||||
// without this check, if there are exactly two containers, when one is toggled to monocle
|
||||
// the resize dimensions will be truncated to len == 1, and when it is reintegrated, if it
|
||||
// had a resize adjustment before, that will have been lost
|
||||
if self.monocle_container().is_none() {
|
||||
self.resize_dimensions_mut().resize(container_count, None);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user