Repository navigation
fix(win10): tray popup positioning and global hotkey reliability - #37
Merged
Merged
Conversation
Improve Win10 tray context window positioning and make the Ctrl+Alt+Shift+C Quick Send hotkey reliably register and foreground the dialog.
Fix 1: QuickSendDialog Closed handler race condition (App.xaml.cs) - Use ReferenceEquals to only null the field when the closing dialog is the current one, preventing a late Closed event from clearing a newly-created replacement dialog. Fix 2: Check PostMessage/Wait results in Register() (GlobalHotkeyService.cs) - Treat PostMessage failure or wait timeout as deterministic failures with clear logging, preventing _registered from being out of sync. Fix 3: EnsureMessageLoop recovery (GlobalHotkeyService.cs) - Check IsAlive and _hwnd, reset state and recreate the thread if the previous message loop died, so the service can recover. Fix 4: Dispose cleanup (GlobalHotkeyService.cs) - Join the thread before DestroyWindow so the loop can exit cleanly. - Dispose ManualResetEventSlim instances to prevent resource leaks. Co-authored-by: xx299x <[email protected]>
shanselman
force-pushed
the
fix/win10-tray-hotkey-reviewed
branch
from
March 17, 2026 01:15
6608c88 to
98fa2d5
Compare
4 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is based on @xx299x's excellent work in #31, with additional fixes addressing all the Copilot review comments from that PR.
Original changes (by @xx299x)
Review fixes applied on top
ReferenceEqualsso a lateClosedevent from an old dialog doesn't null the reference to a newly-created replacement._registeredin an unknown state.IsAliveand_hwnd, reset and recreate the thread if the previous message loop died.DestroyWindowso the loop exits cleanly; disposeManualResetEventSliminstances.Supersedes #31. Credit to @xx299x for the original investigation and fix — their commit is preserved with full authorship.