tauri-apps / tauri

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

[bug] [v2] Issue with Decorations floating above the window on MacOS #9673

Open TheSeamau5 opened 1 week ago

TheSeamau5 commented 1 week ago

Describe the bug

Background: I am building a multi-page application on Tauri v2

My goal: On some, but not all, pages have the decorations on overlay on the window, no title bar (+ transparency)

Issue: Decorations were floating above the window, out of reach of css

See how the decorations are above the window image

This seems to happen whenever decorations were set to false initially (for example in the tauri config) and later set to true

This is how decorations look normally when set to true in tauri config image

The problem is that I am trying to set decorations selectively on pages. Some pages will have them and some won't.

Reproduction

Set "decorations": false in the tauri config json and later in JS (for example onMount) call getCurrent().setDecorations(true)

I have also noticed it happen when:

  1. Set "decorations": true in the tauri config json
  2. Set getCurrent().setDecorations(false) on mount
  3. Later in program set getCurrent().setDecorations(true)

Expected behavior

The expected behavior is that the decorations always show up inside the window and never above, regardless of the previous state of the decorations or how often it was toggled true and false. image

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 20.6.1
    - pnpm: 7.25.1
    - yarn: 1.22.19
    - npm: 10.2.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.17
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - tauri-cli [RUST]: 1.5.11
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.15

[-] App
    - build-type: bundle
    - CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'; connect-src ipc: http://ipc.localhost
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: SolidJS
    - bundler: Vite

Stack trace

No response

Additional context

No response