Repository navigation
feat(desktop): transparent, shadowless windows off the taskbar - #581
Merged
Merged
Conversation
WindowOptions gains Transparent, NoShadow and SkipTaskbar, the main window takes them from nsgo.WindowTransparent, WindowNoShadow and SkipTaskbar, and desktop.SetWindowTransparent, SetWindowShadow and SetSkipTaskbar change them later. - macOS: a borderless NsgoWindow that may become key, clear and non-opaque, with setHasShadow: and the Window menu and Cmd+` exclusions; performClose: and its Close menu item, which validateMenuItem: enables, ask the app in a window without a close button. - Windows: a WS_POPUP drawn through DirectComposition with alpha, DWM non-client rendering off and square corners; WS_EX_TOOLWINDOW and ITaskbarList for the taskbar. Only a window opened transparent changes later. - Linux: an undecorated GTK window without its theme background, a style clearing GTK's shadow, and the X11 skip-taskbar hint. - nsgotest records the surfaces an app opens (App.Opened). Fixes #567
…effect Add desktop.CanMakeWindowsTransparent and desktop.CanSkipTaskbar, backed by Environment fields each backend sets for a window of its own, in place of the log lines Windows and Linux wrote where transparency or the task list hint has no effect. Windows reports transparency only in a window opened transparent with DirectComposition, Linux where the display composites with an RGBA visual, rereading it as the compositor changes, and the task list hint only on X11. macOS recomputes a transparent window's shadow after each batch, which AppKit otherwise keeps from the first frame, and a double click on a transparent window's drag area no longer zooms or minimizes it.
houko
force-pushed
the
feat/transparent-windows
branch
from
November 17, 2026 11:20
e2968e6 to
a8de2e9
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 #567.
Desktop windows can now open transparent, without a shadow, and off the taskbar.
WindowOptionsgainsTransparent,NoShadowandSkipTaskbar; the main window takes them fromnsgo.WindowTransparent,nsgo.WindowNoShadowandnsgo.SkipTaskbar;desktop.SetWindowTransparent,desktop.SetWindowShadowanddesktop.SetSkipTaskbarchange them later.desktop.CanMakeWindowsTransparent(cx)anddesktop.CanSkipTaskbar(cx)report at runtime whether these take effect in a window's scope, backed byEnvironment.CanMakeWindowsTransparent/CanSkipTaskbarthat each backend sets, in place of the log lines Windows and Linux used to write. Both are false for a surface with no window of its own (an embedded view, the app's own hidden surface, a panel, a tray icon), and on phones and the web.NsgoWindowthat can become key, with a clear, non-opaque background,setHasShadow:, and exclusion from the Window menu and Cmd+. In a window without a close button,performClose:and its Close menu item ask the app.validateMenuItem:enables that menu item. A transparent window's shadow is recomputed (invalidateShadow) after each batch, as AppKit otherwise keeps the shadow of what the window first drew, and a double click on its drag area no longer zooms or minimizes it. Both capabilities are true for a window of its own; the Dock stays the app's (SetDockVisible`).WS_POPUPdrawn through DirectComposition with alpha. DWM non-client rendering is turned off and corners are square.WS_EX_TOOLWINDOWandITaskbarListhandle the taskbar. Only a window that opened transparent can change transparency later, asWS_EX_NOREDIRECTIONBITMAPholds from creation;CanMakeWindowsTransparentis true only in such a window, and false where DirectComposition is missing.CanMakeWindowsTransparentfollowsgdk_display_is_compositedandgdk_display_is_rgba, reread on the display'snotify::composited;CanSkipTaskbaris true only where GDK draws on X11.nsgotestrecords the surfaces an app opens (App.Opened), andnsgotest.Environment/App.SetEnvironmentset the two capabilities.The remaining per-platform gaps are recorded in
docs/roadmap.md. These are runtime confirmation on Windows and Linux, Windows making a framed window transparent later, and Wayland's task-list hint.Targets
TestTransparentWindowon the Mac Studio).windows_x64,windows_arm64). Not run, because no Windows machine is available.linux_x64,linux_arm64); the backend's native tests ran on the Ubuntu host,TestTransparentWindowLookincluded.core/desktop/nsgotest: run.Screenshots
None. A throwaway example on macOS showed a working transparent window: an orange circle with smooth edges and a matching shadow over the desktop. The Mac this was done on is shared and busy, though, and the user's own windows were always behind the window, so both captures were deleted. Before/after shots need a clean desktop session.
Verification
All run from the branch's worktree.
ubuild mise exec [email protected] -- go tool nsgo check -target all: passed (catalogs, vet, dev client,macos_arm64,macos_x64,windows_arm64,windows_x64,linux_arm64,linux_x64,android_arm64,web; Apple mobile targets skipped, they need Xcode).ubuild mise exec [email protected] -- go test ./core ./desktop ./nsgotest ./internal/moduletest: passed, includingTestWindowLook,TestWindowLookCapabilities,TestTransparentWindowsAreRecorded,TestTransparentWindowCapabilitiesand the skills check.rbuild mise exec [email protected] -- go test ./internal/platform/macos -run TestTransparentWindow -v: PASS (style mask, opacity, key, Cmd+W, content size, Window menu and Cmd+`, and the environment for a window and a panel).ubuild mise exec [email protected] -- go tool nsgo test ./internal/platform/linux:TestTransparentWindowLookpassed; 119 passed, 9 failed, 6 skipped. The same 9 tests (focus, input, media, menu) fail onorigin/mainon that host, 118 passed there.gofmtreports nothing for the edited Go files.Checklist