Skip to content

Conversation

joesdu
Copy link

@joesdu joesdu commented Jul 25, 2025

Fix system tray right-click menu not displaying

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?

Issue Number: [#1490 ]

What is the new behavior?

Other information

@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 11:44
@joesdu joesdu requested a review from pomianowski as a code owner July 25, 2025 11:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where the system tray right-click menu was not displaying properly by improving menu positioning and data context handling.

Key changes:

  • Modified menu placement to use direct property setting instead of ContextMenuService
  • Added data context synchronization between NotifyIcon and its ContextMenu
  • Fixed property assignment to use the internal manager instead of the control itself

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Wpf.Ui.Tray/Internal/InternalNotifyIconManager.cs Updated menu placement logic to use direct property setting for better positioning
src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Added data context synchronization, fixed property assignments, and improved menu initialization

@zCri
Copy link

zCri commented Jul 27, 2025

+1

@chucker
Copy link
Collaborator

chucker commented Aug 24, 2025

Issue Number: [https://github.com//issues/1490 ]

Probably not the one you meant to link?

joesdu added 2 commits August 25, 2025 09:12
Commented out the line that updates Menu's DataContext to prevent potential issues.
@joesdu
Copy link
Author

joesdu commented Aug 25, 2025

Issue Number: [https://github.com//issues/1490 ]

Probably not the one you meant to link?

There are two issues mentioned in this issue, which were not mentioned separately at the time, so the names of the issues are a bit inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet gallery WPF UI Gallery PR Pull request release ⭐ top pull request Top pull request. tray
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants