Skip to content

Prevent first-keystroke UI stalls by suppressing WM_GETOBJECT on the launcher window - #4596

Draft
jjw24 with Copilot wants to merge 2 commits into
devfrom
copilot/bug-fix-flowlauncher-freezing
Draft

Prevent first-keystroke UI stalls by suppressing WM_GETOBJECT on the launcher window#4596
jjw24 with Copilot wants to merge 2 commits into
devfrom
copilot/bug-fix-flowlauncher-freezing

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Typing the first character could freeze Flow Launcher for ~15 seconds on affected systems. The stall was traced to the main WPF window servicing WM_GETOBJECT and entering the UI Automation provider path on the UI thread.

  • Main window message handling

    • Intercept WM_GETOBJECT in MainWindow's existing HwndSource hook.
    • Mark the message as handled and return immediately so the launcher window does not enter WPF's synchronous automation-provider path during typing.
    • Scope is limited to the main search window; existing handling for other window messages remains unchanged.
  • Behavioral boundary

    • Only WM_GETOBJECT is suppressed.
    • Other messages continue through the current WndProc switch unchanged.
  • Regression coverage

    • Add a focused test that verifies the suppression predicate matches WM_GETOBJECT and does not suppress unrelated messages.
private const int WmGetObject = 0x003D;

private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    if (msg == WmGetObject)
    {
        handled = true;
        return IntPtr.Zero;
    }

    // existing message handling...
}

Copilot AI linked an issue Jul 30, 2026 that may be closed by this pull request
3 tasks
Copilot AI changed the title [WIP] Fix Flowlauncher freezing after typing first character Prevent first-keystroke UI stalls by suppressing WM_GETOBJECT on the launcher window Jul 30, 2026
Copilot AI requested a review from jjw24 July 30, 2026 12:12
Copilot finished work on behalf of jjw24 July 30, 2026 12:12
@jjw24 jjw24 removed their assignment Jul 30, 2026
Copilot finished work on behalf of jjw24 July 30, 2026 12:18
Copilot finished work on behalf of jjw24 July 30, 2026 12:24
Copilot finished work on behalf of jjw24 July 30, 2026 12:30
@Jack251970

Copy link
Copy Markdown
Member

@codex Review it

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81ac6c3896

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +603 to +606
if (ShouldSuppressWindowAutomationMessage(msg))
{
handled = true;
return IntPtr.Zero;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not swallow every WM_GETOBJECT request

When Narrator, a screen reader, or another UI Automation/MSAA client queries the launcher, it relies on WM_GETOBJECT to obtain WPF's accessibility provider. Returning zero with handled = true prevents HwndSource from servicing every such request, making the query box and results—including the explicitly configured AutomationProperties.Name in MainWindow.xaml—unavailable to assistive technology. The stall mitigation must preserve normal accessibility-provider requests rather than unconditionally consuming this message.

Useful? React with 👍 / 👎.

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.

BUG: Flowlauncher freezing after typing in one character

3 participants