Repository navigation
Conversation
Qt clears the lock window's focus when the seat loses its keyboard across a suspend and never re-activates the window on resume, so typing did nothing until a click. Take focus back whenever it is lost while input is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013T5dtrbgarMEm8jyNFcGmX
[Medium impact] The PR appears safe to merge. SummaryKeeps the lock password field focused by scheduling
Reviews (1) · Last reviewed commit: "Keep lock password field focused after r..." · Reviewed by Greptile |
|
Thanks for the careful trace, @cashcon57. The Qt explanation is clear, and the fix in this pull request is sound. Since you opened it, What was checked: I read this diff against current Second opinion: Codex Medium and muse-wonder (via pi, thinking high) each read both diffs. Neither found a defect in this one. Neither found any focus-loss path that this pull request recovers and #17277 doesn't, and the two handlers together cause no conflict. Both concluded that #17277 supersedes this. Codex also pointed out that Qt changes the window's focus item before it changes the field's What happens next: this is waiting on the maintainer, and my recommendation to them is to close it as covered by #17277. If typing after a resume still goes nowhere on current |
Hey! This fixes something that had been bugging me for a while: after waking from suspend, the lock screen's password field looks ready, but typing does nothing until you click somewhere on the screen. Locking without a suspend (Super+Ctrl+L, idle lock) was always fine.
The fix: the password field takes focus back whenever it loses it while input is on. It's one handler on the
TextInputinLockView.qml. While a password is being checked the field is disabled, and that case is left alone, since Qt already restores focus when the field re-enables (I checked: a wrong password never had this problem).Why it happens: I traced it to Qt, not Omarchy or Hyprland.
wl_keyboardgets anenterfor the lock surface right away. From aWAYLAND_DEBUGtrace of the shell across a suspend:enterbut never re-activates the window. In Qt 6.12's Wayland plugin,QWaylandInputDevice::Keyboard::~Keyboard()callsQWindowSystemInterface::handleFocusWindowChanged(nullptr)directly, soQWaylandDisplaynever clearsmLastKeyboardFocusormActiveWindows. When the replacement keyboard'senterarrives,handleKeyboardFocusChanged()sees the same window as last time and returns early. The window stays inactive, itsactiveFocusItemstays null, and keys are delivered to it with nothing focused to take them. It's still the same in Qt'sdevbranch.forceActiveFocus()while the window is in that inactive state does work (that's exactly what the existing click handler does), which is why this fix is enough.About the real fix: I know the proper fix belongs in Qt, and I'm planning to report it there. But getting a change through Qt's process takes a long time, and in the meantime every suspend on Omarchy hits this. So this works around it in the lock screen, in a way that does nothing once Qt is fixed: if focus is never lost on resume, the handler never runs. No version checks, nothing to remove later. It also covers any other way the field might lose focus that I haven't found.
Testing:
LockView.qmlpass on currentquattro:lock-appear-budget,lock-autorepeat,lock-fingerprint-indicator,lock-poster,video-background.LockViewwithout a window. A test that only moves focus between items wouldn't fail for the reason this change exists. Happy to add one if you'd like it shaped differently.Thanks for Omarchy, it's been really fun to tinker with!
🤖 Generated with Claude Code
https://claude.ai/code/session_013T5dtrbgarMEm8jyNFcGmX