|
@@ -25,7 +25,6 @@ use tauri_utils::{
|
|
html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
|
|
html::{SCRIPT_NONCE_TOKEN, STYLE_NONCE_TOKEN},
|
|
};
|
|
};
|
|
|
|
|
|
-use crate::app::{GlobalMenuEventListener, WindowMenuEvent};
|
|
|
|
use crate::hooks::IpcJavascript;
|
|
use crate::hooks::IpcJavascript;
|
|
#[cfg(feature = "isolation")]
|
|
#[cfg(feature = "isolation")]
|
|
use crate::hooks::IsolationJavascript;
|
|
use crate::hooks::IsolationJavascript;
|
|
@@ -51,6 +50,10 @@ use crate::{
|
|
Context, EventLoopMessage, Icon, Invoke, Manager, Pattern, Runtime, Scopes, StateManager, Window,
|
|
Context, EventLoopMessage, Icon, Invoke, Manager, Pattern, Runtime, Scopes, StateManager, Window,
|
|
WindowEvent,
|
|
WindowEvent,
|
|
};
|
|
};
|
|
|
|
+use crate::{
|
|
|
|
+ app::{GlobalMenuEventListener, WindowMenuEvent},
|
|
|
|
+ window::WindowEmitArgs,
|
|
|
|
+};
|
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
|
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
|
use crate::api::path::{resolve_path, BaseDirectory};
|
|
use crate::api::path::{resolve_path, BaseDirectory};
|
|
@@ -1102,12 +1105,13 @@ impl<R: Runtime> WindowManager<R> {
|
|
S: Serialize + Clone,
|
|
S: Serialize + Clone,
|
|
F: Fn(&Window<R>) -> bool,
|
|
F: Fn(&Window<R>) -> bool,
|
|
{
|
|
{
|
|
|
|
+ let emit_args = WindowEmitArgs::from(event, source_window_label, payload)?;
|
|
assert_event_name_is_valid(event);
|
|
assert_event_name_is_valid(event);
|
|
self
|
|
self
|
|
- .windows_lock()
|
|
|
|
|
|
+ .windows()
|
|
.values()
|
|
.values()
|
|
.filter(|&w| filter(w))
|
|
.filter(|&w| filter(w))
|
|
- .try_for_each(|window| window.emit_internal(event, source_window_label, payload.clone()))
|
|
|
|
|
|
+ .try_for_each(|window| window.emit_internal(&emit_args))
|
|
}
|
|
}
|
|
|
|
|
|
pub fn eval_script_all<S: Into<String>>(&self, script: S) -> crate::Result<()> {
|
|
pub fn eval_script_all<S: Into<String>>(&self, script: S) -> crate::Result<()> {
|