tauri-apps / tauri

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

[bug] Titlebar visible despite decorations: false in tauri.conf.json #11296

Open cuervolu opened 1 week ago

cuervolu commented 1 week ago

Describe the bug

Despite setting "decorations": false in my tauri.conf.json, the titlebar is still visible both on Linux and Windows. I have tried clearing the cache and restarting the app, but the issue persists. There are no relevant logs in the console. I also attempted to disable decorations programmatically from lib.rs, but that didn’t solve the problem either.

Reproduction

No response

Expected behavior

The titlebar should not be visible when "decorations": false is set in tauri.conf.json.

Full tauri info output

> @cortex/desktop@ tauri /home/cuervolu/Proyectos/capstone/apps/desktop
> tauri "info"

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: EndeavourOS Rolling Release x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.1
    ✔ rsvg2: 2.59.1
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (2024-05-07)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.13.1
    - pnpm: 9.12.1
    - npm: 10.9.0
    - bun: 1.1.29

[-] Packages
    - tauri 🦀: 2.0.1
    - tauri-build 🦀: 2.0.1
    - wry 🦀: 0.44.1
    - tao 🦀: 0.30.2
    - @tauri-apps/api : 2.0.2
    - @tauri-apps/cli : 2.0.1 (outdated, latest: 2.0.2)

[-] Plugins
    - tauri-plugin-store 🦀: 2.0.1
    - @tauri-apps/plugin-store : 2.0.0
    - tauri-plugin-os 🦀: 2.0.1
    - @tauri-apps/plugin-os : 2.0.0
    - tauri-plugin-process 🦀: 2.0.1
    - @tauri-apps/plugin-process : 2.0.0
    - tauri-plugin-dialog 🦀: 2.0.1
    - @tauri-apps/plugin-dialog : 2.0.0
    - tauri-plugin-log 🦀: 2.0.1
    - @tauri-apps/plugin-log : 2.0.0
    - tauri-plugin-updater 🦀: 2.0.2
    - @tauri-apps/plugin-updater : 2.0.0
    - tauri-plugin-fs 🦀: 2.0.1
    - @tauri-apps/plugin-fs : 2.0.0
    - tauri-plugin-window-state 🦀: 2.0.1
    - @tauri-apps/plugin-window-state : 2.0.0
    - tauri-plugin-notification 🦀: 2.0.1
    - @tauri-apps/plugin-notification : 2.0.0
    - tauri-plugin-shell 🦀: 2.0.1
    - @tauri-apps/plugin-shell : 2.0.0

[-] App
    - build-type: bundle
    - CSP: img-src 'self' asset: http://asset.localhost blob: data:; connect-src 'self' ipc: http://ipc.localhost tauri: asset: https://asset.localhost; style-src 'unsafe-inline' 'self'; script-src 'self' 'unsafe-eval'; default-src 'self' blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-inline' asset: https://asset.localhost
    - frontendDist: ../dist
    - devUrl: http://localhost:3000/
    - framework: Vue.js (Nuxt)
    - bundler: Webpack

Stack trace

No response

Additional context

image

It's very strange, this is the first time this has happened. The only difference compared to my other Tauri projects is that this one is a monorepo. In case you'd like to check out the repository, I'll leave the link here.

FabianLars commented 1 week ago
      {
        "label": "main",
        "title": "Cortex",
        "width": 1100,
        "height": 650,
        "resizable": true,
        "fullscreen": false,
        "center": true,
        "minHeight": 600,
        "minWidth": 800,
        "decorations": false,
        "titleBarStyle": "Overlay",
        "hiddenTitle": true,
        "transparent": true,
        "shadow": true,
        "visible": false
      }

What if you remove titleBarStyle and/or hiddenTitle? Also, not related but you don't need the window-vibrancy crate anymore. It was integrated into tauri v2 via the windowEffects config.

cuervolu commented 1 week ago

Thanks for the tip, I'll modify my code to remove the crate. Regarding the other issue, I removed titleBarStyle and hiddenTitle, but at least on Linux, the title bar still remains.

Something I need to mention is that I was experimenting with my team members on different PCs and noticed something strange. First, on a PC with Windows 10 and Webview version 129.0.2792.79, the native title bar does not appear. This puzzled us, so we tried it on a PC with Windows 11 with a more recent version of Webview, and the title bar did show up. Oddly enough, on another PC with Windows 11, it did not appear. Meanwhile, on yet another PC with Windows 10, the title bar did show up.

What we did was go to the Apps & Features Tool in Windows 11 and clicked on "Repair" in the Webview application, and that fixed the issue on Windows. However, this brings the problem that the behavior will be different on each PC. Meanwhile, on Linux, I tried reinstalling webkit2gtk, but it didn't solve the issue.