omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Lock screen leaves the display on indefinitely after a volume/media key wakes it while locked

Open theharshl opened this issue 2 weeks ago • 2 comments

System details

Omarchy 4.5.0-3 (also seen on 4.0.6-1) · Kernel 7.2.8-9-omarchy · Hyprland 0.56.2 · Quickshell 0.3.2.r7 · CPU: Intel i7-13700K · GPU: NVIDIA RTX 2060 SUPER (proprietary) · 1× DisplayPort monitor

The relevant files on quattro are identical to 4.5.0.

What's wrong?

When a locked session's display is woken by input that the lock screen itself doesn't receive, the display stays on until someone comes back. Most often this is a volume/mute/media key. The lock never blanks it again.

In practice, about half the time I come back to the machine, the monitor has been sitting lit at the password prompt for hours.

Steps to reproduce

  1. Lock (omarchy system lock) and wait ~5s for the lock to turn the display off.
  2. Without touching anything else, press Volume Down (or any key bound with locked = true). Headsets with a volume wheel, USB DACs and keyboards with media keys all send these on their own: wheel bumps, headset power on/off, etc.
  3. The display turns on, and it stays on indefinitely.

Control: in step 2, press Shift instead. The display turns on and the lock blanks it again after 5s, as intended.

Reproducible without hardware using a uinput keyboard (needs root for /dev/uinput, no dependencies):

inject.py
#!/usr/bin/env python3
# sudo python3 inject.py 114 115   -> KEY_VOLUMEDOWN, KEY_VOLUMEUP
import fcntl, os, struct, sys, time
UI_SET_EVBIT, UI_SET_KEYBIT = 0x40045564, 0x40045565
UI_DEV_SETUP, UI_DEV_CREATE, UI_DEV_DESTROY = 0x405C5503, 0x5501, 0x5502
codes = [int(c) for c in sys.argv[1:]]
fd = os.open("/dev/uinput", os.O_WRONLY | os.O_NONBLOCK)
fcntl.ioctl(fd, UI_SET_EVBIT, 1)
for c in codes: fcntl.ioctl(fd, UI_SET_KEYBIT, c)
fcntl.ioctl(fd, UI_DEV_SETUP, struct.pack("HHHH80sI", 3, 0x1234, 0x5678, 1, b"wake-test", 0))
fcntl.ioctl(fd, UI_DEV_CREATE); time.sleep(1.5)
for c in codes:
    for v in (1, 0):
        os.write(fd, struct.pack("llHHi", 0, 0, 1, c, v)); os.write(fd, struct.pack("llHHi", 0, 0, 0, 0, 0)); time.sleep(0.05)
    time.sleep(0.3)
time.sleep(0.5); fcntl.ioctl(fd, UI_DEV_DESTROY)

Measured run (hyprctl monitors -j | jq '.[0].dpmsStatus'):

11:17:05 lock
11:17:17 +12s after lock: dpms=false   lock blanked, as expected
11:17:17 inject KEY_VOLUMEDOWN + KEY_VOLUMEUP
11:17:21 +2s:  dpms=true               Hyprland woke on the key press
11:17:47 +27s: dpms=true               still on; nothing will turn it off
11:17:47 inject KEY_LEFTSHIFT
11:17:59 +10s: dpms=false              lock saw this one and re-blanked

Expected

Whatever wakes the display while locked, it goes dark again after the lock's 5s run-up once input stops.

Root cause

  • Hyprland wakes on any input. default/hypr/input.lua sets key_press_enables_dpms = true and mouse_move_enables_dpms = true, so Hyprland enables DPMS on every key press or pointer motion.
  • The lock only re-arms its blank on input to its own surface. In shell/plugins/lock/Service.qml, idleBlankTimer (5s) is re-armed only through runWake(). That is reached via LockView.wakeRequested (MouseArea.onPositionChanged/onClicked, passwordInput Keys.onPressed/onTextChanged), plus submitPassword and new screens.
  • Bound keys never reach the lock. default/hypr/bindings/media.lua binds XF86AudioRaiseVolume, XF86AudioLowerVolume, XF86AudioMute, XF86AudioMicMute, brightness keys, etc. with locked = true. Hyprland consumes them even on the lock screen, so the password field never sees them, runWake() never runs, and idleBlankTimer is never re-armed.
  • Nothing else blanks while locked. The idle service skips the screensaver when locked, and its later lock-timeout calls omarchy-system-lock, which finds the session already locked and does nothing visible.

Any other input that Hyprland counts but the lock surface doesn't get should behave the same way, e.g. pointer motion pinned against a screen edge, where the position doesn't change. Volume keys are the reliable trigger.

Suggested fix

Have the lock blank based on compositor idleness rather than its own surface's input. For example, in lock/Service.qml:

IdleMonitor {
  enabled: root.lockRequested
  timeout: 5
  respectInhibitors: false
  onIsIdleChanged: if (isIdle && root.lockRequested && !root.authenticatingPassword) root.runBlank()
}

ext-idle-notify sees every input Hyprland processes, including keys consumed by binds. That covers both the surface-input path and the bound-key path. It could replace idleBlankTimer's re-arming, or sit alongside it.

Workaround

A user-level hypridle listener: after 30s of no input, if omarchy-shell lock isLocked is true and a display is lit, run omarchy-brightness-display off. Inhibitors are ignored, since a fullscreen window behind the lock shouldn't keep the display lit. Verified with the same injection: the display is back off 30s after the volume key.

Related

#17190 covers the opposite symptom. There, pointer jitter reaches the lock surface, so the display wakes and blanks again in a loop. Here, the input never reaches the lock surface, so the display wakes once and never blanks again. The two are independent, and fixing one does not fix the other.

theharshl avatar Nov 13 '26 18:11 theharshl

I hit this on a Dell XPS 9320 and opened a PR for it: #18595. It re-arms the lock's blank timer after volume, mute, brightness, media and touchpad keys. I've only tried it on a laptop, so a run on your NVIDIA desktop with the uinput script would be a good check.

raffsmagic avatar Nov 13 '26 19:11 raffsmagic

I read the report, the current lock and media-key code, and PR #18595. That PR already includes Fixes #18781, and your NVIDIA test of its earlier revision is recorded there. No new reproduction or tests ran in this session.

Codex performed this review (reasoning effort is not exposed to the session); no second model reviewed the issue in this run. Classification remains unsettled because the classification reviewer, deepseek-v4p1-flash, returned no classification. The general reviewer availability check passed, so this is a classification failure rather than a general reviewer outage. This item is waiting for classification review; #18595 remains the existing fix under review.

omarchybot avatar Nov 19 '26 03:11 omarchybot