Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions niri-config/src/window_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub struct WindowRule {
pub scroll_factor: Option<FloatOrInt<0, 100>>,
#[knuffel(child, unwrap(argument))]
pub tiled_state: Option<bool>,
#[knuffel(child, unwrap(argument))]
pub input_passthrough: Option<bool>,
}

#[derive(knuffel::Decode, Debug, Default, Clone, PartialEq)]
Expand Down
4 changes: 4 additions & 0 deletions src/layout/tile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ impl<W: LayoutElement> Tile<W> {
let offset = self.bob_offset();
let point = point - offset;

if self.window.rules().input_passthrough == Some(true) {
return None;
}

if self.is_in_input_region(point) {
let win_pos = self.buf_loc() + offset;
Some(HitType::Input { win_pos })
Expand Down
5 changes: 5 additions & 0 deletions src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub struct ResolvedWindowRules {

/// Override whether to set the Tiled xdg-toplevel state on the window.
pub tiled_state: Option<bool>,
pub input_passthrough: Option<bool>,
}

impl<'a> WindowRef<'a> {
Expand Down Expand Up @@ -240,6 +241,7 @@ impl ResolvedWindowRules {
variable_refresh_rate: None,
scroll_factor: None,
tiled_state: None,
input_passthrough: None,
}
}

Expand Down Expand Up @@ -365,6 +367,9 @@ impl ResolvedWindowRules {
if let Some(x) = rule.tiled_state {
resolved.tiled_state = Some(x);
}
if let Some(x) = rule.input_passthrough {
resolved.input_passthrough = Some(x);
}
}

resolved.open_on_output = open_on_output.map(|x| x.to_owned());
Expand Down