fix(window-state): Remove unnecessary reference in denylist pattern processing

chore(changes): Update window-state and window-state-js versioning for glob pattern support

docs(window-state): Update glob pattern denylist documentation for clarity
pull/2330/head
thewh1teagle 6 months ago
parent 2847f11d3a
commit c8e84f693a
No known key found for this signature in database

@ -0,0 +1,6 @@
---
window-state: patch
window-state-js: patch
---
Introduces the ability to use glob patterns in the denylist for windows that shouldn't be tracked and managed. This allows for more flexible window matching, such as ignoring multiple windows that fit a certain naming pattern.

@ -352,7 +352,7 @@ impl Builder {
let mut denylist_patterns = Vec::new(); let mut denylist_patterns = Vec::new();
for pattern in denylist { for pattern in denylist {
denylist_patterns.push(glob::Pattern::new(&pattern)?); denylist_patterns.push(glob::Pattern::new(pattern)?);
} }
self.denylist = denylist_patterns; self.denylist = denylist_patterns;
Ok(self) Ok(self)
@ -421,7 +421,6 @@ impl Builder {
.map(|map| map(window.label())) .map(|map| map(window.label()))
.unwrap_or_else(|| window.label()); .unwrap_or_else(|| window.label());
for pattern in &self.denylist { for pattern in &self.denylist {
if pattern.matches(label) { if pattern.matches(label) {
return; return;

Loading…
Cancel
Save