Skip to content

fix(tray): System tray right-click Menu not displaying#1497

Merged
pomianowski merged 11 commits intolepoco:mainfrom
joesdu:main
Nov 7, 2025
Merged

fix(tray): System tray right-click Menu not displaying#1497
pomianowski merged 11 commits intolepoco:mainfrom
joesdu:main

Conversation

@joesdu
Copy link
Copy Markdown
Contributor

@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 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
Copy Markdown
Contributor

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

Comment thread src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Outdated
Comment thread src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Outdated
Comment thread src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Outdated
Comment thread src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Outdated
joesdu and others added 4 commits July 25, 2025 19:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zCri
Copy link
Copy Markdown

zCri commented Jul 27, 2025

+1

Comment thread src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs Outdated
Comment thread src/Wpf.Ui.Tray/Controls/NotifyIcon.cs Outdated
@chucker
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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.

@IOL0ol1
Copy link
Copy Markdown
Contributor

IOL0ol1 commented Sep 11, 2025

@joesdu @chucker hi,i have a good idea.
#1534

@maihcx maihcx mentioned this pull request Oct 14, 2025
@pomianowski pomianowski changed the title Fix system tray right-click menu not displaying fix(tray): System tray right-click Menu not displaying Nov 7, 2025
@pomianowski pomianowski merged commit 90f8b88 into lepoco:main Nov 7, 2025
2 checks passed
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.

6 participants