Repository navigation
feat(desktop): window opacity and transparency APIs - #35646
Merged
crowlKats merged 3 commits intoJul 2, 2026
Merged
Conversation
Expose the laufey window opacity/transparency support added in denoland/laufey#32 (laufey API version 28): - BrowserWindow.getOpacity()/setOpacity() and the `opacity` constructor option fade the whole window by a uniform factor in [0, 1]. - The `transparent` constructor option gives the window a transparent background so the page's per-pixel alpha composites against what is behind it (macOS + Linux system WebView; ignored on Windows / CEF). Closes denoland#35583.
…ransparency # Conflicts: # cli/rt_desktop/lib.rs
littledivy
approved these changes
Jul 2, 2026
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.
Exposes window opacity/transparency to the Deno desktop API. Closes #35583.
Backed by the laufey changes in littledivy/laufey#32 (laufey API version 28).
API
Two distinct things:
BrowserWindow.getOpacity()/setOpacity(n)and theopacityconstructor option fade the whole window (chrome + content) by a uniform factor in0..=1, like CSSopacity. Out-of-range values are clamped.transparentconstructor option gives the window a transparent background so the page's own per-pixel alpha composites against whatever is behind it. Commonly paired withframeless. Supported on macOS and Linux with the system WebView; ignored on Windows and with CEF (opaque window background).Changes
runtime/ops/desktop.rs—DesktopApitrait gains atransparentcreate-window param andget_window_opacity/set_window_opacity;opacity/transparentadded toBrowserWindowOptionsand wired through theBrowserWindowconstructor;getOpacity/setOpacityops.cli/rt_desktop/lib.rs— implements the new methods againstlaufey::Windowand passestransparentintoWindowOptions.cli/tsc/dts/lib.deno.desktop.d.ts— typings + docs.