Skip to content

Conversation

@apachezy
Copy link
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

The current TitleBar already handles right‑click system menus via HwndSourceHook. However, the MouseRightButtonUp event is also subscribed and unconditionally pops up the system menu, resulting in:

  • Duplicate system‑menu handling in TitleBar; a system menu always appears on right‑click.

  • Right‑click menus of controls inside TrailingContent cannot be shown.

TitleBar-RightButton-Issue1 TitleBar-RightButton-Issue2

Issue Number: N/A

What is the new behavior?

  • The handler for the MouseRightButtonUp event has been temporarily commented out (code is preserved). It can be restored later if a WPF‑based system‑menu implementation is needed in the future.

  • After the change, both the system menu and control‑specific context menus now work correctly:

TitleBar-RightButton-Fixed1 TitleBar-RightButton-Fixed2

Other information

@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. PR Pull request dotnet release titlebar Titlebar updates labels Dec 16, 2025
@pomianowski pomianowski changed the title fix(controls): remove duplicate right‑click event handling in TitleBar fix(controls): Remove duplicate right‑click event handling in TitleBar Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release titlebar Titlebar updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant