Repository navigation
Description
Context
Line numbers are at 4aea100 (main).
desktop.SetWindowLevel(WindowLevelFloating)on macOS only setsNSFloatingWindowLeveland clears the collection behaviours (internal/platform/macos/services.go:560-581). OnlyWindowLevelDesktopaddscanJoinAllSpaces | stationary | ignoresCycle, and that level sits below every window.- So a floating window stays on the Space it opened on, disappears when the user switches Space, and is not shown over another app's full-screen Space (no
fullScreenAuxiliary). Panels already getjoinsAllSpaces | fullScreenAuxiliary(internal/platform/macos/app.go:167), butOpenWindowwindows and the main window cannot. - NSH has
WindowAttributes.workspaceswithWorkspaces::All(crates/nsh-core/src/desktop/window.rs:98-107), mapped to the collection behaviour incrates/nsh-platform-macos/src/window.rs:1015-1030.
Why it matters
Desktop pets, HUDs, timers, sticky notes and screen annotation tools are expected to follow the user across Spaces and to stay visible over a full-screen app, and usually to stay out of Cmd-Tab and Mission Control. The desktop pet "Big Blue Fish" (github.com/Bai-Cute/big-blue-fish-desktop-pet) does this on Windows, where a topmost window shows on every virtual desktop the user pins it to. On NSGo the pet vanishes as soon as the user swipes to another Space. Related: #567 (transparent windows), #568 (pointer through).
Proposal
type WindowWorkspaces uint8
const (
WindowWorkspacesCurrent WindowWorkspaces = iota // the one it opened on (default)
WindowWorkspacesAll // every Space / virtual desktop, and over full-screen apps on macOS
)
func SetWindowWorkspaces(cx *core.Scope, w WindowWorkspaces)plus a WindowOptions field. macOS: canJoinAllSpaces | fullScreenAuxiliary (and ignoresCycle so it stays out of Cmd-cycling), kept whenSetWindowLevel changes the level instead of being cleared by it. Windows: pinning to all virtual desktops has no public API (IVirtualDesktopManageronly moves windows), so it reports unavailable unless a supported route exists. Linux X11:_NET_WM_DESKTOP = 0xFFFFFFFF`.
Acceptance
- On macOS a floating window opened with
WindowWorkspacesAllstays on screen while the user switches Spaces and over a full-screen app, andSetWindowLeveldoes not undo it. WindowWorkspacesCurrentkeeps today's behaviour.- Windows and Linux report what they support, and nsgotest records the value.
Activity
feat(desktop): show windows on every workspace
feat(desktop): show windows on every workspace