Skip to content

feat(desktop): transparent, shadowless windows off the taskbar - #581

Merged
houko merged 2 commits into
mainfrom
feat/transparent-windows
Nov 17, 2026
Merged

houko merged 2 commits into
mainfrom
feat/transparent-windows

Conversation

@houko

@houko houko commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #567.

Desktop windows can now open transparent, without a shadow, and off the taskbar. WindowOptions gains Transparent, NoShadow and SkipTaskbar; the main window takes them from nsgo.WindowTransparent, nsgo.WindowNoShadow and nsgo.SkipTaskbar; desktop.SetWindowTransparent, desktop.SetWindowShadow and desktop.SetSkipTaskbar change them later.

desktop.CanMakeWindowsTransparent(cx) and desktop.CanSkipTaskbar(cx) report at runtime whether these take effect in a window's scope, backed by Environment.CanMakeWindowsTransparent / CanSkipTaskbar that 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.

  • macOS: a borderless NsgoWindow that 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`).
  • Windows: a WS_POPUP drawn through DirectComposition with alpha. DWM non-client rendering is turned off and corners are square. WS_EX_TOOLWINDOW and ITaskbarList handle the taskbar. Only a window that opened transparent can change transparency later, as WS_EX_NOREDIRECTIONBITMAP holds from creation; CanMakeWindowsTransparent is true only in such a window, and false where DirectComposition is missing.
  • Linux: an undecorated GTK window without its theme background. A style clears GTK's shadow, and the X11 skip-taskbar hint keeps it off the taskbar. CanMakeWindowsTransparent follows gdk_display_is_composited and gdk_display_is_rgba, reread on the display's notify::composited; CanSkipTaskbar is true only where GDK draws on X11.
  • nsgotest records the surfaces an app opens (App.Opened), and nsgotest.Environment / App.SetEnvironment set 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

  • macOS: compiled, vetted and run (TestTransparentWindow on the Mac Studio).
  • Windows: compiled and cross-vetted only (windows_x64, windows_arm64). Not run, because no Windows machine is available.
  • Linux: compiled and vetted (linux_x64, linux_arm64); the backend's native tests ran on the Ubuntu host, TestTransparentWindowLook included.
  • Shared core / desktop / nsgotest: run.
  • Web, Android: compile check only. These are not desktop targets; both capabilities are false there.

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, including TestWindowLook, TestWindowLookCapabilities, TestTransparentWindowsAreRecorded, TestTransparentWindowCapabilities and 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: TestTransparentWindowLook passed; 119 passed, 9 failed, 6 skipped. The same 9 tests (focus, input, media, menu) fail on origin/main on that host, 118 passed there.
  • gofmt reports nothing for the edited Go files.
  • Not run: Windows backend tests (no Windows machine).

Checklist

  • Conventional Commit title.
  • Changelog, public docs (en/zh components and testing), skill, architecture docs and roadmap updated.
  • No new dependencies or third-party assets.

@github-actions github-actions Bot added enhancement New feature or request size/L documentation Improvements or additions to documentation macOS Windows Linux core conflict Conflicts with the base branch; resolve it first labels Nov 17, 2026
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
houko force-pushed the feat/transparent-windows branch from e2968e6 to a8de2e9 Compare November 17, 2026 11:20
@houko
houko merged commit 78bd1d0 into main Nov 17, 2026
9 of 12 checks passed
@houko
houko deleted the feat/transparent-windows branch November 17, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict Conflicts with the base branch; resolve it first core documentation Improvements or additions to documentation enhancement New feature or request Linux macOS size/L Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Transparent, shadowless desktop windows that stay off the taskbar

1 participant