feat: add middle click event to tray (#39926)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
480f48b2fc
commit
689d1b76de
9 changed files with 33 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue