Repository navigation
fix(windows): closing the window without a tray icon minimizes it - #1291
Merged
Merged
Conversation
With the tray on, closing the window hid it, whether or not the icon was up: where it could not go up the app was left running with no way back but launching it again (#1107). Closing now tries to put the icon up first, and without one the window is minimized, its taskbar button left. The icon failing to go up is written to events.log (Shell_NotifyIcon's error), once until it does, to find out why. Refs #1107 Co-Authored-By: BaoCode <noreply@baocode.dev>
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.
Refs #1107
The reporter's tray icon never registered on 2.0.1 (
Shell_NotifyIconGetRect→E_FAIL), andWM_CLOSEhid the window anyway, leaving the app unreachable. Root cause not found yet, so this PR does two things:WM_CLOSEwith the tray on: if the icon is not up, tryShowIcon()once; if it is still not up,SW_MINIMIZEinstead ofSW_HIDE, so the taskbar button stays.NIM_ADDandNIM_MODIFYfail, the runner sendstrayFailed(GetLastError())overbaocode/attention, and Dart writes[tray] icon not added: error Nto events.log. It is sent once and reset when the icon goes up, so the 15 s check does not repeat it.Not compiled locally (macOS). The change follows the existing
channel_->InvokeMethod/ShowIconpatterns; needs a Windows check by the maintainer.🤖 Generated with BaoCode