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

[bug] Can't remove background on MacOS with decorations off #11635

Closed CarsonMcKinstry closed 2 weeks ago

CarsonMcKinstry commented 2 weeks ago

Describe the bug

I'm not sure if I'm just messing something up or if there's actually a bug happening here. But based on the screenshot, I have some "overhang" which is the window itself, rather than any particular styling. Note: I'd prefer not using the macOSPrivateApi, but if that's really what I need to do, so be it.

Screenshot:

Screenshot 2024-11-10 at 13 03 56

Reproduction

Tauri.conf.json

{
  "build": {
    "beforeDevCommand": "yarn dev",
    "beforeBuildCommand": "yarn build",
    "frontendDist": "../dist",
    "devUrl": "http://localhost:1420"
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/128x128@2x.png",
      "icons/icon.icns",
      "icons/icon.ico"
    ],
    "createUpdaterArtifacts": "v1Compatible"
  },
  "productName": "my-product",
  "version": "0.0.0",
  "identifier": "MyProduct",
  "plugins": {},
  "app": {
    "security": {
      "csp": null
    },
    "windows": [
      {
        "width": 1280,
        "height": 832,
        "resizable": true,
        "transparent": true,
        "decorations": false,
        "shadow": false,
        "focus": true
      }
    ]
  }
}

Capabilities/migrated.json

{
  "identifier": "migrated",
  "description": "permissions that were migrated from v1",
  "local": true,
  "windows": [
    "main"
  ],
  "permissions": [
    "core:path:default",
    "core:event:default",
    "core:window:default",
    "core:window:allow-start-dragging",
    "core:app:default",
    "core:resources:default",
    "core:menu:default",
    "core:tray:default",
    "shell:allow-open",
    "shell:default"
  ]
}

index.css

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: rgba(0, 0, 0, 0);
  border-radius: 18px;
  overflow: hidden;
}

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.5.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.10.0
    - yarn: 1.22.21
    - npm: 10.9.0
    - bun: 1.0.19

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

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

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

Stack trace

No response

Additional context

No response

FabianLars commented 2 weeks ago

On macOS you also need to set app.macOSPrivateApi to true for transparency.