Skip to content

Keep lock keyboard focus after lid-open resume - #12894

Closed
chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/7811-lock-focus-after-lid
Closed

chessing234 wants to merge 1 commit into
omacom:quattrofrom
chessing234:fix/7811-lock-focus-after-lid

Conversation

@chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Lid-open clamshell sync reloaded Hyprland under ext-session-lock, which left the lock surface visible with no keyboard focus (Fixes #7811).
  • Skip hyprctl reload while the session is locked and re-enable the internal panel in place; ignore Quickshell's FALLBACK placeholder when acquiring; restore password focus on wake and screen changes.

Test plan

  • bash test/shell.d/lock-focus-after-lid-test.sh
  • bash test/shell.d/monitor-recovery-test.sh
  • Undocked laptop: close lid (lock+suspend), open lid, type password without clicking the field

Made with Cursor

Skip hyprctl reload while the session is locked, ignore the FALLBACK
placeholder screen when acquiring, and restore password focus on wake
and screen changes.
@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

Two regressions were identified at a810359d982b: password submission aborts before authentication, and a conditional locked lid-open path overrides manual display disabling.

The focus helper aborts password submission

In Service.qml:71-75, lockView belongs to the component instantiated through WlSessionLock.surface, so it is not visible to the outer service function. if (lockView && ...) throws ReferenceError rather than safely checking for an absent view.

submitPassword(nonempty password)
  runWake()
    forceLockPasswordFocus()
      lockView lookup -> ReferenceError
  pendingPassword assignment, authentication flag, PAM start: not reached

An offscreen Quickshell diagnostic used the extracted production functions and real component-valued WlSessionLock.surface, with synthetic surface items and inert PAM/wake spies:

Case Exception PAM start calls
Baseline None 1
PR lockView is not defined 0
Diagnostic signal-based alternative None 1

Impact: Ordinary password unlocking aborts even without a lid transition. This does not establish a lock bypass or a failure of fingerprint authentication.

Suggested change: Emit a service-level focus-request signal and handle it inside each WlSessionLockSurface, where the local lockView is in scope. The diagnostic alternative reached PAM and delivered the request to both synthetic surface instances; actual compositor focus remains untested.

Locked lid opening can override the manual display-disable flag

In enable_internal(), the new enable_internal_output call runs before the manual-disable early return. A reachable sequence is:

Close lid while docked -> clamshell flag created
Toggle Laptop Display off on the external desktop -> manual flag added
Lock, then open lid with external display still active
  baseline: reload reapplies the remaining manual-disable rule
  PR: enable eval is sent, then the manual-disable guard returns

Impact: The internal output can be re-enabled contrary to the external-only preference, while its manual-disable flag remains present. Recorded command tests reproduced this ordering, not physical panel illumination.

Suggested change: Remove the obsolete clamshell flag, then honor the manual-disable/external-active guard before issuing the enable eval.

Test-only correction: lock-focus-after-lid-test.sh uses $TMPDIR under set -u without initializing it. With TMPDIR unset, it exits 1 with TMPDIR: unbound variable; supplying a private directory makes it pass. Create a test-owned mktemp -d directory and clean it up on exit.

Verified: In isolated command tests without the manual-disable flag, the changed branch replaces reload with an in-place monitor eval for locked or undetermined lock state, while retaining reload when unlocked. The configured scale and position are preserved in the emitted command.


Review information

Test scope: Pinned-source inspection, baseline/head command tests with mocked hardware/compositor boundaries, and offscreen QML diagnostics. No real lid/suspend cycle, compositor lock, keyboard delivery, or PAM authentication was exercised.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra initial inspection, independent Opus 5 and Astra technical reviews, followed by synthesis against targeted evidence and a separate Astra editorial check.

@chessing234

Copy link
Copy Markdown
Contributor Author

folding into #12245 — lid-open lock focus fix is on the lock fold now.

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.

2 participants