Repository navigation
feat(desktop): show windows on every workspace - #576
Merged
Merged
Conversation
Add desktop.SetWindowWorkspaces, WindowOptions.Workspaces and TSX's Window.setWorkspaces. On macOS a window on every workspace joins all Spaces as a full screen auxiliary window out of Cmd-` cycling, with its collection behavior computed from the level, workspaces and constraints together so SetWindowLevel no longer clears it. Linux asks an X11 window manager for _NET_WM_DESKTOP on every map; Windows and Wayland have no supported route and leave the window where it is. Fixes #572
Add desktop.CanSetWindowWorkspaces, backed by Environment.CanSetWindowWorkspaces, so an app can tell where SetWindowWorkspaces does nothing. macOS reports it for a surface with a window of its own. Linux reports it on X11 where gdk_x11_screen_supports_net_wm_hint finds _NET_WM_DESKTOP in the window manager's _NET_SUPPORTED, the same check GDK makes before it sends the request, and not for an embedded view, the app's own hidden surface, a tray icon or an unmanaged panel. Windows, Wayland, phones and the web leave it false. The Linux binding reuses the panels' GDK X11 display type, and a native test stands in for a window manager on a bare X server to check the requests, their repeat on map and the environment with and without _NET_WM_DESKTOP.
houko
force-pushed
the
feat/window-workspaces
branch
from
November 17, 2026 11:04
817677f to
129b303
Compare
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #572.
Adds
desktop.SetWindowWorkspaces,WindowOptions.Workspaces(WindowWorkspacesCurrent, the default, andWindowWorkspacesAll) and TSX'sWindow.setWorkspaces, so desktop pets, HUDs and timers can follow the user across workspaces. The main window, which is not opened withWindowOptions, goes on every workspace by callingdesktop.SetWindowWorkspacesfrom its content.desktop.CanSetWindowWorkspacesreports at runtime whether the request takes effect, throughEnvironment.CanSetWindowWorkspaces, following the pattern ofCanSetWindowLevelin #583.cycling. Its collection behavior is now computed from the level, the workspaces and the constraints together, soSetWindowLevelno longer clears it. A floating level keeps it above the windows on every Space; the desktop level keeps it behind them and out of full screen spaces.CanSetWindowWorkspaces` is true for a surface with a window of its own._NET_WM_DESKTOP = 0xFFFFFFFFon every map.CanSetWindowWorkspacesis true wheregdk_x11_screen_supports_net_wm_hintfinds_NET_WM_DESKTOPin the window manager's_NET_SUPPORTED, the same check GDK makes before sending the request, read when the window's environment is; it is false on Wayland, which has no protocol for it, and for an embedded view, the app's own hidden surface, a tray icon and an unmanaged panel.IVirtualDesktopManageronly moves windows), so the window stays on the desktop it opened on andCanSetWindowWorkspacesis false. Phones and the web report false too.nsgotestrecords the request inApp.Window, andnsgotest.EnvironmentsetsCanSetWindowWorkspaces; the core, docs (architecture, public en/zh), roadmap and changelog are updated.Targets
macos_arm64andmacos_x64; the macOS platform tests ran on the Mac Studio over SSH, includingTestWindowWorkspacesOutliveTheLevel. Not checked by hand switching Spaces in a GUI session.linux_x64andlinux_arm64; the platform package's tests ran under Xvfb withGDK_BACKEND=x11and with GDK's default backend (which picked Wayland on the test host). The newTestWindowWorkspacesAskTheWindowManagerstands in for a window manager on the bare X server and checks the_NET_WM_DESKTOPrequests, their repeat after the window maps again, the return to the current desktop, and the environment with and without_NET_WM_DESKTOPin_NET_SUPPORTED. Not run against a real window manager.windows_x64andwindows_arm64only, not run (no Windows machine). It reports the feature as unavailable.desktop, TSX andnsgotest: tests run.Screenshots
None: the change is about which Spaces and virtual desktops a window appears on, which a still screenshot cannot show, and it changes no view's appearance.
Verification
All run from the branch's worktree.
ubuild mise exec [email protected] -- go tool nsgo check -target all: exit 0 (the Apple mobile targets are skipped there).rbuild mise exec [email protected] -- go tool nsgo check -target macos_arm64,macos_x64,ios: exit 0.ubuild mise exec [email protected] -- go tool nsgo test ./<pkg>/:core: 664 passed, includingTestWindowWorkspacesandTestEnvironmentWindowWorkspaces.desktop: 2 passed, includingTestWindowWorkspacesFollowTheEnvironment.tsx: 166 passed, includingTestWindowWorkspaces.nsgotest: 70 passed.internal/driver: 133 passed.ubuild xvfb-run -a mise exec [email protected] -- env GDK_BACKEND=x11 go tool nsgo test ./internal/platform/linux/: 133 passed, 0 failed, 1 skipped.ubuild xvfb-run -a mise exec [email protected] -- go test -count=1 -run TestWindowWorkspacesAskTheWindowManager ./internal/platform/linux/, with and withoutGDK_BACKEND=x11: passed. With the window'smaphandler removed the test fails at "shown again", and with the_NET_SUPPORTEDcheck removed it fails in the subtest without_NET_WM_DESKTOP.rbuild mise exec [email protected] -- go tool nsgo test -target macos ./internal/platform/macos/: 52 passed, 0 failed, 3 skipped.gofmt -lover every.gofile the branch changes: clean.Checklist