tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.26k stars 2.58k forks source link

[bug] It won't be radius frame when `decoration` sets `false` in Windows 11 #4733

Closed 7086cmd closed 2 years ago

7086cmd commented 2 years ago

Describe the bug

image This is the frame without decorations, and it have no animation, radius border, and shadow. image This is the frame that decorations sets to true, and it directly shows the frame, shadow, border, and radius.

In Electron, when frame sets to false, it won't show decorations, but it will also show the radius and shadow.

Reproduction

  1. Simply create a blank project.
  2. Add decorations: false to the config part of the window
  3. run.

Expected behavior

Provide a titlebar options, in order to hide titlebar, while use decorations to hide them all; Or let decorations just hide title bar, and create a options transparent to hide them all.

Platform and versions

PS J:\zhihui\desktop> tauri info

Environment
  › OS: Windows 10.0.22000 X64
  › Webview2: 103.0.1264.62
  › MSVC: 
      - Visual Studio 2019
  › Node.js: 18.4.0
  › npm: 8.12.1
  › pnpm: 7.5.0
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.62.1
  › cargo: 1.62.1
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.3 (outdated, latest: 1.0.4)
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.3,
  › tauri-build [RUST]: 1.0.3,
  › tao [RUST]: 0.12.1,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:5173/config
  › framework: Vue.js

App directory structure
  ├─ .rsw
  ├─ .vscode
  ├─ cypress
  ├─ dist
  ├─ node_modules
  ├─ plugins
  ├─ public
  ├─ src
  ├─ src-rsw
  └─ src-tauri

Stack trace

No response

Additional context

No response

amrbashir commented 2 years ago

That's expected, radius is part of the decorations and removing decorations will remove radius, border, shadows etc. If you want rounded corners on Win11, use https://github.com/tauri-apps/window-shadows which will make your window has shadows on win <= 11 and rounded on Win11 while still removing the titlebar

WuYunlong commented 2 years ago

The same problem exists under Mac

FabianLars commented 2 years ago

@WuYunlong If you wanna keep the native window controls (the colored buttons), see this issue: https://github.com/tauri-apps/tauri/issues/2663#issuecomment-1123208310

For actually undecorated windows it's a little tricky. There was a PR to window-vibrancy which added this and there was someone on the discord i think, trying to make it a standalone crate, but it didn't work iirc, like it just crashed the app or something.

sohaha commented 1 year ago

Same needs.

nianyi778 commented 6 months ago

The same goes for the mac.