fix(Windows): Handle thread WM_QUIT and fix message dispatch#100
Merged
Conversation
Change tray_loop to read from the thread message queue (use NULL hwnd) and check GetMessage/PeekMessage return values before dispatching. This prevents DispatchMessage from being called with an uninitialized MSG and ensures WM_QUIT posted to the thread queue is observed (returns -1 or 0 appropriately). Also add a unit test (TestTrayLoopHandlesThreadQuitMessage) that posts WM_QUIT and verifies tray_loop detects the quit message.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #100 +/- ##
==========================================
+ Coverage 65.79% 73.06% +7.27%
==========================================
Files 4 4
Lines 421 427 +6
Branches 81 83 +2
==========================================
+ Hits 277 312 +35
+ Misses 95 72 -23
+ Partials 49 43 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Screenshot ComparisonPR #100 screenshots vs Matrix:
|
| Image | Baseline | PR |
|---|---|---|
tray_icon_initial.png |
||
tray_menu_checkbox_checked.png |
![]() |
|
tray_menu_checkbox_unchecked.png |
![]() |
|
tray_menu_shown.png |
![]() |
|
tray_notification_displayed.png |
![]() |
Matrix: Linux-libayatana-appindicator3-dev
| Image | Baseline | PR |
|---|---|---|
tray_icon_initial.png |
||
tray_menu_checkbox_checked.png |
![]() |
|
tray_menu_checkbox_unchecked.png |
![]() |
|
tray_menu_shown.png |
![]() |
|
tray_notification_displayed.png |
![]() |
Matrix: Windows
| Image | Baseline | PR |
|---|---|---|
tray_icon_initial.png |
||
tray_menu_checkbox_checked.png |
![]() |
|
tray_menu_checkbox_unchecked.png |
![]() |
|
tray_menu_shown.png |
![]() |
|
tray_notification_displayed.png |
![]() |
Matrix: macOS
| Image | Baseline | PR |
|---|---|---|
tray_icon_initial.png |
||
tray_menu_checkbox_checked.png |
![]() |
|
tray_menu_checkbox_unchecked.png |
![]() |
|
tray_menu_shown.png |
![]() |
|
tray_notification_displayed.png |
![]() |
3 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.



















Description
Change tray_loop to read from the thread message queue (use NULL hwnd) and check GetMessage/PeekMessage return values before dispatching. This prevents DispatchMessage from being called with an uninitialized MSG and ensures WM_QUIT posted to the thread queue is observed (returns -1 or 0 appropriately). Also add a unit test (TestTrayLoopHandlesThreadQuitMessage) that posts WM_QUIT and verifies tray_loop detects the quit message.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage