Add automatic idle inhibition for fullscreen playback and selected apps
This commit is contained in:
1 parent
453ec16583
commit
03a265b97f
17 files changed
+842
-22
No files matched your search
+47
-1
@@ -534,6 +534,7 @@ window rules can override that behavior.
|
||||
| `width`, `height` | numbers > 0 | Application-chosen floating size |
|
||||
| `fullscreen` | boolean | Leave fullscreen state unchanged |
|
||||
| `block-out-from-screencasts` | boolean | Exclude from captures; enabled by default for Ferese authentication dialogs |
|
||||
| `idle-inhibit` | `none`, `visible`, `fullscreen`, `playing`, `fullscreen-playing` | Automatic fullscreen playback; see [Idle inhibition](#idle-inhibition) |
|
||||
|
||||
`window-rule app-id="org.example.Private" block-out-from-screencasts=#true`
|
||||
keeps matching windows visible on the display but omits them (including their
|
||||
@@ -574,7 +575,9 @@ Transient dialogs and cancelled drags do not update this memory. Floating → ti
|
||||
→ floating also restores the window's last floating geometry. Nested previews
|
||||
keep drag memory in process and do not write the user's saved placements.
|
||||
|
||||
Title changes do not trigger new rules; config rule changes apply to existing windows.
|
||||
Title changes do not reapply placement rules. Capture privacy and idle inhibition
|
||||
follow current app ID, title and parent metadata. Config rule changes apply to
|
||||
existing windows.
|
||||
|
||||
```kdl
|
||||
window-rule app-id="dev.ferese.Settings" floating=#true
|
||||
@@ -776,6 +779,49 @@ unlock in a nested compositor before enabling automatic locking. A crashed
|
||||
locker leaves the session locked; recovery requires ending that session from
|
||||
another TTY.
|
||||
|
||||
## Idle inhibition
|
||||
|
||||
Ferese keeps the session awake during fullscreen playback when an application
|
||||
reports `Playing` through MPRIS. Pausing or stopping playback releases this
|
||||
automatic inhibition. A window must have content visible on an awake display;
|
||||
switching away, closing it, locking the session or sleeping its display releases
|
||||
inhibition too.
|
||||
|
||||
Disable the default fullscreen playback policy with:
|
||||
|
||||
```kdl
|
||||
idle-inhibit {
|
||||
fullscreen-playback #false
|
||||
}
|
||||
```
|
||||
|
||||
Use window rules for presentations, games or other apps that should keep the
|
||||
session awake while visible:
|
||||
|
||||
```kdl
|
||||
window-rule app-id="org.example.Presentation" idle-inhibit="visible"
|
||||
```
|
||||
|
||||
| `idle-inhibit` rule | Behavior |
|
||||
| --- | --- |
|
||||
| `visible` | Inhibit while visible, regardless of playback state |
|
||||
| `fullscreen` | Inhibit while visible and fullscreen |
|
||||
| `playing` | Inhibit while visible and its MPRIS player reports `Playing` |
|
||||
| `fullscreen-playing` | Inhibit while visible, fullscreen and its MPRIS player reports `Playing` |
|
||||
| `none` | Disable automatic inhibition for this window |
|
||||
|
||||
MPRIS identifies an application, not an individual video window. Ferese matches
|
||||
the player's process ID first, then its `DesktopEntry` against the window's app
|
||||
ID. If several windows match, automatic playback inhibition stays off. MPRIS
|
||||
also does not distinguish audio from video, so fullscreen audio playback can
|
||||
inhibit too. Players without MPRIS can request inhibition through the existing
|
||||
Wayland or portal protocols; a fullscreen window alone does not prove playback.
|
||||
|
||||
These settings control automatic inhibition. They do not override an
|
||||
application's own Wayland or portal request, and they do not block manual
|
||||
locking or suspend. Run `feresectl get-idle-inhibition` to inspect the current
|
||||
inhibition state and discovered players. Changes take effect on config reload.
|
||||
|
||||
## Optional session protocols
|
||||
|
||||
These are launch-time environment switches, not KDL keys. Enable only for
|
||||
|
||||
@@ -83,6 +83,18 @@ cargo test --locked -p ferese backends::direct::capture::tests -- --ignored
|
||||
cargo test --locked -p ferese mirrored_pixels_fit -- --ignored
|
||||
```
|
||||
|
||||
## Idle inhibition checks
|
||||
|
||||
The playback test runs a fake MPRIS player on a private bus and opens a client in
|
||||
a temporary nested desktop. It checks pause/stop, workspace switching, window closure,
|
||||
player replacement and live rule changes. It needs a Wayland session,
|
||||
PyGObject, `dbus-run-session`, `cc` and `wayland-scanner`.
|
||||
|
||||
```sh
|
||||
cargo build --release --locked -p ferese -p feresectl
|
||||
FERESE_TEST_IDLE_INHIBITION=1 FERESE_TEST_BINARY=target/release/ferese FERESE_TEST_CTL=target/release/feresectl python3 scripts/tests/test_idle_inhibition_isolated.py
|
||||
```
|
||||
|
||||
## Report a bug
|
||||
|
||||
Include the commit or installed release, reproduction steps, backend (nested or
|
||||
|
||||
Reference in new issue
Block a user