mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-06 02:43:26 +02:00
feat(wm): start/end match on some float rules
This commit tweaks how float rule matching for titles and classes works. Previously, they required an exact match to be triggered. This change allows starts_with and ends_with matches on classes and window titles to also trigger a float rule for applications that dynamically change their window titles or window classes. Exe matches are still required to be exact.
This commit is contained in:
@@ -283,10 +283,12 @@ impl Window {
|
||||
if let (Ok(title), Ok(exe_name), Ok(class)) = (self.title(), self.exe(), self.class()) {
|
||||
{
|
||||
let float_identifiers = FLOAT_IDENTIFIERS.lock();
|
||||
if float_identifiers.contains(&title)
|
||||
|| float_identifiers.contains(&exe_name)
|
||||
|| float_identifiers.contains(&class) {
|
||||
return Ok(false);
|
||||
for identifier in float_identifiers.iter() {
|
||||
if title.starts_with(identifier) || title.ends_with(identifier) ||
|
||||
class.starts_with(identifier) || class.ends_with(identifier) ||
|
||||
identifier == &exe_name {
|
||||
return Ok(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user