DPMS: Don't wake display from input when timeouts are disabled

When DPMS is active, `mieqProcessInputEvents()` unconditionally
switches the display back to `DPMSModeOn` for every input event.

This prevents systems from keeping the display powered off while still
allowing applications to use input devices when DPMS is externally
managed by disabling all screen-saver and DPMS timeouts.

When all screen-saver and DPMS timeouts are disabled, the current DPMS
state is assumed to be externally managed and should not be overridden
by input activity.

Keep input processing unchanged so devices such as media buttons remain
usable while the display is off.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2287>
This commit is contained in:
Ivaylo Dimitrov 2026-08-25 19:17:35 +03:00 • committed by Marge Bot
commit 975453b1aa

View file

@ -556,7 +556,13 @@ mieqProcessInputEvents(void)
else if (DPMSPowerLevel != DPMSModeOn)
SetScreenSaverTimer();
if (DPMSPowerLevel != DPMSModeOn)
/* Only allow input activity to wake the display when an automatic
* screen-saver or DPMS timeout is configured. If all timeouts are
* disabled, the current DPMS state is assumed to be externally managed
* and must not be overridden by input activity. */
if (DPMSPowerLevel != DPMSModeOn &&
(ScreenSaverTime > 0 || DPMSStandbyTime > 0 ||
DPMSSuspendTime > 0 || DPMSOffTime > 0))
DPMSSet(serverClient, DPMSModeOn);
#endif