Skip to content

Fix Windows 10 Full-screen Start Menu search Z-Order bug on Windows 11 - #5179

Open
envergokmenn wants to merge 1 commit into
valinet:masterfrom
envergokmenn:fix/fullscreen-start-search
Open

Fix Windows 10 Full-screen Start Menu search Z-Order bug on Windows 11#5179
envergokmenn wants to merge 1 commit into
valinet:masterfrom
envergokmenn:fix/fullscreen-start-search

Conversation

@envergokmenn

Copy link
Copy Markdown

PR Description

Problem

When using ExplorerPatcher on Windows 11 with the Windows 10 Start menu style and "Full screen Start" enabled (ForceStartSize = 2):

  • Pressing the Win key properly opens the full-screen Windows 10 tile Start Menu.
  • Typing any key to search causes the search UI (SearchHost.exe) to get stuck behind StartMenuExperienceHost.exe due to Windows 11 DWM / CoreWindow Z-Order isolation.
  • The visual search box never appears, or flickers and is immediately dismissed. Keystrokes are swallowed or blindly typed into an invisible search box.
  • Users have historically had to disable "Full screen Start" to use search.

Root Cause

  1. On Windows 11, SearchHost.exe is a separate XAML host from StartMenuExperienceHost.exe.
  2. In full-screen mode, StartMenuExperienceHost claims exclusive foreground Z-order and does not yield when SearchHost activates.
  3. Standard Win32 Z-Order APIs (SetForegroundWindow, BringWindowToTop) are blocked by modern CoreWindow isolation.

Solution

This PR adds a dedicated, lightweight native C module (StartSearchFix.h / StartSearchFix.c) that hooks the keyboard (WH_KEYBOARD_LL) to orchestrate a seamless, flicker-free transition:

  1. Detection: Detects typing keystrokes while the foreground window belongs to StartMenuExperienceHost or SearchHost.
  2. Buffer & Swallow: Swallows the initial trigger key and buffers any incoming keys during transition so no user typing is lost.
  3. Clean Start Dismissal (ESC + 180ms):
    • Synthesizes ESC keydown and keyup.
    • Waits 180ms (settle time) allowing StartMenuExperienceHost dismissal animation to complete cleanly without killing the subsequent Search window.
  4. Invoke Native Windows 11 Search (Win + S):
    • Sends Win + S with hardware scan codes (VK_LWIN 0x5B scan 0x5B, VK_S 0x53 scan 0x1F).
    • (Note: Never touches synthetic Alt or Ctrl release, which would trigger Windows Menu Bar mode and break Alt+Tab).
  5. Search Flyout Settle Time (400ms):
    • Waits 400ms for the Windows 11 Search flyout animation to complete and the search box cursor | to take focus.
  6. Hardware Scan Code Replay:
    • Replays all buffered keys using keybd_event with both Virtual Key and hardware scan codes (MapVirtualKeyW).

Changes

  • Added ExplorerPatcher/StartSearchFix.h & ExplorerPatcher/StartSearchFix.c.
  • Registered StartSearchFix.c in ExplorerPatcher.vcxproj and ExplorerPatcher.vcxproj.filters.
  • Initialized via StartSearchFix_Init() in dllmain.c (Inject) and cleaned up in DLL_PROCESS_DETACH.
  • Zero performance impact on normal typing (<0.005ms hook callback due to PID cache).
  • Alt+Tab, Win+D, and all other system shortcuts remain 100% functional.

@envergokmenn
envergokmenn marked this pull request as ready for review September 9, 2026 17:22
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