1
0
Fork 0
forked from wry/wry

config: add keyboard-focus window criteria

This commit is contained in:
Julian Orth 2025-05-01 18:43:54 +02:00
parent eb172e9d8c
commit 91c948b219
15 changed files with 95 additions and 4 deletions

View file

@ -20,6 +20,7 @@ macro_rules! fixed_root_criterion {
pub mod tlmm_client;
pub mod tlmm_floating;
pub mod tlmm_kind;
pub mod tlmm_seat_focus;
pub mod tlmm_string;
pub mod tlmm_urgent;
pub mod tlmm_visible;

View file

@ -0,0 +1,28 @@
use crate::{
criteria::{
crit_graph::CritRootCriterion,
tlm::{RootMatchers, TlmRootMatcherMap},
},
ifs::wl_seat::SeatId,
tree::ToplevelData,
};
pub struct TlmMatchSeatFocus {
id: SeatId,
}
impl TlmMatchSeatFocus {
pub fn new(id: SeatId) -> TlmMatchSeatFocus {
Self { id }
}
}
impl CritRootCriterion<ToplevelData> for TlmMatchSeatFocus {
fn matches(&self, data: &ToplevelData) -> bool {
data.seat_foci.contains(&self.id)
}
fn nodes(roots: &RootMatchers) -> Option<&TlmRootMatcherMap<Self>> {
Some(&roots.seat_foci)
}
}