1
0
Fork 0
forked from wry/wry

criteria: clear maps at shutdown

This commit is contained in:
Julian Orth 2025-07-18 23:42:16 +02:00
parent d1b84ee0a2
commit e28b1b5646
5 changed files with 51 additions and 0 deletions

View file

@ -63,6 +63,18 @@ pub struct RootMatchers {
exe: ClmRootMatcherMap<ClmMatchExe>,
}
impl RootMatchers {
fn clear(&self) {
self.sandbox_app_id.clear();
self.sandbox_engine.clear();
self.sandbox_instance_id.clear();
self.uid.clear();
self.pid.clear();
self.comm.clear();
self.exe.clear();
}
}
pub async fn handle_cl_changes(state: Rc<State>) {
let mgr = &state.cl_matcher_manager;
loop {
@ -112,6 +124,10 @@ impl ClMatcherManager {
pub fn clear(&self) {
self.changes.clear();
self.leaf_events.clear();
self.constant.values().for_each(|c| c.clear());
self.sandboxed.values().for_each(|c| c.clear());
self.is_xwayland.values().for_each(|c| c.clear());
self.matchers.clear();
}
pub fn rematch_all(&self, state: &Rc<State>) {

View file

@ -129,6 +129,10 @@ where
slf
}
pub fn clear(&self) {
self.downstream.clear();
}
pub fn handle(&self, target: &Target) {
let new = self.criterion.matches(target) ^ self.not;
let node = match new {

View file

@ -125,6 +125,10 @@ where
}
}
pub fn clear(&self) {
self.nodes.clear()
}
pub fn update_matched(
&self,
target: &Target,

View file

@ -56,6 +56,10 @@ where
}
}
pub fn clear(&self) {
self.data.borrow_mut().clear();
}
pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<T> {
RefMut::map(self.data.borrow_mut(), |d| {
&mut d

View file

@ -95,6 +95,22 @@ pub struct RootMatchers {
content_ty: TlmRootMatcherMap<TlmMatchContentType>,
}
impl RootMatchers {
fn clear(&self) {
self.kinds.clear();
self.clients.clear();
self.title.clear();
self.tag.clear();
self.app_id.clear();
self.seat_foci.clear();
self.class.clear();
self.instance.clear();
self.role.clear();
self.workspace.clear();
self.content_ty.clear();
}
}
pub async fn handle_tl_changes(state: Rc<State>) {
let mgr = &state.tl_matcher_manager;
loop {
@ -159,6 +175,13 @@ impl TlMatcherManager {
self.changes.clear();
self.leaf_events.clear();
self.handle_just_mapped.clear();
self.constant.values().for_each(|c| c.clear());
self.floating.values().for_each(|c| c.clear());
self.visible.values().for_each(|c| c.clear());
self.urgent.values().for_each(|c| c.clear());
self.fullscreen.values().for_each(|c| c.clear());
self.just_mapped.values().for_each(|c| c.clear());
self.matchers.clear();
}
pub fn rematch_all(&self, state: &Rc<State>) {