-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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] broken IPC in multi window app on Linux #11171
Comments
It appears that this bug was introduced in tauri version I tested with |
My guess is #11043 might be related |
The problem still exists on Tauri 2.0.0 stable |
I just ran into this today too. One other thing I noticed is that the injected window in the For example, this prints #[tauri::command]
async fn cmd_update_settings(settings: Settings, w: WebviewWindow) -> Result<Settings, String> {
println!("UPDATE SETTINGS {}", w.label());
update_settings(&w, settings)
.await
.map_err(|e| e.to_string())
} |
Perhaps the same root cause, but it seems like |
I'm fairly certain this is the cause of the "event listening issue" I described. |
I think I figured out the problem: tauri/crates/tauri-runtime-wry/src/lib.rs Lines 4136 to 4162 in 193dc4e
As documented, on Linux, custom protocols are associated with the web context and thus we can't register a scheme more than once. However, every webview want its own On Linux, only the first window's handlers are registered. |
Describe the bug
In a multi-window Tauri app on Linux, only the first window ever created can receive events and have its
listen
callbacks triggered. All subsequent windows do not receive any events.In this video, the same Tauri app runs on Windows on the left and Linux on the right.
Every window ran
listen("reply", (event) => {alert(event.payload})})
.When the button is pressed, a Rust Tauri command is invoked, which emits the
reply
event.On Windows, the app behaves correctly and every window receives the
reply
event.On Linux, only the first window ever receives any events.
Screencast.from.2024-09-27.23-42-14.mp4
Reproduction
The example shown in the video: https://github.com/Ynng/tauri-listen-test
Or:
cargo run --example multiwindow
Expected behavior
All windows should receive events that are "emitted to all targets".
Full
tauri info
outputStack trace
No response
Additional context
Undoing #11043 fixes this problem, but re-introduces #10981
The text was updated successfully, but these errors were encountered: