feat: add middle click event to tray (#39926)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
Tomasz 2023-09-27 20:21:15 +02:00 committed by GitHub
parent 480f48b2fc
commit 689d1b76de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 3 deletions

View file

@ -73,7 +73,8 @@ NotifyIcon::~NotifyIcon() {
void NotifyIcon::HandleClickEvent(int modifiers,
bool left_mouse_click,
bool double_button_click) {
bool double_button_click,
bool middle_button_click) {
gfx::Rect bounds = GetBounds();
if (left_mouse_click) {
@ -84,6 +85,8 @@ void NotifyIcon::HandleClickEvent(int modifiers,
display::Screen::GetScreen()->GetCursorScreenPoint(),
modifiers);
return;
} else if (middle_button_click) { // single middle click
NotifyMiddleClicked(bounds, modifiers);
} else if (!double_button_click) { // single right click
if (menu_model_)
PopUpContextMenu(gfx::Point(), menu_model_->GetWeakPtr());