-
-
Notifications
You must be signed in to change notification settings - Fork 392
Fix: Ensure QueryTextBox receives focus after Win+R & new FocusQueryTextBox api function #3568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughA new method, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ShellPlugin
participant PublicAPI
participant MainViewModel
participant MainWindow
User->>ShellPlugin: Press Win+R
ShellPlugin->>PublicAPI: ShowMainWindow()
PublicAPI->>MainWindow: Show()
Note right of ShellPlugin: Wait 50ms asynchronously
ShellPlugin->>PublicAPI: ChangeQuery(newQuery)
PublicAPI->>MainViewModel: ChangeQuery(newQuery)
ShellPlugin->>PublicAPI: FocusQueryTextBox()
PublicAPI->>MainViewModel: FocusQueryTextBox()
MainViewModel->>MainWindow: Set keyboard focus on QueryTextBox
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: s.b. workaround(s)
If the flagged items are 🤯 false positivesIf items relate to a ...
|
🥷 Code experts: Jack251970 Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
What's the PR
Reproduce
Problem
When launching Flow Launcher via the Win+R shortcut (with the Shell plugin's setting enabled), the main window appears, but the input box (QueryTextBox) does not receive focus, preventing immediate typing.
Cause
This happens because Win+R is a system-reserved shortcut. Even though the plugin intercepts the keyboard event and shows the main window, Windows continues to process the Win key, and briefly reclaims focus, typically sending it to the Start menu or background. As a result, any Focus() call issued immediately after ShowMainWindow() is overridden.
Solution
To work around the OS-level focus interference:
We introduced a slight delay (Task.Delay) after showing the main window before explicitly calling FocusQueryTextBox().
This ensures that Windows has completed handling the Win key and the plugin regains control to correctly apply focus.