Skip to content

[bug] tauri://focus or tauri://blur freezes the app on Windows #4533

Description

@AmionSky

Describe the bug

The app freezes when the listened tauri://focus or tauri://blur event fires

Reproduction

npm create tauri-app
create-vite -> vanilla
add this to main.js

import { appWindow } from '@tauri-apps/api/window'
appWindow.listen('tauri://focus', () => {
  console.log('focused')
})
appWindow.listen('tauri://blur', () => {
  console.log('blurred')
})

npm run tauri dev
Click off the tauri window and then click back on it
Now the window is frozen, cannot be moved, resized or closed. After a few clicks Windows will notice the app is not responding and gives the option to force close.

Expected behavior

The events fire without freezing the app completly.

Platform and versions

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

Packages
  › @tauri-apps/cli [NPM]: 1.0.1
  › @tauri-apps/api [NPM]: 1.0.1
  › tauri [RUST]: 1.0.1,
  › tauri-build [RUST]: 1.0.1,
  › tao [RUST]: 0.12.0,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/

App directory structure
  ├─ dist
  ├─ node_modules
  └─ src-tauri

Stack trace

No response

Additional context

Only have the issue on Windows, tested on Arch Linux and it works as expected.

When force closing the app with Ctrl-C, this line appears:
[0630/104330.338:ERROR:window_impl.cc(114)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions