criteria: clear maps at shutdown
This commit is contained in:
parent
d1b84ee0a2
commit
e28b1b5646
5 changed files with 51 additions and 0 deletions
|
|
@ -63,6 +63,18 @@ pub struct RootMatchers {
|
||||||
exe: ClmRootMatcherMap<ClmMatchExe>,
|
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>) {
|
pub async fn handle_cl_changes(state: Rc<State>) {
|
||||||
let mgr = &state.cl_matcher_manager;
|
let mgr = &state.cl_matcher_manager;
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -112,6 +124,10 @@ impl ClMatcherManager {
|
||||||
pub fn clear(&self) {
|
pub fn clear(&self) {
|
||||||
self.changes.clear();
|
self.changes.clear();
|
||||||
self.leaf_events.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>) {
|
pub fn rematch_all(&self, state: &Rc<State>) {
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,10 @@ where
|
||||||
slf
|
slf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.downstream.clear();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn handle(&self, target: &Target) {
|
pub fn handle(&self, target: &Target) {
|
||||||
let new = self.criterion.matches(target) ^ self.not;
|
let new = self.criterion.matches(target) ^ self.not;
|
||||||
let node = match new {
|
let node = match new {
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) {
|
||||||
|
self.nodes.clear()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_matched(
|
pub fn update_matched(
|
||||||
&self,
|
&self,
|
||||||
target: &Target,
|
target: &Target,
|
||||||
|
|
|
||||||
|
|
@ -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> {
|
pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<T> {
|
||||||
RefMut::map(self.data.borrow_mut(), |d| {
|
RefMut::map(self.data.borrow_mut(), |d| {
|
||||||
&mut d
|
&mut d
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,22 @@ pub struct RootMatchers {
|
||||||
content_ty: TlmRootMatcherMap<TlmMatchContentType>,
|
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>) {
|
pub async fn handle_tl_changes(state: Rc<State>) {
|
||||||
let mgr = &state.tl_matcher_manager;
|
let mgr = &state.tl_matcher_manager;
|
||||||
loop {
|
loop {
|
||||||
|
|
@ -159,6 +175,13 @@ impl TlMatcherManager {
|
||||||
self.changes.clear();
|
self.changes.clear();
|
||||||
self.leaf_events.clear();
|
self.leaf_events.clear();
|
||||||
self.handle_just_mapped.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>) {
|
pub fn rematch_all(&self, state: &Rc<State>) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue