Skip to content

util: don't wake the display when inhibiting power management on Xfce - #1094

Open
lbellows wants to merge 1 commit into
linuxmint:masterfrom
lbellows:xfce-inhibit-without-waking-the-display
Open

lbellows wants to merge 1 commit into
linuxmint:masterfrom
lbellows:xfce-inhibit-without-waking-the-display

Conversation

@lbellows

Copy link
Copy Markdown

Fixes #1093.

On Xfce the inhibitor calls org.freedesktop.PowerManagement.Inhibit, which xfce4-power-manager
implements by disabling DPMS. Disabling DPMS powers a blanked panel back on, so a scheduled refresh
lights the monitor of an idle machine every couple of hours, and it stays lit for a full DPMS
timeout after the refresh finishes.

This takes a logind sleep:shutdown block inhibitor on Xfce instead — same protection, no display
side effects — and falls back to the existing interface if logind is unavailable. The inhibitor fd
is also released automatically if we exit unexpectedly.

Measured on Mint 22.3 Xfce with the panel off, from inside the graphical session: connector held
Off for 25 s with the inhibitor active (X idle 892 s -> 917 s), xset q reports DPMS Enabled,
and systemd-inhibit --list shows mintupdate ... shutdown:sleep block. Before the patch the same
test had the panel back on 0.2 s after Inhibit with DPMS Disabled.

xfce4-power-manager implements org.freedesktop.PowerManagement.Inhibit by
disabling DPMS, which powers a blanked panel back on. Every scheduled refresh
therefore lights the monitor of an idle machine, and it stays lit for a full
DPMS timeout afterwards.

Use a logind block inhibitor on Xfce instead. It blocks sleep and shutdown
with no display side effects, and the fd is released automatically if we exit
unexpectedly. Falls back to the old interface if logind is unavailable.
@mtwebster

Copy link
Copy Markdown
Member

I'd like to hold off on this for a month or so until we start evaluating packages for the next Mint release.

We'll probably ship the newer Xfce (4.20+), and it looks like there are improvements in power management there. We may even be able to use Gtk.Application.inhibit/uninhibit() instead of calling a session manager ourselves (commit a6a9f57 made mintupdate a GApplication. It's trivial to use GtkApplication instead).

We may still end up needing both logind and session manager involvement, but I want to wait until we have a clearer picture (and a usable desktop to test on).

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.

Scheduled refresh wakes the monitor on Xfce — the power-management inhibitor disables DPMS

2 participants