mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
win: Fix context menu clicking in notify icon.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
#include "atom/browser/ui/win/notify_icon.h"
|
||||
|
||||
#include "atom/browser/ui/win/menu_2.h"
|
||||
#include "atom/browser/ui/win/notify_icon_host.h"
|
||||
#include "atom/browser/ui/win/menu_2.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/win/windows_version.h"
|
||||
@@ -60,8 +60,8 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
|
||||
if (!SetForegroundWindow(window_))
|
||||
return;
|
||||
|
||||
scoped_ptr<Menu2> menu(new Menu2(menu_model_));
|
||||
menu->RunContextMenuAt(cursor_pos);
|
||||
menu_.reset(new Menu2(menu_model_));
|
||||
menu_->RunContextMenuAt(cursor_pos);
|
||||
}
|
||||
|
||||
void NotifyIcon::ResetIcon() {
|
||||
|
||||
@@ -22,6 +22,7 @@ class Point;
|
||||
|
||||
namespace atom {
|
||||
|
||||
class Menu2;
|
||||
class NotifyIconHost;
|
||||
|
||||
class NotifyIcon : public TrayIcon {
|
||||
@@ -68,6 +69,7 @@ class NotifyIcon : public TrayIcon {
|
||||
|
||||
// The context menu.
|
||||
ui::SimpleMenuModel* menu_model_;
|
||||
scoped_ptr<atom::Menu2> menu_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NotifyIcon);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user