Skip to content

Conversation

@griccardos
Copy link

This adds the ability to inhibit idle on a window if configured.

There are a few discussions about the topic
#742
#1855

There are 3 options:

  • inhibit_idle "always" - whenever this window is present.
  • inhibit_idle "fullscreen" - whenever this window is fullscreen
  • inhibit_idle "never" - don't inhibit on this window

Option 1 is useful, for example converting a video file that may take a couple of hours, but the window itself is not necessarily fullscreen

window-rule {
    match title="HandBrake"
    inhibit-idle "always"
}

Option 2 is useful, for example when you are watching video, playing games with a controller and the window is fullscreen

window-rule {
    match app-id="librewolf"
    inhibit-idle "fullscreen"
}

Option 3 is to disable inhibit on this window for example if you have enabled inhibit fullscreen on all windows, but you want this window as the exception not to inhibit when fullscreen

window-rule {
    inhibit-idle "fullscreen"
}
window-rule {
    match app-id="Alacritty"
    inhibit-idle "never"
}

@HigherOrderLogic
Copy link
Contributor

inhibit_idle "never" in this PR doesnt make sense. From a quick skim of your PR, seems like the client still can dispatch an idle inhibitor through the Screensaver Dbus and inhibit the compositor.

@griccardos
Copy link
Author

@HigherOrderLogic
Perhaps never is the wrong term. The aim of never, is not to prevent inhibiting but to override a parent rule. Like in my example, I want to inhibit idle on all windows that are fullscreen with the exception of alacritty.
perhaps renaming it to none?
Open to suggestions on the naming...

@HigherOrderLogic
Copy link
Contributor

perhaps renaming it to none?

Yeah, "none" seems like a better name here.

@YaLTeR
Copy link
Owner

YaLTeR commented Sep 12, 2025

The aim of never, is not to prevent inhibiting but to override a parent rule.

I believe we use null for this

@griccardos
Copy link
Author

griccardos commented Sep 12, 2025

The aim of never, is not to prevent inhibiting but to override a parent rule.

I believe we use null for this

Yes, I can implement null for this case.

We will still need a 3rd variant as there are 4 cases:

  • "always" - Some(Always)
  • "fullscreen" - Some(Fullscreen)
  • null - Use default irrespective of previous window rules - Some(Default)
  • user leaves it out - Use previous window rules. - None

Pehaps we can call the 3rd variant Default

@YaLTeR
Copy link
Owner

YaLTeR commented Sep 12, 2025

I think I used Option<Option<T>> elsewhere

@griccardos
Copy link
Author

Thanks for the tip, Option<Option<InhibitIdle>> worked nicely.
I have made the changes.
I've also done some testing and it works as expected.

@nagisa
Copy link
Contributor

nagisa commented Oct 3, 2025

Should a way to inspect idle inhibitors (and inhibition reasons) be added as well? Could be a field in niri msg windows.

@YaLTeR
Copy link
Owner

YaLTeR commented Oct 4, 2025

It's tricky. There's Wayland idle inhibit, which has no reason. There's the D-Bus one that has no association to a window.

@griccardos griccardos force-pushed the inhibit_idle branch 2 times, most recently from 316df56 to dad62ca Compare November 30, 2025 18:06
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