ac4af582301a4e8a29245dbba767eba31334ddf9
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f06551c277 |
gui: a closed window's page is told it is out of sight
A macOS orderOut hides the NSWindow but can leave its WKWebView document visible. The Routing page's frame loop and SVG animations therefore kept running in a closed window (20-40% Web Content CPU; reopening and closing returned it to 0%). Tell the page before every app-window hide and again on show. Compose that signal with WebKit's own hidden state, and pause CSS animations while out of sight. Verified with: - go test ./internal/gui -run '^(TestCoreScriptBudget|TestClosingWindowMarksPageOutOfSight|TestClosingHidesShownAccounts|TestPanelCloseHidesIt|TestPanelJoinsFullScreenSpaces)$' -count=1 - node --test internal/gui/tests/window-visibility.test.cjs (Chromium and WebKit) - the new JS test against v0.1.2049's app.js: it times out without the bridge - the new AppKit test with hideMain calling Hide directly: it times out without the visibility signal - go vet ./internal/gui - GOOS=linux CGO_ENABLED=0 go vet -tags nogui ./internal/gui - GOOS=windows CGO_ENABLED=0 go vet ./internal/gui The full GUI package still has unrelated environment failures in TestProxyCheckSaysAProxyPassedBy and TestMainWindowCorners on this macOS 27 setup. |
||
|
|
1407c9a3bb |
gui: the Mac's window is in the Dock and Command-Tab while it is open, by default (ShouguangCao on X)
ShouguangCao on X: on the Mac, with the window (Settings) open, magpie wasn't in Command-Tab, so going back to it to paste an API key copied in another app took the menu bar. Cause: Settings > Show in Dock already had "With window" (#101: Regular activation policy while the main window is up, Accessory once it closes, in openMain/hideMain through inDock and setDock), but the default was Hide, so out of the box magpie stayed Accessory with its window open. The main window is magpie's only window besides the tray panel, so no other window kind needed it. Change: With window is now the default. inDock is `s.Dock || !s.DockNever && shown || fullscreen`; Hide is a choice of its own, settings.DockNever (KeepOwn, like Dock and DockWindow), and the page reads the choice through dockChoice (With window unless Show or Hide was chosen) and saves dockNever with it. DockWindow is still written when chosen, so an older magpie reading the file keeps With window. The tray panel never calls dock(), so it is unchanged; Windows and Linux have no Dock (setDock is a no-op there) and are unchanged. For existing users: Hide was the default and was stored as nothing, so a user who picked Hide before can't be told from one who never chose; both now get With window, and choosing Hide again sticks (dockNever). Run on mote at origin/main |
||
|
|
9e63476087 |
gui: on Windows only the window's frame resizes it, not the page's edges (shangyuan0818)
shangyuan0818 on Discord: the top of the page, just under Windows' title bar, resized the window's height as the frame does. Cause: Wails' page runtime (drag.ts, v3.0.0-beta.24) arms an edge resize SM_CYSIZEFRAME px inside the page on every edge whenever the window is resizable on Windows, framed or not (on Linux only when frameless, never on the Mac), and posts wails:resize:<edge>, which Go turns into WM_NCLBUTTONDOWN HTTOP/HTLEFT/... The main window is framed on Windows, so its top, left, right and bottom page edges all resized it. On the main window, on Windows only, magpie now turns that switch off once Wails' runtime is ready (WindowRuntimeReady), wrapped so Wails' own setResizable(true) right after, or on a reload, keeps it off. The native frame and window resizability are untouched. Run: - Windows 11 box (xiaomi-gpu), sandbox HOME, GOOS=windows builds of origin/main |
||
|
|
d3191a51c8 |
gui: with Hide accounts on, an account's eye shows that one account in this window (yogurt36)
yogurt36 on Discord, for a screen share: with Hide accounts on, one
account should be readable while the others stay masked. Now an
account's name on the provider editor's row (accountNameButton and the
one-account line) and on its Usage card (quotaWho) has a quiet eye, in
sight on hover or keyboard focus, with an aria-label. A click shows
that account, its address and the name the user gave it together
(kin), everywhere the window draws it, tooltips included: the shown
set is skipped in hits(), which every mask goes through. It lives in
memory only. The tray panel keeps hiding it, and closing the window
hides it again: the page stays loaded while the window is hidden, so
hideMain runs mainClosedJS (hideAccounts.closed) first. With Hide
accounts off there is no eye. Strings in zh, zh-TW, ja and de.
Run (macOS, playwright 1.62.0, rebased on 630fd1d69; at push
|
||
|
|
9bfb7a5870 |
fix(gui): keep the full-screen window's title bar when the Dock is set to Hide
With Dock on "Hide", magpie runs as an Accessory app. A full-screen window's title bar comes down only with the menu bar, and an Accessory app has none, so the full-screen main window had no close, minimize or full-screen button, and only Esc left full screen. magpie now joins the Dock as a window starts entering full screen, from a native NSWindowWillEnterFullScreenNotification observer: Wails hands that event to Go later, and switching once the window is full screen doesn't bring the title bar back. dock counts a full-screen main window (inDock), so reopening the app or changing the Dock setting during full screen keeps magpie in the Dock, and WindowDidExitFullScreen applies the setting again. TestFullscreenKeepsDock checks inDock; it doesn't compile on main. On macOS 27.0.1 with Dock on "Hide", main stays out of the Dock in full screen with no title bar; this branch joins the Dock with the title bar and its buttons, and leaves it after the green button, View > Toggle Full Screen or Esc. Fixes #763 |
||
|
|
597c347ba8 | gui: the Mac window opens on the Space you are on, and closing it in full screen leaves no black Space (StringKe on Discord) — magpie keeps no window position, so what stuck was macOS's own: the window, made with only full-screen-primary, belonged to the Space it was last shown on and Open took the user there; restarted to update while another app was full screen, it joined that app's Space for good. It now also moves to the active Space whenever shown (130, can still go full screen: checked in AppKit, enter and exit both report). Closing a full-screen window hid it where it was, leaving its full-screen Space empty and black; it now leaves full screen first and hides on WindowDidExitFullScreen (3s fallback), and an Open meanwhile keeps it. TestMainWindowFollowsActiveSpace and TestCloseStepLeavesFullscreen fail without the change. go vet, go build (darwin GUI), go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. |