mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 10:08:33 +02:00
fix(wm): ensure manage > float rule priority
This commit ensures that manage rules have priority over float rules. This is useful for applications such as Steam, where all windows including pop-ups have the same class name. The class name can be used with a float rule to ensure that all Steam pop-up windows are ignored, and then the title "Steam" can be used with a manage rule to ensure that the main Steam window does get managed. fix #163
This commit is contained in:
@@ -293,25 +293,35 @@ impl Window {
|
|||||||
// If not allowing cloaked windows, we need to ensure the window is not cloaked
|
// If not allowing cloaked windows, we need to ensure the window is not cloaked
|
||||||
(false, false) => {
|
(false, false) => {
|
||||||
if let (Ok(title), Ok(exe_name), Ok(class)) = (self.title(), self.exe(), self.class()) {
|
if let (Ok(title), Ok(exe_name), Ok(class)) = (self.title(), self.exe(), self.class()) {
|
||||||
|
let mut should_float = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
let float_identifiers = FLOAT_IDENTIFIERS.lock();
|
let float_identifiers = FLOAT_IDENTIFIERS.lock();
|
||||||
for identifier in float_identifiers.iter() {
|
for identifier in float_identifiers.iter() {
|
||||||
if title.starts_with(identifier) || title.ends_with(identifier) ||
|
if title.starts_with(identifier) || title.ends_with(identifier) ||
|
||||||
class.starts_with(identifier) || class.ends_with(identifier) ||
|
class.starts_with(identifier) || class.ends_with(identifier) ||
|
||||||
identifier == &exe_name {
|
identifier == &exe_name {
|
||||||
return Ok(false);
|
should_float = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let managed_override = {
|
let managed_override = {
|
||||||
let manage_identifiers = MANAGE_IDENTIFIERS.lock();
|
let manage_identifiers = MANAGE_IDENTIFIERS.lock();
|
||||||
manage_identifiers.contains(&exe_name) || manage_identifiers.contains(&class)
|
manage_identifiers.contains(&exe_name)
|
||||||
|
|| manage_identifiers.contains(&class)
|
||||||
|
|| manage_identifiers.contains(&title)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if should_float && !managed_override {
|
||||||
|
return Ok(false);
|
||||||
|
}
|
||||||
|
|
||||||
let allow_layered = {
|
let allow_layered = {
|
||||||
let layered_whitelist = LAYERED_WHITELIST.lock();
|
let layered_whitelist = LAYERED_WHITELIST.lock();
|
||||||
layered_whitelist.contains(&exe_name) || layered_whitelist.contains(&class)
|
layered_whitelist.contains(&exe_name)
|
||||||
|
|| layered_whitelist.contains(&class)
|
||||||
|
|| layered_whitelist.contains(&title)
|
||||||
};
|
};
|
||||||
|
|
||||||
let allow_wsl2_gui = {
|
let allow_wsl2_gui = {
|
||||||
|
|||||||
Reference in New Issue
Block a user