1
0
Fork 0
forked from wry/wry

config: add auto-focus window rule

This commit is contained in:
Julian Orth 2025-05-03 15:33:02 +02:00
parent 51e752992f
commit b1ca98b488
12 changed files with 114 additions and 10 deletions

View file

@ -8,6 +8,7 @@ use {
config::handler::ConfigProxyHandler,
ifs::wl_seat::SeatId,
state::State,
tree::ToplevelData,
utils::{
clonecell::CloneCell, numcell::NumCell, ptr_ext::PtrExt,
toplevel_identifier::ToplevelIdentifier, unlink_on_drop::UnlinkOnDrop, xrd::xrd,
@ -161,6 +162,13 @@ impl ConfigProxy {
handler.windows_to_tl_id.remove(&win);
}
}
pub fn auto_focus(&self, data: &ToplevelData) -> bool {
let Some(handler) = self.handler.get() else {
return true;
};
handler.auto_focus(data)
}
}
impl Drop for ConfigProxy {
@ -224,6 +232,7 @@ impl ConfigProxy {
window_matcher_cache: Default::default(),
window_matcher_leafs: Default::default(),
window_matcher_std_kinds: state.tl_matcher_manager.kind(window::CLIENT_WINDOW),
window_matcher_no_auto_focus: Default::default(),
});
let init_msg = bincode_ops()
.serialize(&InitMessage::V1(V1InitMessage {}))