From f53995d5550db47f05db28afff9694f782996303 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Sat, 25 Jul 2015 20:56:35 -0700 Subject: [PATCH] Send bounding Rect on tray double click events --- atom/browser/api/atom_api_tray.cc | 4 ++-- atom/browser/api/atom_api_tray.h | 2 +- atom/browser/ui/tray_icon.cc | 4 ++-- atom/browser/ui/tray_icon.h | 2 +- atom/browser/ui/tray_icon_cocoa.mm | 2 +- atom/browser/ui/tray_icon_observer.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index a209537c940f..82b2d01c613b 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -44,8 +44,8 @@ void Tray::OnClicked(const gfx::Rect& bounds) { Emit("clicked", bounds); } -void Tray::OnDoubleClicked() { - Emit("double-clicked"); +void Tray::OnDoubleClicked(const gfx::Rect& bounds) { + Emit("double-clicked", bounds); } void Tray::OnBalloonShow() { diff --git a/atom/browser/api/atom_api_tray.h b/atom/browser/api/atom_api_tray.h index 10ea3836819e..f3b91f00c0f0 100644 --- a/atom/browser/api/atom_api_tray.h +++ b/atom/browser/api/atom_api_tray.h @@ -43,7 +43,7 @@ class Tray : public mate::EventEmitter, // TrayIconObserver: void OnClicked(const gfx::Rect& bounds) override; - void OnDoubleClicked() override; + void OnDoubleClicked(const gfx::Rect& bounds) override; void OnBalloonShow() override; void OnBalloonClicked() override; void OnBalloonClosed() override; diff --git a/atom/browser/ui/tray_icon.cc b/atom/browser/ui/tray_icon.cc index 456cbe47a5a3..b22250d35c8f 100644 --- a/atom/browser/ui/tray_icon.cc +++ b/atom/browser/ui/tray_icon.cc @@ -33,8 +33,8 @@ void TrayIcon::NotifyClicked(const gfx::Rect& bounds) { FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnClicked(bounds)); } -void TrayIcon::NotifyDoubleClicked() { - FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnDoubleClicked()); +void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds) { + FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnDoubleClicked(bounds)); } void TrayIcon::NotifyBalloonShow() { diff --git a/atom/browser/ui/tray_icon.h b/atom/browser/ui/tray_icon.h index d6885699d01d..5e362806f5d6 100644 --- a/atom/browser/ui/tray_icon.h +++ b/atom/browser/ui/tray_icon.h @@ -55,7 +55,7 @@ class TrayIcon { void AddObserver(TrayIconObserver* obs) { observers_.AddObserver(obs); } void RemoveObserver(TrayIconObserver* obs) { observers_.RemoveObserver(obs); } void NotifyClicked(const gfx::Rect& = gfx::Rect()); - void NotifyDoubleClicked(); + void NotifyDoubleClicked(const gfx::Rect& = gfx::Rect()); void NotifyBalloonShow(); void NotifyBalloonClicked(); void NotifyBalloonClosed(); diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index fddbd8c16eb0..59386ff8eb41 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -156,7 +156,7 @@ const CGFloat kMargin = 3; } if (event.clickCount == 2 && !menuController_) { - trayIcon_->NotifyDoubleClicked(); + trayIcon_->NotifyDoubleClicked([self getBoundsFromEvent:event]); } [self setNeedsDisplay:YES]; } diff --git a/atom/browser/ui/tray_icon_observer.h b/atom/browser/ui/tray_icon_observer.h index 6c9839a38a1f..474c6a771934 100644 --- a/atom/browser/ui/tray_icon_observer.h +++ b/atom/browser/ui/tray_icon_observer.h @@ -17,7 +17,7 @@ namespace atom { class TrayIconObserver { public: virtual void OnClicked(const gfx::Rect& bounds) {} - virtual void OnDoubleClicked() {} + virtual void OnDoubleClicked(const gfx::Rect& bounds) {} virtual void OnBalloonShow() {} virtual void OnBalloonClicked() {} virtual void OnBalloonClosed() {}