How to create a separate transparent window on click? #7130
-
I want to create a transparent window with no title bar and no background in order to show an animation. I could set the main window to transparent and no decoration, but when a new window is created, it always has a background and title bar. The code is like this import { WebviewWindow } from "@tauri-apps/api/window";
...
const win = new WebviewWindow("win-animate", {
url: "/animation",
});
await win.setDecorations(false); ScreenshotHere is a screenshot of the result. On the left, it's the transparent main window; on the right, it's the newly created window which always has background and title bar. The green rectangle is where the main window is, the red rectangle indicate the button to click to create the new window. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I feel like this is a timin issue. |
Beta Was this translation helpful? Give feedback.
Oh, it works if I use the constructor way.
Thank you! @FabianLars