config: add keyboard-focus window criteria
This commit is contained in:
parent
eb172e9d8c
commit
91c948b219
15 changed files with 95 additions and 4 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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!(
|
||||
|
|
|
|||
|
|
@ -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<'_> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue