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.73k stars 2.59k forks source link

[bug] Window Size and Fullscreen Issues with decoration: false #11788

Closed floriskn closed 3 days ago

floriskn commented 4 days ago

Describe the bug

When using a Tauri application with decoration: false, several issues occur with window sizing, particularly in fullscreen mode:

  1. Inner Window Size in Fullscreen:

    • When transitioning from a non-maximized window to fullscreen, the inner WRY webview is slightly smaller (by about one pixel).
    • These issues only appear when decoration: false; with decoration: true, the behavior is correct.

    Example 1
    Example 2
    Example 3

  2. Unexpected Borders in Fullscreen:

    • A white or black border sometimes appears when in fullscreen mode.

    Fullscreen Border Issue

  3. Incorrect Window Size on Creation:

    • A window configured with dimensions 800x600 creates an outer window of 816x639 pixels.
    • The inner WRY webview further deviates to 814x637 pixels.

    Outer Window Dimensions
    Inner Webview Dimensions

  4. Fullscreen Issues After Maximization:

    • If the window is maximized before entering fullscreen, the window becomes even more misaligned, with a 40-pixel offset and overflowing content on the right side of the screen.

    Fullscreen Overflow 1
    Fullscreen Overflow 2
    Fullscreen Overflow 3

Reproduction

Steps to Reproduce

  1. Create a Tauri window with the following configuration:
    {
    "width": 800,
    "height": 600,
    "fullscreen": false,
    "decoration": false
    }
  2. Observe the created window dimensions.
  3. Enter fullscreen mode from a non-maximized state, then exit fullscreen.
  4. Maximize the window, then enter fullscreen again.
  5. Observe borders and overflow behavior in both scenarios.

Expected behavior

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 x86_64 (X64)
    ✔ WebView2: 131.0.2903.63
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.11.1
    - npm: 10.2.4

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - tauri-cli 🦀: 1.2.2
    - @tauri-apps/api : 2.1.1
    - @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: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

This issue does not occur when decoration: true

ansirotenko commented 4 days ago

In addition, after updating to tauri 2.0.6, for any window with decoration is set to false view higit will be calculated wrongly. For example for window with settings:

{
    "width": 530,
    "height": 285,
    "decorations": false,
}

actual hieght will be 324 pixels.

In case decoration is set to true, hight will be calculated correctly

itunic commented 3 days ago

I also encountered this issue: when setting decoration to false, there are problems with width and height calculations, and the window's move handle (title bar) also doesn't work properly, and it never takes effect.

amrbashir commented 3 days ago

this should be fixed with the next release of tao see https://github.com/tauri-apps/tao/pull/1010

itunic commented 9 hours ago

this should be fixed with the next release of see tauri-apps/tao#1010tao

Thanks for the update. Could you please let me know when the next release is expected to be out?