Skip to content

fix(slideout): yield keyboard focus when modal is open on same screen#2902

Open
hthienloc wants to merge 1 commit into
AvengeMedia:masterfrom
hthienloc:fix/slideout-yield-focus-when-modal-open
Open

fix(slideout): yield keyboard focus when modal is open on same screen#2902
hthienloc wants to merge 1 commit into
AvengeMedia:masterfrom
hthienloc:fix/slideout-yield-focus-when-modal-open

Conversation

@hthienloc

@hthienloc hthienloc commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

Fix keyboard focus being stolen by Notepad (slideout) when Launcher is opened after it.

Root cause: DankSlideout always held WlrKeyboardFocus.OnDemand regardless of modals. When Launcher opened (also requesting keyboard focus), the Wayland compositor had no clear priority between the two surfaces, leaving focus on the slideout.

Fix:

  • ModalManager.qml — Made currentModalsByScreen reactive (clone object on mutation) so QML bindings re-evaluate when modals open/close
  • DankSlideout.qml — Yields keyboard focus (None) when a modal is active on the same screen, allowing the Launcher (or any modal) to claim focus exclusively

Known limitation: When the launcher closes, keyboard focus does not automatically return to the Notepad slideout.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

(none)

Screenshots / video

(N/A — keyboard focus behavior, no visual change)

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: https://github.com/AvengeMedia/DankLinux-Docs

DankSlideout always held WlrKeyboardFocus.OnDemand regardless of modals,
causing Notepad to steal focus back when Launcher was opened.

ModalManager: clone currentModalsByScreen on mutation so QML bindings
re-evaluate when modals open/close.
DankSlideout: set keyboardFocus to None while a modal is active on the
same screen, letting the modal (launcher) claim focus exclusively.
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.

1 participant