Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Application freezes when resized via a tauri command (Windows only) #3990

Closed
a5huynh opened this issue Apr 28, 2022 · 3 comments
Closed

Comments

@a5huynh
Copy link

a5huynh commented Apr 28, 2022

Describe the bug

On Windows 11, when a window is resized via a tauri command, the window hangs and must be force quit via the task manager. On macOS / linux (Ubuntu 22.04).

A small repo with the error reproducible is available here: https://github.com/a5huynh/win-freeze

Reproduction

With a bare bones main.rs like so:

#![cfg_attr(
    all(not(debug_assertions), target_os = "windows"),
    windows_subsystem = "windows"
)]

use tauri::{LogicalSize, Size, Window};

fn main() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![resize_window])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

#[tauri::command]
fn resize_window(window: Window, height: f64) {
    window
        .set_size(Size::Logical(LogicalSize {
            width: 800.0,
            height,
        }))
        .unwrap();
}

Calling resize_window from JS will cause the window to freeze.

Expected behavior

Window should be resized without freezing the window UI.

Platform and versions

Environment
  › OS: Windows 10.0.22000 X64
  › Webview2: 100.0.1185.50
  › MSVC:
      - Visual Studio Community 2017
      - Visual Studio Community 2022
  › Node.js: Not installed!
  › npm: Not installed!
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
WARNING: no lock files found, defaulting to npm
  › @tauri-apps/cli [NPM]: 1.0.0-rc.9
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.0-rc.8,
  › tauri-build [RUST]: 1.0.0-rc.7,
  › tao [RUST]: 0.8.3,
  › wry [RUST]: 0.15.1,

App
  › build-type: bundle
  › CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; script-src 'unsafe-eval' 'unsafe-inline'
  › distDir: ["assets/index.html"]
  › devPath: ["assets/index.html"]
package.json not found

App directory structure
  └─ win-freeze

Stack trace

N/A

Additional context

N/A

@loucass003
Copy link

Maybe related to #2543

@lucasfernog
Copy link
Member

I'm investigating this. For now you can change your command to be async and it'll work.

@lucasfernog
Copy link
Member

/upstream tauri-apps/tao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants