|
@@ -21,8 +21,8 @@ use tauri_runtime::{
|
|
WindowBuilderBase, WindowEvent, WindowId,
|
|
WindowBuilderBase, WindowEvent, WindowId,
|
|
},
|
|
},
|
|
DeviceEventFilter, Error, EventLoopProxy, ExitRequestedEventAction, Icon, Result, RunEvent,
|
|
DeviceEventFilter, Error, EventLoopProxy, ExitRequestedEventAction, Icon, Result, RunEvent,
|
|
- RunIteration, Runtime, RuntimeHandle, RuntimeInitArgs, UserAttentionType, UserEvent,
|
|
|
|
- WebviewDispatch, WindowDispatch, WindowEventId,
|
|
|
|
|
|
+ Runtime, RuntimeHandle, RuntimeInitArgs, UserAttentionType, UserEvent, WebviewDispatch,
|
|
|
|
+ WindowDispatch, WindowEventId,
|
|
};
|
|
};
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
#[cfg(target_os = "macos")]
|
|
@@ -2286,7 +2286,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
}
|
|
}
|
|
|
|
|
|
#[cfg(desktop)]
|
|
#[cfg(desktop)]
|
|
- fn run_iteration<F: FnMut(RunEvent<T>) + 'static>(&mut self, mut callback: F) -> RunIteration {
|
|
|
|
|
|
+ fn run_iteration<F: FnMut(RunEvent<T>)>(&mut self, mut callback: F) {
|
|
use tao::platform::run_return::EventLoopExtRunReturn;
|
|
use tao::platform::run_return::EventLoopExtRunReturn;
|
|
let windows = self.context.main_thread.windows.clone();
|
|
let windows = self.context.main_thread.windows.clone();
|
|
let webview_id_map = self.context.webview_id_map.clone();
|
|
let webview_id_map = self.context.webview_id_map.clone();
|
|
@@ -2296,8 +2296,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
#[cfg(feature = "tracing")]
|
|
#[cfg(feature = "tracing")]
|
|
let active_tracing_spans = self.context.main_thread.active_tracing_spans.clone();
|
|
let active_tracing_spans = self.context.main_thread.active_tracing_spans.clone();
|
|
|
|
|
|
- let mut iteration = RunIteration::default();
|
|
|
|
-
|
|
|
|
let proxy = self.event_loop.create_proxy();
|
|
let proxy = self.event_loop.create_proxy();
|
|
|
|
|
|
self
|
|
self
|
|
@@ -2328,7 +2326,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- iteration = handle_event_loop(
|
|
|
|
|
|
+ handle_event_loop(
|
|
event,
|
|
event,
|
|
event_loop,
|
|
event_loop,
|
|
control_flow,
|
|
control_flow,
|
|
@@ -2341,8 +2339,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
},
|
|
},
|
|
);
|
|
);
|
|
});
|
|
});
|
|
-
|
|
|
|
- iteration
|
|
|
|
}
|
|
}
|
|
|
|
|
|
fn run<F: FnMut(RunEvent<T>) + 'static>(self, mut callback: F) {
|
|
fn run<F: FnMut(RunEvent<T>) + 'static>(self, mut callback: F) {
|
|
@@ -2392,7 +2388,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
}
|
|
}
|
|
|
|
|
|
pub struct EventLoopIterationContext<'a, T: UserEvent> {
|
|
pub struct EventLoopIterationContext<'a, T: UserEvent> {
|
|
- pub callback: &'a mut (dyn FnMut(RunEvent<T>) + 'static),
|
|
|
|
|
|
+ pub callback: &'a mut (dyn FnMut(RunEvent<T>)),
|
|
pub webview_id_map: WindowIdStore,
|
|
pub webview_id_map: WindowIdStore,
|
|
pub windows: Rc<RefCell<HashMap<WindowId, WindowWrapper>>>,
|
|
pub windows: Rc<RefCell<HashMap<WindowId, WindowWrapper>>>,
|
|
#[cfg(feature = "tracing")]
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2408,7 +2404,7 @@ fn handle_user_message<T: UserEvent>(
|
|
event_loop: &EventLoopWindowTarget<Message<T>>,
|
|
event_loop: &EventLoopWindowTarget<Message<T>>,
|
|
message: Message<T>,
|
|
message: Message<T>,
|
|
context: UserMessageContext,
|
|
context: UserMessageContext,
|
|
-) -> RunIteration {
|
|
|
|
|
|
+) {
|
|
let UserMessageContext {
|
|
let UserMessageContext {
|
|
webview_id_map,
|
|
webview_id_map,
|
|
windows,
|
|
windows,
|
|
@@ -2825,11 +2821,6 @@ fn handle_user_message<T: UserEvent>(
|
|
|
|
|
|
Message::UserEvent(_) => (),
|
|
Message::UserEvent(_) => (),
|
|
}
|
|
}
|
|
-
|
|
|
|
- let it = RunIteration {
|
|
|
|
- window_count: windows.borrow().len(),
|
|
|
|
- };
|
|
|
|
- it
|
|
|
|
}
|
|
}
|
|
|
|
|
|
fn handle_event_loop<T: UserEvent>(
|
|
fn handle_event_loop<T: UserEvent>(
|
|
@@ -2837,7 +2828,7 @@ fn handle_event_loop<T: UserEvent>(
|
|
event_loop: &EventLoopWindowTarget<Message<T>>,
|
|
event_loop: &EventLoopWindowTarget<Message<T>>,
|
|
control_flow: &mut ControlFlow,
|
|
control_flow: &mut ControlFlow,
|
|
context: EventLoopIterationContext<'_, T>,
|
|
context: EventLoopIterationContext<'_, T>,
|
|
-) -> RunIteration {
|
|
|
|
|
|
+) {
|
|
let EventLoopIterationContext {
|
|
let EventLoopIterationContext {
|
|
callback,
|
|
callback,
|
|
webview_id_map,
|
|
webview_id_map,
|
|
@@ -2994,7 +2985,7 @@ fn handle_event_loop<T: UserEvent>(
|
|
}
|
|
}
|
|
Message::UserEvent(t) => callback(RunEvent::UserEvent(t)),
|
|
Message::UserEvent(t) => callback(RunEvent::UserEvent(t)),
|
|
message => {
|
|
message => {
|
|
- return handle_user_message(
|
|
|
|
|
|
+ handle_user_message(
|
|
event_loop,
|
|
event_loop,
|
|
message,
|
|
message,
|
|
UserMessageContext {
|
|
UserMessageContext {
|
|
@@ -3010,15 +3001,10 @@ fn handle_event_loop<T: UserEvent>(
|
|
}
|
|
}
|
|
_ => (),
|
|
_ => (),
|
|
}
|
|
}
|
|
-
|
|
|
|
- let it = RunIteration {
|
|
|
|
- window_count: windows.borrow().len(),
|
|
|
|
- };
|
|
|
|
- it
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-fn on_close_requested<'a, T: UserEvent>(
|
|
|
|
- callback: &'a mut (dyn FnMut(RunEvent<T>) + 'static),
|
|
|
|
|
|
+fn on_close_requested<T: UserEvent>(
|
|
|
|
+ callback: &mut (dyn FnMut(RunEvent<T>)),
|
|
window_id: WindowId,
|
|
window_id: WindowId,
|
|
windows: Rc<RefCell<HashMap<WindowId, WindowWrapper>>>,
|
|
windows: Rc<RefCell<HashMap<WindowId, WindowWrapper>>>,
|
|
) {
|
|
) {
|