1
0
Fork 0
forked from wry/wry

config: add urgency window criteria

This commit is contained in:
Julian Orth 2025-05-01 18:38:57 +02:00
parent dcf57db3df
commit eb172e9d8c
15 changed files with 56 additions and 5 deletions

View file

@ -1152,7 +1152,7 @@ impl ContainerNode {
fn mod_attention_requests(&self, set: bool) {
let propagate = self.attention_requests.adj(set);
if set || propagate {
self.toplevel_data.wants_attention.set(set);
self.toplevel_data.set_wants_attention(set);
}
if propagate {
if let Some(parent) = self.toplevel_data.parent.get() {

View file

@ -5,7 +5,7 @@ use {
CritDestroyListener, CritMatcherId,
tlm::{
TL_CHANGED_APP_ID, TL_CHANGED_DESTROYED, TL_CHANGED_FLOATING, TL_CHANGED_NEW,
TL_CHANGED_TITLE, TL_CHANGED_VISIBLE, TlMatcherChange,
TL_CHANGED_TITLE, TL_CHANGED_URGENT, TL_CHANGED_VISIBLE, TlMatcherChange,
},
},
ifs::{
@ -647,7 +647,7 @@ impl ToplevelData {
if !self.requested_attention.replace(false) {
return;
}
self.wants_attention.set(false);
self.set_wants_attention(false);
if let Some(parent) = self.parent.get() {
parent.cnode_child_attention_request_changed(node, false);
}
@ -660,12 +660,18 @@ impl ToplevelData {
if self.requested_attention.replace(true) {
return;
}
self.wants_attention.set(true);
self.set_wants_attention(true);
if let Some(parent) = self.parent.get() {
parent.cnode_child_attention_request_changed(node, true);
}
}
pub fn set_wants_attention(&self, value: bool) {
if self.wants_attention.replace(value) != value {
self.property_changed(TL_CHANGED_URGENT);
}
}
pub fn output(&self) -> Rc<OutputNode> {
match self.output_opt() {
None => self.state.dummy_output.get().unwrap(),