fix(wm): dynamically reserve monitor ring space

This commit makes a small change to dynamically keep reserving space in
the VecDeque that backs Ring<Monitor> until an index preference can be
contained within the current length.
This commit is contained in:
LGUG2Z
2024-05-23 16:58:52 -07:00
parent 1712042dda
commit 8ceed09c20

View File

@@ -277,7 +277,7 @@ impl WindowsApi {
monitors.elements_mut().push_back(m);
} else if let Some(preference) = index_preference {
let current_len = monitors.elements().len();
if *preference > current_len {
while *preference > current_len {
monitors.elements_mut().reserve(1);
}