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

@ -6,6 +6,7 @@ pub(crate) mod string_error;
use {
crate::{
client::ClientMatcher,
input::Seat,
video::Mode,
window::{WindowMatcher, WindowType},
},
@ -113,6 +114,7 @@ pub enum WindowCriterionIpc {
Floating,
Visible,
Urgent,
SeatFocus(Seat),
}
#[derive(Serialize, Deserialize, Clone, Debug, Hash, Eq, PartialEq)]

View file

@ -1660,6 +1660,7 @@ impl ConfigClient {
WindowCriterion::Floating => WindowCriterionIpc::Floating,
WindowCriterion::Visible => WindowCriterionIpc::Visible,
WindowCriterion::Urgent => WindowCriterionIpc::Urgent,
WindowCriterion::Focus(seat) => WindowCriterionIpc::SeatFocus(seat),
};
let res = self.send_with_response(&ClientMessage::CreateWindowMatcher { criterion });
get_response!(

View file

@ -4,6 +4,7 @@ use {
crate::{
Axis, Direction, Workspace,
client::{Client, ClientCriterion},
input::Seat,
},
serde::{Deserialize, Serialize},
std::ops::Deref,
@ -250,6 +251,8 @@ pub enum WindowCriterion<'a> {
Visible,
/// Matches if the window has the urgency flag set.
Urgent,
/// Matches if the window has the keyboard focus of the seat.
Focus(Seat),
}
impl WindowCriterion<'_> {