tauri-apps / tauri

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

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

Open xceyds opened 6 days ago

xceyds commented 6 days ago

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

yuzw1007 commented 5 days ago

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

FabianLars commented 5 days ago

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.

yuzw1007 commented 4 days ago

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