Skip to content

bug(text): single-key shortcuts stop working after closing Popup Input dialog #7

@hthienloc

Description

@hthienloc

Description

When using the new Popup Input mode for the Text Note tool, after committing a text note (pressing Enter / clicking Add) or cancelling it, all single-key keyboard shortcuts (such as 1 for Pen, 2 for Arrow, q/w/e/r for other tools) stop working entirely.

Interestingly, key combinations containing modifiers (like Ctrl + C for copy, Ctrl + X for cropping) still function correctly.

The issue only occurs in Popup Input mode; the default Direct mode operates flawlessly.

Technical Root Cause Analysis

  1. Focus Tree Disconnect: The global keyboard shortcuts are attached to modalFocusScope (Branch A of the modal). The dynamic capture contents, including the Popup overlay, reside inside contentRoot (Branch B).
  2. Overlay Focus Limbo: When textInputField inside the Popup grabs active focus, the focus shifts to the Popup overlay context. When the Popup is closed, QML's focus system fails to cleanly restore active focus to modalFocusScope because it is an empty FocusScope container without focusable graphical leaves.
  3. Event Consumption: This leaves the keyboard focus in a limbo state where single-character events are consumed or ignored by the fallback focus target, while control modifier events (Ctrl + Key) still bubble up to the window level.

Temporary Workaround

Switch the Text Input Mode in Settings to Direct (default), which does not use the Popup overlay and avoids the focus routing issue entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions