Repository navigation
Description
Context
Line numbers are at aadbe7e; main at 6160fe6 has the same code.
PanelOptionsholdsWidth,Height,HideOnBlurandMaterial(core/window.go:58-66). The size is fixed at open, and there is no option for a window with no background.- On macOS,
newPanelmakes a titledNSPanel("titled for its rounded corners and shadow",internal/platform/macos/app.go:137-163) of exactly that size. The window stays opaque with the window background colour unless a material is set;setMaterialmakes it non-opaque only to put anNSVisualEffectViewover the whole content (internal/platform/macos/material.go:75-102), andWindowMaterialNone"keeps the window opaque" (internal/driver/services.go:105-106). OpenWindowhas no transparent option either;docs/roadmap.md:107lists "Transparent windows and the taskbar on Windows" as future work, and nothing names it for macOS or for panels.- The only way to fit the panel to its content is to measure the content and send
desktop.SetWindowFramewith a size from inside the panel (desktop/desktop.go:163), after it has already shown at the size it was opened with.
#243 (and its comment) is about where a panel goes and whether it takes the keyboard; this issue is about what it looks like and how big it is.
Why it matters
A quick-lookup or command popup is a card: rounded, with its own shadow, often shorter than its maximum height when the result is short. Desktop toolkits draw such a popup as a borderless, transparent, shadowless window sized to the card (an NSPanel with isOpaque = NO, a clear background and the card's own shadow on macOS; a layered window on Windows). With NSGo's panels the app gets a fixed rectangle with the window background and the system's rounded corners and shadow around all of it, so a 380×520 panel showing a two-line result is a large empty block under a small card. Using a material does not help: it frosts the whole rectangle. Resizing with SetWindowFrame from the content after it shows can put a frame at the old size on screen first, and has to be redone on every content change.
Proposal
PanelOptions.Transparent bool(and the same onWindowOptions, which the roadmap item already wants on Windows): the window draws nothing of its own, no background, no system frame or shadow, so only what the app draws shows and the rest lets clicks through or not as the platform allows. On macOS: a borderless non-activating panel (NSWindowStyleMaskBorderless | NSWindowStyleMaskNonactivatingPanel),setOpaque:NO,setBackgroundColor:clearColor,setHasShadow:NO, with the content view's layer clear; the app's view draws its corners andBoxShadow, which then needs room inside the window. On Windows, a layered or DirectComposition window with a transparent background; on Linux, an RGBA visual where a compositor runs, falling back to opaque and reporting it.PanelOptions.FitContent(orWidth/Heightofcore.FitContent): the panel takes the content root's measured size, up toWidth/Heightas a maximum, before it first shows and again as the content's size changes, keeping its anchored edge (the top under a tray icon, or the placement Panels that never take the keyboard and can be placed at a screen rectangle (candidate windows, on-screen keyboards) #243 adds).Envreports whether transparency took effect, likeEnv.WindowMaterialdoes for materials, so an app can draw a background when it did not.
Acceptance
- On macOS, a
Transparentpanel whose content is a rounded view with aBoxShadowshows only that view and its shadow; the desktop shows through everywhere else. - A
FitContentpanel opens at its content's height, never shows at the maximum first, and follows the content when it grows or shrinks. - Panels without the new options look and size as today.
- Windows and Linux either support both options or report through
Envthat they did not apply.
Activity
houko commentedon Nov 17, 2026
Related: #567 asks for the same transparent, shadowless look on
OpenWindowwindows (plusSkipTaskbar), and #568 for letting the pointer through such a window where it draws nothing. A desktop pet or a floating widget opened as aNoActivatepanel needs the transparent background from this issue too.feat(desktop): transparent panels sized to their content
feat(desktop): transparent panels sized to their content
feat(desktop): transparent panels sized to their content