Repository navigation
feat(workbench): add a show-system-tray-icon toggle - #1094
Conversation
2946e8f to
86ca93b
Compare
t8y2
left a comment
There was a problem hiding this comment.
Thanks for the work on this. Three items before merge:
- cmd/motty/main.go:380: the status.hasStatusArea() check was removed from requestClose. The default close action is stay-in-tray, so on a desktop where the status item cannot be created (e.g. Linux without a StatusNotifier host), closing the last window now hides it and keeps the process running with no icon and no way back except relaunching. Please keep quitting when the icon could not be shown (the user-hidden case can keep the new behavior), and add a test for that path.
- The issue (#1039) asks for a show/hide toggle. The rework of "Closing the window" goes beyond it and changes user-facing behavior. Please confirm that scope with the maintainer before it lands.
- persist_records_test.go:27 is not gofmt-clean (run gofmt -w). The comments at main.go:222-223 and 236-238 still describe the old behavior. The PR is also CONFLICTING with main, so please rebase.
General settings gain a switch beside Start at login that shows or hides the system tray icon. The choice belongs to this device and is read before the first window opens, so an icon the user turned off never flashes up. Hiding the icon brings back any window hiding behind it first so none is left unreachable. The close logic is left exactly as it was: closing hides to the background only when an icon is present, so with the icon hidden (or on a desktop that cannot show one) closing the last window quits as usual. Closes t8y2#1039
86ca93b to
0a75971
Compare
|
Thanks for the review — I've reworked the PR to keep it strictly to the toggle, addressing all three points:
The full workbench |
|
Thanks for the contribution! Merged in 06778e3, will be released in the next version. |
Summary
Adds a "Show system tray icon" switch to General settings, beside Start at login (#1039).
tray_icon_off) and read before the first window opens, so a hidden icon never flashes up. It is applied live throughOptions.SetTrayIcon.status.hasStatusArea()). With the icon hidden — or on a desktop that cannot show one — closing the last window quits as usual.Scope
This PR only adds the toggle. The "Closing the window" behavior is left exactly as upstream; no close-action rework is included.
Test plan
go test -race ./cmd/motty -run Tray(real status-item add/remove,ShowHidden).go test -race ./internal/workbench -run 'Tray|CloseAction|SavedStateField|StatusArea|WhatClosingDoes|ShowHidden'(toggle + remember across restart; incremental saves of a running window; restore-then-toggle; settings-reload-after-save; device-local field registration; upstream close behavior).-racesuite (batched): no data races; failure set identical to the pristine upstream baseline atbcb60df3on Windows (zero new failures).Closes #1039