atagen

monolith

public
Star0
Watch0

Commit b4ed072f01d2

tarball

atagen <boss@atagen.co>2026-10-19 08:55 UTC

1 file changed+19-8
idle: let window rules hold off the idle blank

Only wp_idle_inhibit surfaces counted, so a player that never asks for an inhibitor let the screen blank. update_inhibit now also counts windows whose rule says visible, or fullscreen once placed fullscreen, and the result feeds both ext-idle-notify and the blank timer in power.rs.
Modified file: crates/monolith/src/idle.rs+19 additions−8 deletions
@@ -2,6 +2,8 @@
22 //! when the user went away and video players can keep the screen on.
33
44 use crate::state::State;
5+use crate::wm::Kind;
6+use monolith_config::IdleInhibit;
57 use smithay::reexports::calloop::LoopHandle;
68 use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
79 use smithay::reexports::wayland_server::{DisplayHandle, Resource};
@@ -54,17 +56,26 @@ pub fn root_surface(surface: &WlSurface) -> WlSurface {
5456
5557 impl State {
5658 /// An inhibitor only counts while its surface is on screen, as the
57- /// protocol asks, so a video on a hidden tag lets the screen blank.
59+ /// protocol asks, so a video on a hidden tag lets the screen blank. Rules
60+ /// can make windows inhibit without asking.
5861 pub fn update_inhibit(&mut self) {
5962 self.services.idle.inhibitors.retain(|s| s.is_alive());
60- let shown = self.services.idle.inhibitors.iter().any(|s| {
61- let root = root_surface(s);
62- self.wm
63- .space
64- .elements()
65- .any(|w| crate::wm::root(w).as_ref() == Some(&root))
66- || self.layer_maps_contain(&root)
63+ let ruled = self.wm.iter().any(|(_, s)| {
64+ matches!(
65+ (s.rule.idle_inhibit, s.placed),
66+ (Some(IdleInhibit::Visible), Some(_))
67+ | (Some(IdleInhibit::Fullscreen), Some((Kind::Fullscreen, ..)))
68+ )
6769 });
70+ let shown = ruled
71+ || self.services.idle.inhibitors.iter().any(|s| {
72+ let root = root_surface(s);
73+ self.wm
74+ .space
75+ .elements()
76+ .any(|w| crate::wm::root(w).as_ref() == Some(&root))
77+ || self.layer_maps_contain(&root)
78+ });
6879 if shown != self.services.idle.inhibited {
6980 self.services.idle.inhibited = shown;
7081 if !shown {