From 3f5cd1f3ccbd1914a80dba203af5fde60be5aa9d Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 4 Oct 2026 23:37:03 +0800 Subject: [PATCH] =?UTF-8?q?tray:=20the=20Mac's=20menu=20bar=20icon=20can?= =?UTF-8?q?=20be=20Command-dragged=20again,=20so=20Hidden=20Bar=20and=20th?= =?UTF-8?q?e=20like=20can=20move=20it=20(#792,=20BennettChina:=20after=20v?= =?UTF-8?q?0.1.865=20a=20Command-click=20no=20longer=20opened=20the=20pane?= =?UTF-8?q?l,=20but=20the=20icon=20still=20didn't=20move)=20=E2=80=94=20ma?= =?UTF-8?q?gpie's=20own=20monitor=20of=20mouse-downs=20on=20the=20icon=20(?= =?UTF-8?q?#629,=20which=20keeps=20it=20from=20flickering)=20took=20every?= =?UTF-8?q?=20left=20click=20on=20it=20and=20handed=20it=20to=20the=20acti?= =?UTF-8?q?on,=20so=20the=20button=20never=20saw=20a=20Command-held=20mous?= =?UTF-8?q?e-down,=20and=20that=20is=20what=20starts=20the=20system's=20dr?= =?UTF-8?q?ag.=20One=20with=20Command=20held=20is=20now=20left=20to=20the?= =?UTF-8?q?=20button.=20On=20this=20Mac=20(macOS=2026.2)=20with=20a=20GUI?= =?UTF-8?q?=20build=20in=20a=20sandbox=20HOME:=20a=20synthetic=20Command-d?= =?UTF-8?q?rag=20of=20its=20icon=2060=20px=20right=20did=20nothing=20on=20?= =?UTF-8?q?origin/main=20and=20swapped=20it=20with=20its=20neighbour=20wit?= =?UTF-8?q?h=20the=20change;=20the=20same=20drag=20moved=20a=20bare=20NSSt?= =?UTF-8?q?atusItem,=20and=20one=20set=20up=20as=20Wails=20does=20(sendAct?= =?UTF-8?q?ionOn=20mouse-down,=20its=20local=20monitor)=20in=20both=20case?= =?UTF-8?q?s;=20a=20plain=20click=20still=20opened=20and=20closed=20the=20?= =?UTF-8?q?panel.=20go=20vet,=20builds=20(darwin,=20GOOS=3Dlinux=20nogui,?= =?UTF-8?q?=20GOOS=3Dwindows),=20go=20test=20./internal/gui/=20and=20go=20?= =?UTF-8?q?test=20-tags=20nogui=20-count=3D1=20./...=20under=20a=20temp=20?= =?UTF-8?q?HOME=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/trayimage_darwin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/gui/trayimage_darwin.go b/internal/gui/trayimage_darwin.go index 6ca07efc1..a53d2dfde 100644 --- a/internal/gui/trayimage_darwin.go +++ b/internal/gui/trayimage_darwin.go @@ -390,7 +390,9 @@ static void mpHighlight(int on) { // mpOwnClicks hands a left click on the item to its action before the // button sees it: the button's own tracking would light it on mouse-down -// and put it out on mouse-up, a flicker before mpHighlight's. +// and put it out on mouse-up, a flicker before mpHighlight's. One with +// Command held is left to the button, which is what lets the system move +// the item (#792: Command-dragging it, as Hidden Bar asks, did nothing). static void mpOwnClicks(void) { static dispatch_once_t once; dispatch_once(&once, ^{ @@ -400,6 +402,7 @@ static void mpOwnClicks(void) { if (b == nil || e.window != b.window) return e; NSPoint p = [b convertPoint:e.locationInWindow fromView:nil]; if (!NSPointInRect(p, b.bounds)) return e; + if (e.modifierFlags & NSEventModifierFlagCommand) return e; // Route quota clicks before the generic action, within this // one monitor; local monitor ordering is not guaranteed. CGFloat x = p.x - (b.bounds.size.width - mpHitW) / 2;