From 8ceed09c20b24a0f69e2136ca9e80100e3292aa2 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Thu, 23 May 2024 16:58:52 -0700 Subject: [PATCH] fix(wm): dynamically reserve monitor ring space This commit makes a small change to dynamically keep reserving space in the VecDeque that backs Ring until an index preference can be contained within the current length. --- komorebi/src/windows_api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 38212df1..9a3302c6 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -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); }