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.38k stars 2.58k forks source link

[bug] Incorrect height returned for innerSize on Windows since 2.1.0 #11644

Closed dgerhardt closed 1 week ago

dgerhardt commented 1 week ago

Describe the bug

Tauri no longer returns the correct height value when calling WebviewWindow.innerSize() on Windows since 2.1.0. The value is lower (-23px) than expected.

Reproduction

  const win = WebviewWindow.getCurrent();
  // scaleFactor == 1.0 expected for simplicity
  const size = await win.innerSize();
  win.setSize(size);

Expected behavior

Full tauri info output

[✔] Environment
    - OS: Ubuntu 24.4.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.0
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.18.0
    - yarn: 1.22.19
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.1.0
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.0
    - tao 🦀: 0.30.6
    - @tauri-apps/api : 2.1.0
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

I only tested on Windows 10.