-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat: allow macOS tray to maintain position #47838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should be in the constructor, not set after the fact.
In fact there is already a param for this for windows. new Tray(image, [guid])
. That guid
param is what does this on windows, we should just re-use the same param on macOS. Heck even make it a guid on macOS too, this name isn't user facing, just have folks assign it a static guid on both platforms.
@MarshallOfSound fair enough - the reason i didn't do that was that we already have an optional second parameter for |
No like, I'm saying use that existing second parameter, it's usecase is just a windows-specific version of your use case. I don't think it's a breaking change to add platform support for a given parameter. |
@MarshallOfSound oh gotcha - hm yeah i'll give it a go, easy enough! |
65515a4
to
84010ab
Compare
d632ec6
to
0787d3d
Compare
} | ||
|
||
Tray::~Tray() = default; | ||
|
||
// static | ||
gin::Handle<Tray> Tray::New(gin_helper::ErrorThrower thrower, | ||
v8::Local<v8::Value> image, | ||
std::optional<UUID> guid, | ||
std::optional<base::Uuid> guid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarshallOfSound easier to handle cross-platform and delegates parsing to upstream
0787d3d
to
df06d98
Compare
b6dbef5
to
f6dec18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Release Notes Persisted
|
I was unable to backport this PR to "37-x-y" cleanly; |
I was unable to backport this PR to "36-x-y" cleanly; |
I was unable to backport this PR to "38-x-y" cleanly; |
Description of Change
Closes #42154.
Fixes an issue where a tray icon on macOS would not maintain position across launches.
macOS allows setting an autosave name on an
NSStatusItem
, which enables the icon to maintain its position across launches. If a user creates and then closes a tray icon and then creates a new one with the same autosave name as the previously closed one, macOS will place it in the same position as the previous one with the same name.We do this by adding a feature to customize the autosave name.
Checklist
npm test
passesRelease Notes
Notes: Added
tray.{get|set}AutosaveName
to enable macOS tray icons to maintain position across launches.