Commit Graph
4 Commits
Author SHA1 Message Date
yetone e5d4c49294 gui: on the Mac the quick panel opens over a full-screen app without taking the user to magpie's desktop (#2141, witt-bit)
b2d558db9 put the panel on every Space, full-screen ones too, but witt-bit
still saw a click on the menu bar icon over full-screen Chrome land on the
non-full-screen desktop on v0.1.1246. The panel was an ordinary NSWindow,
and togglePanel's Focus() activated magpie (activateIgnoringOtherApps).
Activating an app makes the Mac switch to a Space with that app's windows,
the desktop the main window is on, so the user was taken off the
full-screen Space however the panel itself was set.

The panel is now a non-activating NSPanel (Wails' MacWindowClassPanel with
NonActivating), as a menu bar extra's panel is: Show/Focus order it front
and make it key without activating magpie, so the full-screen app stays
frontmost and the Space stays where it is. It still takes the keyboard.
Lightweight mode makes it again from the same options.

Tests: TestPanelJoinsFullScreenSpaces now also checks, on a real AppKit
panel made at start and made again, that it is a non-activating panel,
that showing and focusing it (the icon's path) leaves magpie not
frontmost, and that it is key. With the old options it fails ("showing the
panel brought magpie to the front, which takes the user to the Space of its
other windows"), with the panel-class check turned off to reach that line.
TestPanelOnEverySpaceOnMac checks the options.

Not tried: a real full-screen Space. A test can't make one, and switching
Spaces on the shared Mac would take over its screen, so the reporter's
click over full-screen Chrome is for them to confirm. Paste into the
panel's fields while another app is frontmost wasn't tried by hand either.

Full suite: SUITE_LINE
2026-10-15 23:08:00 +08:00
yetone b2d558db97 gui: on the Mac the quick panel opens over a full-screen app, on the Space the user is on, not on the desktop it was first shown on (#2141)
With Chrome full screen and Settings > Click the tray icon set to the
quick panel, a click on the menu bar icon flashed the icon and showed the
panel on the non-full-screen desktop instead, out of sight until the user
swiped back (witt-bit, macOS 27.0.1, v0.1.1230). The panel's window had no
collection behaviour of its own, so Wails gave it FullScreenPrimary alone:
an ordinary window, kept on the Space it was first ordered in on, and not
allowed on a full-screen app's Space. It now has CanJoinAllSpaces |
FullScreenAuxiliary, as a menu bar extra's panel (and Wails' own notch
window) does, so it is on every Space, full-screen ones too. It never
moves to the active Space as well (AppKit refuses that pair), and nothing
calls setMovesToActiveSpace on it (showHere is the main window's only).
The panel lightweight mode makes again takes the same options.

Tests:
- TestPanelOnEverySpaceOnMac (panel_options_test.go) checks the options.
- TestPanelJoinsFullScreenSpaces (AppKit, runAppKit) makes the real panel
  through panelWin, at start and again after lightweight mode let it go,
  shows and hides it, and reads NSWindow.collectionBehavior
  (joinsFullScreenSpaces).
- Without the change both fail: "panel collection behaviour 0 is not on
  every Space and over full-screen ones" and "made at start: the panel
  isn't on every Space and over full-screen ones".

Run: gofmt -l (clean); go vet ./internal/gui/ (darwin),
GOOS=linux go vet -tags nogui, GOOS=windows go vet; go build,
GOOS=linux go build -tags nogui, GOOS=windows go build; go test
./internal/gui/ under a sandbox HOME with pinned caches. In the package
run, at load average ~300-420 from other sessions, two tests unrelated to
the panel failed: TestMainWindowCorners (40s deadline killed; fails the
same on clean origin/main c4c3cafa2, filed as #1936) and
TestSetAnswersWhileDevinAndProvidersHang (filed as #1375; passed on clean
c4c3cafa2 right after). Panel, dock and Space tests pass.

Not tried: a real full-screen Space. A test can't make one, and doing it
by hand would take over the owner's screen; the reporter is asked to
confirm on the next release.
2026-10-14 16:12:44 +08:00
yetone 897f6d32f1 gui: on Linux the tray panel is a solid window with an opaque page, as the main window is, so scrolling it leaves no ghost of the old position (#1803)
MizuIro-H (Bazzite / Fedora 44, KDE Plasma 6, Wayland) saw the panel's
Allowances tab leave a fainter copy of what it showed at the old scroll
position, on Wayland and under GDK_BACKEND=x11, with
WEBKIT_DISABLE_COMPOSITING_MODE=1 (which magpie already sets under
Wayland, so that try changed nothing), at scale 1, and without KWin's
corner effect. The main window, with the same page, never did.

The panel was the one window with per-pixel alpha: Wails'
BackgroundTypeTranslucent on Linux makes it an app-paintable GTK window
on the screen's RGBA visual under a 0-alpha webview, and body.panel
painted --bg at 93% over it. Paint not cleared before a scroll repaint
shows through 93%, which is the fainter copy. The main window is a plain
solid window painting --bg whole.

On Linux only, panelOptions now makes the panel BackgroundTypeSolid, and
body.linux.panel paints --panel-tint as --bg (no alpha). The Mac (tinted
by tintPanel) and Windows keep the translucent panel. The corners are
square on Linux now (the body's paint fills the canvas).

Run: gofmt -l internal/gui (clean); go vet darwin ./internal/gui,
GOOS=linux -tags nogui ./..., GOOS=windows ./... (clean);
go test ./internal/gui under a sandbox HOME (ok);
node --test internal/gui/tests/panel-*.test.cjs, chromium and webkit
(74 pass), the new panel-linux-opaque test across en/zh/zh-TW/ja/de and
light/dark. Broken by hand: TestPanelSolidOnLinux fails without the
panelOptions change, and panel-linux-opaque fails without the CSS rule
(the Linux body read color(srgb ... / 0.93)).

Not tried on the reporter's setup. A repro of the panel's window
(GTK3 + WebKit2 4.1, RGBA visual, 0-alpha webview, 93% page) under Xvfb
with picom, on Ubuntu and on Fedora 44 (WebKitGTK 2.54), scrolled by JS
and by a real X wheel, with compositing mode on and off, showed no ghost
either way: software rendering there doesn't reproduce it, so whether
the opaque panel ends it rests on the reporter's KDE/GPU machine. No
real Linux magpie build was run.
2026-10-12 22:01:27 +08:00
yetone 4455c7f998 gui: the Windows tray panel no longer shows a faint close X over its Settings gear — its caption buttons are hidden there (#238 mintonight: a blurry red X at the panel's top-right corner, just above and right of the gear) — Wails v3 makes a frameless window on Windows WS_OVERLAPPEDWINDOW and, for the shadow and round corners, extends DWM's frame into the whole client area; the panel left its close button at the zero value, ButtonEnabled, which sets WS_SYSMENU, so DWM drew the caption's close X into that extended frame at the window's top right, and with the panel translucent (BackgroundTypeTranslucent, WS_EX_NOREDIRECTIONBITMAP, a see-through webview) it showed through the page, faint, over the gear. It was not the page: #winclose is removed everywhere but Linux's window, and is a grey pill in the header row. The panel's options move into panelOptions(goos, theme), unchanged, and on Windows its close, minimise and maximise buttons are ButtonHidden, which takes WS_SYSMENU and the min/max boxes off, so DWM has no caption buttons to draw; DisableFramelessWindowDecorations stays off, so the shadow and Windows 11's round corners stay. The Mac and Linux get the same options as before (their button states left at the zero value), and the main window is not touched. Tested with a new internal/gui/panel_options_test.go (!nogui): on windows the three buttons are hidden and the panel still frameless, translucent, off the taskbar and decorated; on darwin and linux the buttons are as before and URL, backdrop and corner radius unchanged; run on the Mac and compiled for Windows (GOOS=windows go test -c). go build -tags nogui (and GOOS=linux), GOOS=windows go build and go test -tags nogui ./... pass (TestUserPath, TestClaudeSignedOut and TestClaudeAccountNamedAsItsLogin timed out once at a load average near 60 and pass alone). Not tried on a real Windows desktop: that DWM stops drawing the X without WS_SYSMENU is from the Win32 custom-frame behaviour and Wails' code, not seen. 2026-09-30 02:15:48 +08:00