tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Tauriv2 Windows 10 borderless window has a black line at the top

Open xceyds opened this issue 1 year ago • 6 comments

Describe the bug

When using a borderless window on Windows 10 with Tauriv2, there's a black line appearing at the top of the window. This line seems to be part of the window's rendering, even though it should be completely borderless. 1

Reproduction

No response

Expected behavior

No response

Full tauri info output

✔ OS: Windows 10.0.22631 x86_64 (X64)
✔ WebView2: 128.0.2739.79
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
✔ node: 20.17.0
✔ npm: 10.8.2

[-] Packages
    ✔ tauri 🦀: 2.0.0-rc.15
    ✔ tauri-build 🦀: 2.0.0-rc.12
    ✔ wry 🦀: 0.43.1
    ✔ tao 🦀: 0.30.1
    ✖ @tauri-apps/api: not installed!
    ✔ @tauri-apps/cli: 2.0.0-rc.16

[-] Plugins
    ✔ tauri-plugin-shell 🦀: 2.0.0-rc.3
    ✖ @tauri-apps/plugin-shell: not installed!

[-] App
    ✔ build-type: bundle
    ✖ CSP: unset
    ✔ frontendDist: ../src

Stack trace

No response

Additional context

No response

xceyds avatar Sep 22 '24 16:09 xceyds

我也遇到这个问题,还没找到解决办法。

yuzw1007 avatar Sep 23 '24 05:09 yuzw1007

This currently can only be "fixed" by disabling the window shadows ("shadows": false in the window config).

It's a pretty old issue, see https://github.com/rust-windowing/winit/blob/master/src/platform_impl/windows/event_loop.rs#L1087-L1097 for example (winit is tao's upstream, rust's main windowing library). I'd like to check if what they're talking about there is an issue for us too but i can't give you a time estimate nor can i promise that it'll work.

FabianLars avatar Sep 23 '24 11:09 FabianLars

这个黑线只有在窗口获取焦点时才有,失去焦点时窗口不存在这个条黑线。

yuzw1007 avatar Sep 24 '24 05:09 yuzw1007

在windows10下,我也遇到了这个问题,希望官方给出解决方案。

xiaoyan2015 avatar Oct 12 '24 00:10 xiaoyan2015

360截图20240927000432314 当设置透明窗口transparent: true,隐藏窗口阴影shadow: false,顶部黑色1px就没有。然后通过css设置窗口透明圆角阴影,是可以实现的。

xiaoyan2015 avatar Oct 12 '24 00:10 xiaoyan2015

360截图20241012083429343 When only using a borderless (decorations: false) window on Windows 10 with Tauri v2, there's a black line appearing at the top of the window。

xiaoyan2015 avatar Oct 12 '24 00:10 xiaoyan2015

fixed in v2.3.0

xceyds avatar Feb 27 '25 01:02 xceyds