Skip to content

Conversation

@zitongcharliedeng
Copy link

Adds a new window rule that makes windows transparent to input events, allowing clicks to pass through to windows below.

Use cases: Gaming overlays, custom HUDs, desktop-wide status displays, or watching content on top without stealing input from applications underneath (Discord/OBS/video players over games or coding tools). Especially useful when coupled with floating and opacity rules to create custom overlays with ease. No other window manager has this feature surprisingly afaik.

Implementation

  • Added input_passthrough config property to window rules.
  • Modified Tile::hit() to return None for passthrough windows.

Core logic is a simple check in tile.rs:

if self.window.rules().input_passthrough == Some(tr>
    return None; // Pass through all input
}

Example usage:

window-rule {
    match app-id=r#"^discord$"#
    opacity 0.5  
    //^ Optional - just to see content under if target window is 100% alpha
    input-passthrough true
}

Adds a new window rule that makes windows transparent to input events,
allowing clicks to pass through to windows below.

Use cases: Gaming overlays, custom HUDs, desktop-wide status displays,
or watching content on top without stealing input from applications
underneath (Discord/OBS/video players over games or coding tools).
Especially useful when coupled with floating and opacity rules to create
custom overlays with ease.
@HigherOrderLogic
Copy link
Contributor

Other compositor doesnt have this feature yet because it doesnt really make any sense.

Layer shell can achieve all things that you said above.

@zitongcharliedeng
Copy link
Author

As in I can convert existing windows into passthrough overlays using layer shell? Do you have any examples on how to do that? @HigherOrderLogic

@HigherOrderLogic
Copy link
Contributor

As in I can convert existing windows into passthrough overlays using layer shell?

No, layer shell is a different thing than your normal windows. It is meant to be a layer that can be placed on your screen, above or below windows, and allow for things like input passthrough or focus grab.

@zitongcharliedeng
Copy link
Author

Yeah I think this is still a separate useful feature to be paired with floating window then, layer-shell sounds like I'd have to make overlays from scratch, rather than programmatically just allow any Niri window to turn into a passthrough HUD-like overlay whenever I want. To turn existing things like web based input overlays into live screen gaming keystroke tracking overlays using a single property

@zitongcharliedeng
Copy link
Author

We already have floating windows so I think it's fine for niri to also define passthrough here.

@zitongcharliedeng
Copy link
Author

zitongcharliedeng commented Nov 4, 2025

@YaLTeR thoughts? We could add an IPC for it too, like toggle-input-passthrough.

This current small change was enough for it to work on a nested Niri env for me, and I got a nice floating desktop/gaming overlay working, showing me a keyboard input overlay using a simple webapp. Not sure if I need to contribute tests and stuff in this PR.

And I'm pretty sure this fulfills a separate functionality than if we were to use layer-shells from what I looked into.

@shaleh
Copy link

shaleh commented Nov 10, 2025

https://drewdevault.com/2018/07/29/Wayland-shells.html is a nice explainer for shells.

What I think I hear HigherOrderLogic saying is... what if you had a way to "promote" a window to particular layer? Toggle that layer as pass through or not. Then you can setup your HUD as "x, y, and z are in the overlay layer and pass through". Similar logic to what is in this PR, but implemented within the layer-shell framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants