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] Crash on Windows when turning off window decorations from synchronous command. #4390

Closed
Themayu opened this issue Jun 18, 2022 · 1 comment · Fixed by #4392
Closed
Assignees

Comments

@Themayu
Copy link

Themayu commented Jun 18, 2022

Describe the bug

When calling tauri::Window::set_decorations(&self, false) from a synchronous command on Windows, as in the reproduction code provided below, the application hangs right after turning off decorations before exiting with code 0xCFFFFFFF. Executing the provided reproduction code in an asynchronous command finishes it successfully, with no crash.

Reproduction

The crash can be reproduced with the following command:

#[tauri::command]
pub fn settings_toggle_decorations(window: Window) -> Result<(), ()> {
    window.set_decorations(false);

    Ok(())
}

Executing this command will immediately cause the application to hang before exiting to Windows with no panic message.

(EDIT: apparently blocking_kind doesn't exist for &Result<(), Infallible>, so the return type has been changed to Result<(), ()>)

Expected behavior

The window's decorations are removed and the application continues normally, without crashing.

Platform and versions

cargo tauri info

Environment
  › OS: Windows 10.0.19043 X64
  › Webview2: 102.0.1245.41
  › MSVC: 
      - Visual Studio Enterprise 2019
  › Node.js: 15.3.0
  › npm: 6.14.2
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.63.0-nightly
  › cargo: 1.63.0-nightly
  › Rust toolchain: nightly-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0
  › @tauri-apps/api [NPM]: 1.0.1
  › tauri [RUST]: 1.0.0 (no lockfile),
  › tauri-build [RUST]: no manifest (no lockfile),
  › tao [RUST]: no manifest (no lockfile),
  › wry [RUST]: no manifest (no lockfile),

App
  › build-type: build
  › CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  › distDir: ../dist
  › devPath: http://localhost:10001/
  › bundler: Rollup

App directory structure
  ├─ .cargo
  ├─ .git
  ├─ .vscode
  ├─ dist
  ├─ node_modules
  ├─ src
  ├─ src-common
  ├─ src-macros
  ├─ src-signals
  ├─ src-tauri
  └─ target

Stack trace

Not applicable; application exits with no stack trace. Exit code is 0xCFFFFFFF.

Additional context

This used to work fine in a beta version of tauri; though I can't remember which beta version this was. Possible regression?

@lucasfernog lucasfernog self-assigned this Jun 18, 2022
@lucasfernog
Copy link
Member

Thanks for the report. Will be fixed in the next release.

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

Successfully merging a pull request may close this issue.

2 participants