-
-
Notifications
You must be signed in to change notification settings - Fork 577
feat: add new input-passthrough window rule #2746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
Other compositor doesnt have this feature yet because it doesnt really make any sense. Layer shell can achieve all things that you said above. |
|
As in I can convert existing windows into passthrough overlays using layer shell? Do you have any examples on how to do that? @HigherOrderLogic |
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. |
|
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 |
|
We already have floating windows so I think it's fine for niri to also define passthrough here. |
|
@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. |
|
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. |
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
input_passthroughconfig property to window rules.Tile::hit()to return None for passthrough windows.Core logic is a simple check in
tile.rs:Example usage: