Skip to content

refactor(tray): replace QMenu with native Win32 popup menu#887

Merged
amnweb merged 2 commits intomainfrom
refactor/tray-menu
Apr 28, 2026
Merged

refactor(tray): replace QMenu with native Win32 popup menu#887
amnweb merged 2 commits intomainfrom
refactor/tray-menu

Conversation

@amnweb
Copy link
Copy Markdown
Owner

@amnweb amnweb commented Apr 28, 2026

Replaced the QMenu-based tray menu with a native Win32 popup menu.

The old menu was a styled QMenu which had some issues, it required an event filter to close on outside clicks, and the styling was hardcoded CSS that didn't always feel native. This switches to win32gui.TrackPopupMenu which gives us a proper Windows context menu that behaves exactly like any other system tray menu.

Also cleaned up the Komorebi/GlazeWM config handling. Previously the commands had hardcoded defaults so they'd always show up in the tray even if you weren't using those WMs. Now they default to None and the submenu only appears if you've actually set commands in your config AND the binary is on your PATH. Individual items (Start/Stop/Reload) are also skipped if their command isn't set.

Small fixes:

  • Renamed _chek_startup typo to _check_startup
  • Removed eventFilter and _load_context_menu which are no longer needed

amnweb added 2 commits April 28, 2026 02:21
…zeWMConfig

- This change allows for more flexible configuration by requiring explicit command definitions.
- Replaced PyQt6 QMenu context menu with native win32gui popup menu
- Added dark mode support via undocumented uxtheme.dll ordinals
- Removed eventFilter and _load_context_menu in favour of _show_context_menu
- WM commands now default to None, WM submenus are config-driven
- Fixed _chek_startup typo
@amnweb amnweb merged commit 5f7ce5e into main Apr 28, 2026
6 checks passed
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