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.84k stars 2.52k forks source link

[bug] Setting resizable(false) when using WebviewWindow::builder on macOS causes the application to consume excessive CPU, ultimately leading to the program freezing and becoming unresponsive. #11308

Closed suxiaoshao closed 5 days ago

suxiaoshao commented 1 week ago

Describe the bug

Setting resizable(false) when using WebviewWindow::builder on macOS causes the application to consume excessive CPU, ultimately leading to the program freezing and becoming unresponsive.

code:

let window = WebviewWindow::builder(app, "main", tauri::WebviewUrl::App("/".into()))
        .title("ChatGPT")
        .inner_size(800.0, 600.0)
        .fullscreen(false)
        .resizable(false)
        .transparent(true);

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.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.17.0
    - pnpm: 9.11.0
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.0.2
    - tauri-build 🦀: 2.0.1
    - wry 🦀: 0.44.1
    - tao 🦀: 0.30.3
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.0.2

Stack trace

No response

Additional context

No response

hut36 commented 5 days ago

Cannot reproduce here. However, the symptom is very similar to https://github.com/tauri-apps/plugins-workspace/issues/1918. Maybe you have plugin-window-state installed?

suxiaoshao commented 5 days ago

Cannot reproduce here. However, the symptom is very similar to tauri-apps/plugins-workspace#1918. Maybe you have plugin-window-state installed?

yes,I use plugin-window-state,but It seems to be working now in version 2.0.4.

hut36 commented 5 days ago

The problem is triggered only when you have no .window-state.json file. Try delete the file and test again. The path is ~/Library/Application Support/[appid]/.window-state.json.

Anyways, I think you can keep this issue closed as this is not a tauri problem.