mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix(core): deadlock on focus events with invisible window,#3534 (#3622)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3f45c23a75
commit
c08cc6d500
5
.changes/fix-window-creation-deadlock.md
Normal file
5
.changes/fix-window-creation-deadlock.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime-wry": patch
|
||||
---
|
||||
|
||||
Fixes a deadlock on the `Focused` event when the window is not visible.
|
||||
@@ -2373,7 +2373,12 @@ fn handle_event_loop(
|
||||
.get(&window_id)
|
||||
.map(|w| &w.inner)
|
||||
{
|
||||
webview.focus();
|
||||
// only focus the webview if the window is visible
|
||||
// somehow tao is sending a Focused(true) event even when the window is invisible,
|
||||
// which causes a deadlock: https://github.com/tauri-apps/tauri/issues/3534
|
||||
if webview.window().is_visible() {
|
||||
webview.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user