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.64k stars 2.51k forks source link

[bug] MacOS: maximized without dock area covered. #11396

Open wakkana opened 2 hours ago

wakkana commented 2 hours ago

Describe the bug

Hi,

I’m currently trying to build a screenshot application and I need a transparent area for selecting a region to capture. When I use the WebviewWindowBuilder with maximized = true, the dock and top status bar are not covered.

Here is the code snippet I’m using:

let win_builder = WebviewWindowBuilder::new(
    app,
    "screenshot_mask",
    WebviewUrl::App("/screenshot_mask.html".parse().unwrap()),
)
.decorations(false)
.always_on_top(true)
.closable(false)
.transparent(true)
.maximized(true);

let window = win_builder.build().unwrap();
window.show()?;

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.0.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.10.0
    - pnpm: 9.12.1
    - npm: 10.2.4
    - bun: 1.1.30

[-] Packages
    - tauri 🦀: 2.0.4
    - tauri-build 🦀: 2.0.1
    - wry 🦀: 0.46.1
    - tao 🦀: 0.30.3
    - tauri-cli 🦀: 2.0.3
    - @tauri-apps/api : 2.0.2
    - @tauri-apps/cli : 2.0.3

[-] 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: Vue.js
    - bundler: Vite

[-] iOS
    - Developer Teams: None

Stack trace

No response

Additional context

No response

wakkana commented 2 hours ago

1