mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-24 01:28:39 +02:00
fix(wm): update usr idx map when there are no index preferences
This commit is contained in:
@@ -348,7 +348,7 @@ impl WindowsApi {
|
|||||||
.len()
|
.len()
|
||||||
.max(monitor_usr_idx_map.keys().max().map_or(0, |v| *v));
|
.max(monitor_usr_idx_map.keys().max().map_or(0, |v| *v));
|
||||||
|
|
||||||
let available_usr_idxs = (0..max_usr_idx)
|
let mut available_usr_idxs = (0..max_usr_idx)
|
||||||
.filter(|i| !monitor_usr_idx_map.contains_key(i))
|
.filter(|i| !monitor_usr_idx_map.contains_key(i))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
@@ -359,6 +359,7 @@ impl WindowsApi {
|
|||||||
for i in not_added_monitor_idxs {
|
for i in not_added_monitor_idxs {
|
||||||
if let Some(next_usr_idx) = available_usr_idxs.first() {
|
if let Some(next_usr_idx) = available_usr_idxs.first() {
|
||||||
monitor_usr_idx_map.insert(*next_usr_idx, i);
|
monitor_usr_idx_map.insert(*next_usr_idx, i);
|
||||||
|
available_usr_idxs.remove(0);
|
||||||
} else if let Some(idx) = monitor_usr_idx_map.keys().max() {
|
} else if let Some(idx) = monitor_usr_idx_map.keys().max() {
|
||||||
monitor_usr_idx_map.insert(*idx, i);
|
monitor_usr_idx_map.insert(*idx, i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user