ac4af582301a4e8a29245dbba767eba31334ddf9
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
63be47717a |
gui: TestPanelJoinsFullScreenSpaces checks key status only where the session gives it (#2450)
The test was wrong, not the panel. It required the quick panel to be key
after Focus, but on this Mac (macOS 26.2 25C56, no input for ~30 min,
frontmost app kitty) macOS makes no non-activating panel key for an app
that isn't active when nothing the user did is behind it. That held at
|
||
|
|
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)
|
||
|
|
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 |
||
|
|
3cd0b5f78d |
gui: lightweight mode no longer lets go of a main window that is open under another app's, so Command-Tab back to magpie finds it there (#1381, ttmouse)
Cause: lightweight mode (#580) let go of the main window once two of its 30 s looks found it "not shown", and it asked Wails' IsVisible, which on the Mac is the window's occlusion state. A window the user had Command-Tabbed away from, covered by the other app's window, counted as closed: 30-60 s later its webview was dropped and the window closed, and Command-Tab back to magpie found a blank shell or no window at all. Hidden with magpie (Command-H) it went the same way, since hiding orders every window out. Change: windowUp says whether a window is up as the user sees it: ordered in on any Space, covered or not, minimised, or open as magpie was hidden (watchHide records those on NSApplicationWillHideNotification). Only a window magpie closed itself is down. lighten (through lightShown) and mainShown use it, so the Dock-while-open setting and a restart to update also keep a covered window as open. Elsewhere windowUp is IsVisible as before (visible there covers covered and minimised). Run: - Reproduced with a sandbox build of origin/main (own HOME and CFFIXED_USER_HOME, port 3481, dock+lightweight on): with the open window covered by a full-screen window of a helper process for 70 s the log said "the main window's webview let go" and the window was a blank white shell. With this change, the same run let go only the closed panel and the window kept its page (screenshot of the window). - Activation itself was checked by handing activation from the helper to magpie (NSRunningApplication activateFromApplication): with the window there it came forward. A real Command-Tab keystroke was not sent. - New TestCoveredWindowStaysUp (AppKit, own process): open, covered by another window (until IsVisible says false), hidden with the app, minimised -> up; closed by magpie, also with the app hidden -> down. With windowUp put back to IsVisible it fails: "open: the window counts as up=false, want true"; without the hidden clause: "hidden with magpie: the window counts as up=false, want true". Passes -count=10. - gofmt -l; go vet ./internal/gui; GOOS=linux go vet -tags nogui and GOOS=windows go vet (with and without nogui) ./internal/gui; go build, GOOS=linux go build -tags nogui, GOOS=windows go build; go test ./internal/gui and go test -tags nogui ./internal/gui under a temp HOME: ok. |
||
|
|
31b903fed2 |
gui: a Dock click goes to the main window on its own Space, not pulls it to the current one (#1252)
The window has MoveToActiveSpace so that a first show, or an Open from
the menu bar, puts it on the Space the user is on (a window first shown
while another app was full screen belonged to that Space from then on).
The Dock's reopen also went through openMain's Show and Focus, so with
the window open on another Space a Dock click pulled it over instead of
switching to it, as other Mac apps do.
The window now carries MoveToActiveSpace only while it is shown
(showHere: set, Show, Focus, cleared 500ms later, since clearing it at
once loses the move). The Dock's reopen (reopenMain) activates the app
and leaves an open window where it is, so macOS switches to its Space; a
closed, hidden or minimised window, or one still loading, is shown on the
current Space as before. The menu bar panel and its Open are unchanged.
TestDockReopenKeepsTheWindowsSpace (darwin, cgo) runs a real Wails app:
open, reopen while open (the flag is never set, the window stays open),
hidden then reopened, and minimised then reopened. With the old reopen
it fails ("the shown window stays on its Space").
Tried for real on this Mac (macOS 26.2), on sandbox .app builds of the
old and new code under a sandbox HOME, with a second Space added and
removed afterwards. Old build: window open on Space 1, Dock reopen from
Space 2 left the user on Space 2 and moved the window there. New build:
the same reopen switched to Space 1 and the window stayed there. A
minimised or closed window was shown on Space 2, the current one. The
menu bar panel opened and closed on both Spaces. go test -tags nogui
./internal/gui/... and go test ./internal/gui (cgo) pass under a temp
HOME; go vet, and GOOS=linux / GOOS=windows go vet -tags nogui pass.
Not tried on a full-screen Space or with several displays.
|