From 35096a7eff0bc19e50def69f75138b55244d31c5 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Mon, 18 Nov 2024 14:39:52 -0800 Subject: [PATCH] win: add right click menu support (#7727) Enable both left and right click on the pop-up menu --- app/tray/wintray/tray.go | 2 +- app/tray/wintray/w32api.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/tray/wintray/tray.go b/app/tray/wintray/tray.go index 6f827893..19fa98e9 100644 --- a/app/tray/wintray/tray.go +++ b/app/tray/wintray/tray.go @@ -361,7 +361,7 @@ func (t *winTray) showMenu() error { boolRet, _, err = pTrackPopupMenu.Call( uintptr(t.menus[0]), - TPM_BOTTOMALIGN|TPM_LEFTALIGN, + TPM_BOTTOMALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON, uintptr(p.X), uintptr(p.Y), 0, diff --git a/app/tray/wintray/w32api.go b/app/tray/wintray/w32api.go index 7c7c0ac8..d23bfd97 100644 --- a/app/tray/wintray/w32api.go +++ b/app/tray/wintray/w32api.go @@ -67,6 +67,7 @@ const ( SW_HIDE = 0 TPM_BOTTOMALIGN = 0x0020 TPM_LEFTALIGN = 0x0000 + TPM_RIGHTBUTTON = 0x0002 WM_CLOSE = 0x0010 WM_USER = 0x0400 WS_CAPTION = 0x00C00000