mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-13 16:42:50 +02:00
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 also fixes some clippy lints and adds some allow annotations.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
||||||
#![allow(clippy::missing_errors_doc, clippy::use_self)]
|
#![allow(clippy::missing_errors_doc, clippy::use_self, clippy::doc_markdown)]
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#![allow(clippy::assigning_clones)]
|
||||||
|
|
||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
use eframe::egui::color_picker::Alpha;
|
use eframe::egui::color_picker::Alpha;
|
||||||
use eframe::egui::Color32;
|
use eframe::egui::Color32;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
clippy::missing_errors_doc,
|
clippy::missing_errors_doc,
|
||||||
clippy::redundant_pub_crate,
|
clippy::redundant_pub_crate,
|
||||||
clippy::significant_drop_tightening,
|
clippy::significant_drop_tightening,
|
||||||
clippy::significant_drop_in_scrutinee
|
clippy::significant_drop_in_scrutinee,
|
||||||
|
clippy::doc_markdown
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ impl StaticConfig {
|
|||||||
|
|
||||||
let mut display = false;
|
let mut display = false;
|
||||||
|
|
||||||
for (_, aliases) in &map {
|
for aliases in map.values() {
|
||||||
for a in aliases {
|
for a in aliases {
|
||||||
if raw.contains(a) {
|
if raw.contains(a) {
|
||||||
display = true;
|
display = true;
|
||||||
@@ -493,7 +493,11 @@ impl From<&WindowManager> for StaticConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl StaticConfig {
|
impl StaticConfig {
|
||||||
#[allow(clippy::cognitive_complexity, clippy::too_many_lines)]
|
#[allow(
|
||||||
|
clippy::cognitive_complexity,
|
||||||
|
clippy::too_many_lines,
|
||||||
|
clippy::assigning_clones
|
||||||
|
)]
|
||||||
fn apply_globals(&mut self) -> Result<()> {
|
fn apply_globals(&mut self) -> Result<()> {
|
||||||
if let Some(monitor_index_preferences) = &self.monitor_index_preferences {
|
if let Some(monitor_index_preferences) = &self.monitor_index_preferences {
|
||||||
let mut preferences = MONITOR_INDEX_PREFERENCES.lock();
|
let mut preferences = MONITOR_INDEX_PREFERENCES.lock();
|
||||||
|
|||||||
@@ -276,8 +276,7 @@ impl WindowsApi {
|
|||||||
if monitors.elements().is_empty() {
|
if monitors.elements().is_empty() {
|
||||||
monitors.elements_mut().push_back(m);
|
monitors.elements_mut().push_back(m);
|
||||||
} else if let Some(preference) = index_preference {
|
} else if let Some(preference) = index_preference {
|
||||||
let current_len = monitors.elements().len();
|
while *preference > monitors.elements().len() {
|
||||||
if *preference > current_len {
|
|
||||||
monitors.elements_mut().reserve(1);
|
monitors.elements_mut().reserve(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
||||||
#![allow(clippy::missing_errors_doc)]
|
#![allow(clippy::missing_errors_doc, clippy::doc_markdown)]
|
||||||
|
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
@@ -102,6 +102,7 @@ lazy_static! {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
trait AhkLibrary {
|
trait AhkLibrary {
|
||||||
fn generate_ahk_library() -> String;
|
fn generate_ahk_library() -> String;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user