diff --git a/.changes/fix-listen_global-not-getting-events.md b/.changes/fix-listen_global-not-getting-events.md new file mode 100644 index 000000000..d1d671174 --- /dev/null +++ b/.changes/fix-listen_global-not-getting-events.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fixes `app.listen_global` not receiving events emitted in javascript. \ No newline at end of file diff --git a/core/tauri/src/event.rs b/core/tauri/src/event.rs index 40370f0e8..6871f076f 100644 --- a/core/tauri/src/event.rs +++ b/core/tauri/src/event.rs @@ -194,7 +194,7 @@ impl Listeners { Ok(lock) => { if let Some(handlers) = lock.get(event) { for (&id, handler) in handlers { - if window.is_none() || window == handler.window { + if handler.window.is_none() || window == handler.window { maybe_pending = true; (handler.callback)(self::Event { id,