mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-12 16:12:44 +02:00
feat(config): soft deprecate window_hiding_behaviour variants
This commit adds a soft-deprecation message for the Hide and Minimize variants of WindowHidingBehaviour to start bringing all users towards using the Cloak variant. resolve #897
This commit is contained in:
@@ -356,7 +356,7 @@ pub enum HidingBehaviour {
|
|||||||
Hide,
|
Hide,
|
||||||
/// Use the SW_MINIMIZE flag to hide windows when switching workspaces (has issues with frequent workspace switching)
|
/// Use the SW_MINIMIZE flag to hide windows when switching workspaces (has issues with frequent workspace switching)
|
||||||
Minimize,
|
Minimize,
|
||||||
/// Use the undocumented SetCloak Win32 function to hide windows when switching workspaces (has foregrounding issues)
|
/// Use the undocumented SetCloak Win32 function to hide windows when switching workspaces
|
||||||
Cloak,
|
Cloak,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ pub struct StaticConfig {
|
|||||||
/// Monitor and workspace configurations
|
/// Monitor and workspace configurations
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub monitors: Option<Vec<MonitorConfig>>,
|
pub monitors: Option<Vec<MonitorConfig>>,
|
||||||
/// Which Windows signal to use when hiding windows (default: minimize)
|
/// Which Windows signal to use when hiding windows (default: Cloak)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub window_hiding_behaviour: Option<HidingBehaviour>,
|
pub window_hiding_behaviour: Option<HidingBehaviour>,
|
||||||
/// Global work area (space used for tiling) offset (default: None)
|
/// Global work area (space used for tiling) offset (default: None)
|
||||||
@@ -366,13 +366,25 @@ impl StaticConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn deprecated(raw: &str) {
|
pub fn deprecated(raw: &str) {
|
||||||
let deprecated = ["invisible_borders"];
|
let deprecated_options = ["invisible_borders"];
|
||||||
|
let deprecated_variants = vec![
|
||||||
|
("Hide", "window_hiding_behaviour", "Cloak"),
|
||||||
|
("Minimize", "window_hiding_behaviour", "Cloak"),
|
||||||
|
];
|
||||||
|
|
||||||
for option in deprecated {
|
for option in deprecated_options {
|
||||||
if raw.contains(option) {
|
if raw.contains(option) {
|
||||||
println!(r#""{option}" is deprecated and can be removed"#);
|
println!(r#""{option}" is deprecated and can be removed"#);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (variant, option, recommended) in deprecated_variants {
|
||||||
|
if raw.contains(option) && raw.contains(variant) {
|
||||||
|
println!(
|
||||||
|
r#"The "{variant}" option for "{option}" is deprecated and can be removed or replaced with "{recommended}""#
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user