feat: allow macOS tray to maintain position (#48076)

This commit is contained in:
Shelley Vohr 2025-08-21 10:41:30 +02:00 committed by GitHub
commit ce91f050d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 101 additions and 34 deletions

View file

@ -48,7 +48,7 @@ class Tray final : public gin::Wrappable<Tray>,
// gin_helper::Constructible
static gin::Handle<Tray> New(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> image,
std::optional<UUID> guid,
std::optional<base::Uuid> guid,
gin::Arguments* args);
static void FillObjectTemplate(v8::Isolate*, v8::Local<v8::ObjectTemplate>);
@ -68,7 +68,7 @@ class Tray final : public gin::Wrappable<Tray>,
private:
Tray(v8::Isolate* isolate,
v8::Local<v8::Value> image,
std::optional<UUID> guid);
std::optional<base::Uuid> guid);
~Tray() override;
// TrayIconObserver:
@ -114,10 +114,12 @@ class Tray final : public gin::Wrappable<Tray>,
void SetContextMenu(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> arg);
gfx::Rect GetBounds();
v8::Local<v8::Value> GetGUID();
bool CheckAlive();
v8::Global<v8::Value> menu_;
std::optional<base::Uuid> guid_;
std::unique_ptr<TrayIcon> tray_icon_;
};