Skip to content

topbar: stop Windows' own Start menu opening on lone Win presses - #182

Open
2sulraw wants to merge 1 commit into
Lemxy:mainfrom
2sulraw:fix/win-start-menu
Open

2sulraw wants to merge 1 commit into
Lemxy:mainfrom
2sulraw:fix/win-start-menu

Conversation

@2sulraw

@2sulraw 2sulraw commented Nov 25, 2026

Copy link
Copy Markdown

Problem

In overlay mode (real explorer.exe running), pressing the Win key to open WinRust's Start menu sometimes also opened Windows' own Start menu — until the Windows Start was dismissed. The Win key itself toggled wrong; a second Win press would clear it.

Cause

kb_hook injected the 0xE8 (unused-key) chord on a lone Win release, but the real Win-up event was already queued ahead of that injection. The shell's Start handler sometimes saw the Win-up with no intervening key and opened the native Start menu.

Fix

  • Swallow the real Win release (return 1) when the Win key was pressed alone.
  • Instead inject 0xE8 followed by a synthetic Win-up, so the shell always sees an intervening key and never opens its own Start.
  • Chords (Win+E/D/I/etc.) are unaffected: any Win+key press clears WIN_ALONE before the release, so they fall through unchanged.

Files: plugins/topbar/src/run.rs (kb_hook Win block), plugins/topbar/src/main.rs (new key_up helper).

Tested

  • Installed to C:\Program Files\topbar\topbar.exe and running; lone Win taps open only WinRust Start, Win toggle still closes on second press.
  • Win+E / Win+D / Win+I / Win+R / Win+1..9 still work.

A lone Win release opened Windows' Start along with ours: the E8 sent from the release hook was queued behind the release already being dispatched, so the shell sometimes saw no other key in time. Swallow the real release and hand the shell an E8 followed by a synthetic Win-up (our hook skips injected events). Chords are untouched: a Win+key clears WIN_ALONE before the release, so that path never runs.
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