|
@@ -24,66 +24,65 @@ use tauri_runtime::{
|
|
|
WindowEventId,
|
|
|
};
|
|
|
|
|
|
-#[cfg(windows)]
|
|
|
-use webview2_com::FocusChangedEventHandler;
|
|
|
-#[cfg(windows)]
|
|
|
-use windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken};
|
|
|
#[cfg(target_os = "macos")]
|
|
|
-use wry::application::platform::macos::EventLoopWindowTargetExtMacOS;
|
|
|
+use tao::platform::macos::EventLoopWindowTargetExtMacOS;
|
|
|
#[cfg(target_os = "macos")]
|
|
|
-use wry::application::platform::macos::WindowBuilderExtMacOS;
|
|
|
+use tao::platform::macos::WindowBuilderExtMacOS;
|
|
|
#[cfg(target_os = "linux")]
|
|
|
-use wry::application::platform::unix::{WindowBuilderExtUnix, WindowExtUnix};
|
|
|
+use tao::platform::unix::{WindowBuilderExtUnix, WindowExtUnix};
|
|
|
#[cfg(windows)]
|
|
|
-use wry::application::platform::windows::{WindowBuilderExtWindows, WindowExtWindows};
|
|
|
+use tao::platform::windows::{WindowBuilderExtWindows, WindowExtWindows};
|
|
|
+#[cfg(windows)]
|
|
|
+use webview2_com::FocusChangedEventHandler;
|
|
|
+#[cfg(windows)]
|
|
|
+use windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken};
|
|
|
#[cfg(windows)]
|
|
|
-use wry::webview::WebViewBuilderExtWindows;
|
|
|
+use wry::WebViewBuilderExtWindows;
|
|
|
|
|
|
+use tao::{
|
|
|
+ dpi::{
|
|
|
+ LogicalPosition as TaoLogicalPosition, LogicalSize as TaoLogicalSize,
|
|
|
+ PhysicalPosition as TaoPhysicalPosition, PhysicalSize as TaoPhysicalSize,
|
|
|
+ Position as TaoPosition, Size as TaoSize,
|
|
|
+ },
|
|
|
+ event::{Event, StartCause, WindowEvent as TaoWindowEvent},
|
|
|
+ event_loop::{
|
|
|
+ ControlFlow, DeviceEventFilter as TaoDeviceEventFilter, EventLoop, EventLoopBuilder,
|
|
|
+ EventLoopProxy as TaoEventLoopProxy, EventLoopWindowTarget,
|
|
|
+ },
|
|
|
+ monitor::MonitorHandle,
|
|
|
+ window::{
|
|
|
+ CursorIcon as TaoCursorIcon, Fullscreen, Icon as TaoWindowIcon,
|
|
|
+ ProgressBarState as TaoProgressBarState, ProgressState as TaoProgressState, Theme as TaoTheme,
|
|
|
+ UserAttentionType as TaoUserAttentionType,
|
|
|
+ },
|
|
|
+};
|
|
|
#[cfg(target_os = "macos")]
|
|
|
use tauri_utils::TitleBarStyle;
|
|
|
use tauri_utils::{
|
|
|
config::WindowConfig, debug_eprintln, ProgressBarState, ProgressBarStatus, Theme,
|
|
|
};
|
|
|
-use wry::{
|
|
|
- application::{
|
|
|
- dpi::{
|
|
|
- LogicalPosition as WryLogicalPosition, LogicalSize as WryLogicalSize,
|
|
|
- PhysicalPosition as WryPhysicalPosition, PhysicalSize as WryPhysicalSize,
|
|
|
- Position as WryPosition, Size as WrySize,
|
|
|
- },
|
|
|
- event::{Event, StartCause, WindowEvent as WryWindowEvent},
|
|
|
- event_loop::{
|
|
|
- ControlFlow, DeviceEventFilter as WryDeviceEventFilter, EventLoop, EventLoopBuilder,
|
|
|
- EventLoopProxy as WryEventLoopProxy, EventLoopWindowTarget,
|
|
|
- },
|
|
|
- monitor::MonitorHandle,
|
|
|
- window::{
|
|
|
- CursorIcon as WryCursorIcon, Fullscreen, Icon as WryWindowIcon,
|
|
|
- ProgressBarState as WryProgressBarState, ProgressState as WryProgressState,
|
|
|
- Theme as WryTheme, UserAttentionType as WryUserAttentionType,
|
|
|
- },
|
|
|
- },
|
|
|
- webview::{FileDropEvent as WryFileDropEvent, Url, WebContext, WebView, WebViewBuilder},
|
|
|
-};
|
|
|
+use wry::{FileDropEvent as WryFileDropEvent, Url, WebContext, WebView, WebViewBuilder};
|
|
|
|
|
|
+pub use tao;
|
|
|
+pub use tao::window::{Window, WindowBuilder as TaoWindowBuilder, WindowId};
|
|
|
pub use wry;
|
|
|
-pub use wry::application::window::{Window, WindowBuilder as WryWindowBuilder, WindowId};
|
|
|
-pub use wry::webview::webview_version;
|
|
|
+pub use wry::webview_version;
|
|
|
|
|
|
#[cfg(windows)]
|
|
|
-use wry::webview::WebviewExtWindows;
|
|
|
+use wry::WebViewExtWindows;
|
|
|
#[cfg(target_os = "android")]
|
|
|
-use wry::webview::{
|
|
|
+use wry::{
|
|
|
prelude::{dispatch, find_class},
|
|
|
- WebViewBuilderExtAndroid, WebviewExtAndroid,
|
|
|
+ WebViewBuilderExtAndroid, WebViewExtAndroid,
|
|
|
};
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
-use tauri_runtime::ActivationPolicy;
|
|
|
-#[cfg(target_os = "macos")]
|
|
|
-pub use wry::application::platform::macos::{
|
|
|
- ActivationPolicy as WryActivationPolicy, EventLoopExtMacOS, WindowExtMacOS,
|
|
|
+pub use tao::platform::macos::{
|
|
|
+ ActivationPolicy as TaoActivationPolicy, EventLoopExtMacOS, WindowExtMacOS,
|
|
|
};
|
|
|
+#[cfg(target_os = "macos")]
|
|
|
+use tauri_runtime::ActivationPolicy;
|
|
|
|
|
|
use std::{
|
|
|
cell::RefCell,
|
|
@@ -104,8 +103,8 @@ use std::{
|
|
|
};
|
|
|
|
|
|
pub type WebviewId = u32;
|
|
|
-type IpcHandler = dyn Fn(&Window, String) + 'static;
|
|
|
-type FileDropHandler = dyn Fn(&Window, WryFileDropEvent) -> bool + 'static;
|
|
|
+type IpcHandler = dyn Fn(String) + 'static;
|
|
|
+type FileDropHandler = dyn Fn(WryFileDropEvent) -> bool + 'static;
|
|
|
|
|
|
mod webview;
|
|
|
pub use webview::Webview;
|
|
@@ -172,7 +171,7 @@ pub(crate) fn send_user_message<T: UserEvent>(
|
|
|
pub struct Context<T: UserEvent> {
|
|
|
pub webview_id_map: WebviewIdStore,
|
|
|
main_thread_id: ThreadId,
|
|
|
- pub proxy: WryEventLoopProxy<Message<T>>,
|
|
|
+ pub proxy: TaoEventLoopProxy<Message<T>>,
|
|
|
main_thread: DispatcherMainThreadContext<T>,
|
|
|
plugins: Arc<Mutex<Vec<Box<dyn Plugin<T> + Send>>>>,
|
|
|
next_window_id: Arc<AtomicU32>,
|
|
@@ -275,29 +274,29 @@ impl<T: UserEvent> fmt::Debug for Context<T> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct DeviceEventFilterWrapper(pub WryDeviceEventFilter);
|
|
|
+pub struct DeviceEventFilterWrapper(pub TaoDeviceEventFilter);
|
|
|
|
|
|
impl From<DeviceEventFilter> for DeviceEventFilterWrapper {
|
|
|
fn from(item: DeviceEventFilter) -> Self {
|
|
|
match item {
|
|
|
- DeviceEventFilter::Always => Self(WryDeviceEventFilter::Always),
|
|
|
- DeviceEventFilter::Never => Self(WryDeviceEventFilter::Never),
|
|
|
- DeviceEventFilter::Unfocused => Self(WryDeviceEventFilter::Unfocused),
|
|
|
+ DeviceEventFilter::Always => Self(TaoDeviceEventFilter::Always),
|
|
|
+ DeviceEventFilter::Never => Self(TaoDeviceEventFilter::Never),
|
|
|
+ DeviceEventFilter::Unfocused => Self(TaoDeviceEventFilter::Unfocused),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/// Wrapper around a [`wry::application::window::Icon`] that can be created from an [`Icon`].
|
|
|
-pub struct WryIcon(pub WryWindowIcon);
|
|
|
+/// Wrapper around a [`tao::window::Icon`] that can be created from an [`Icon`].
|
|
|
+pub struct TaoIcon(pub TaoWindowIcon);
|
|
|
|
|
|
fn icon_err<E: std::error::Error + Send + Sync + 'static>(e: E) -> Error {
|
|
|
Error::InvalidIcon(Box::new(e))
|
|
|
}
|
|
|
|
|
|
-impl TryFrom<Icon> for WryIcon {
|
|
|
+impl TryFrom<Icon> for TaoIcon {
|
|
|
type Error = Error;
|
|
|
fn try_from(icon: Icon) -> std::result::Result<Self, Self::Error> {
|
|
|
- WryWindowIcon::from_rgba(icon.rgba, icon.width, icon.height)
|
|
|
+ TaoWindowIcon::from_rgba(icon.rgba, icon.width, icon.height)
|
|
|
.map(Self)
|
|
|
.map_err(icon_err)
|
|
|
}
|
|
@@ -306,11 +305,11 @@ impl TryFrom<Icon> for WryIcon {
|
|
|
pub struct WindowEventWrapper(pub Option<WindowEvent>);
|
|
|
|
|
|
impl WindowEventWrapper {
|
|
|
- fn parse(webview: &Option<WindowHandle>, event: &WryWindowEvent<'_>) -> Self {
|
|
|
+ fn parse(webview: &Option<WindowHandle>, event: &TaoWindowEvent<'_>) -> Self {
|
|
|
match event {
|
|
|
// resized event from tao doesn't include a reliable size on macOS
|
|
|
// because wry replaces the NSView
|
|
|
- WryWindowEvent::Resized(_) => {
|
|
|
+ TaoWindowEvent::Resized(_) => {
|
|
|
if let Some(webview) = webview {
|
|
|
Self(Some(WindowEvent::Resized(
|
|
|
PhysicalSizeWrapper(webview.inner_size()).into(),
|
|
@@ -324,23 +323,23 @@ impl WindowEventWrapper {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub fn map_theme(theme: &WryTheme) -> Theme {
|
|
|
+pub fn map_theme(theme: &TaoTheme) -> Theme {
|
|
|
match theme {
|
|
|
- WryTheme::Light => Theme::Light,
|
|
|
- WryTheme::Dark => Theme::Dark,
|
|
|
+ TaoTheme::Light => Theme::Light,
|
|
|
+ TaoTheme::Dark => Theme::Dark,
|
|
|
_ => Theme::Light,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-impl<'a> From<&WryWindowEvent<'a>> for WindowEventWrapper {
|
|
|
- fn from(event: &WryWindowEvent<'a>) -> Self {
|
|
|
+impl<'a> From<&TaoWindowEvent<'a>> for WindowEventWrapper {
|
|
|
+ fn from(event: &TaoWindowEvent<'a>) -> Self {
|
|
|
let event = match event {
|
|
|
- WryWindowEvent::Resized(size) => WindowEvent::Resized(PhysicalSizeWrapper(*size).into()),
|
|
|
- WryWindowEvent::Moved(position) => {
|
|
|
+ TaoWindowEvent::Resized(size) => WindowEvent::Resized(PhysicalSizeWrapper(*size).into()),
|
|
|
+ TaoWindowEvent::Moved(position) => {
|
|
|
WindowEvent::Moved(PhysicalPositionWrapper(*position).into())
|
|
|
}
|
|
|
- WryWindowEvent::Destroyed => WindowEvent::Destroyed,
|
|
|
- WryWindowEvent::ScaleFactorChanged {
|
|
|
+ TaoWindowEvent::Destroyed => WindowEvent::Destroyed,
|
|
|
+ TaoWindowEvent::ScaleFactorChanged {
|
|
|
scale_factor,
|
|
|
new_inner_size,
|
|
|
} => WindowEvent::ScaleFactorChanged {
|
|
@@ -348,8 +347,8 @@ impl<'a> From<&WryWindowEvent<'a>> for WindowEventWrapper {
|
|
|
new_inner_size: PhysicalSizeWrapper(**new_inner_size).into(),
|
|
|
},
|
|
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
|
|
- WryWindowEvent::Focused(focused) => WindowEvent::Focused(*focused),
|
|
|
- WryWindowEvent::ThemeChanged(theme) => WindowEvent::ThemeChanged(map_theme(theme)),
|
|
|
+ TaoWindowEvent::Focused(focused) => WindowEvent::Focused(*focused),
|
|
|
+ TaoWindowEvent::ThemeChanged(theme) => WindowEvent::ThemeChanged(map_theme(theme)),
|
|
|
_ => return Self(None),
|
|
|
};
|
|
|
Self(Some(event))
|
|
@@ -378,7 +377,7 @@ impl From<MonitorHandleWrapper> for Monitor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct PhysicalPositionWrapper<T>(pub WryPhysicalPosition<T>);
|
|
|
+pub struct PhysicalPositionWrapper<T>(pub TaoPhysicalPosition<T>);
|
|
|
|
|
|
impl<T> From<PhysicalPositionWrapper<T>> for PhysicalPosition<T> {
|
|
|
fn from(position: PhysicalPositionWrapper<T>) -> Self {
|
|
@@ -391,25 +390,25 @@ impl<T> From<PhysicalPositionWrapper<T>> for PhysicalPosition<T> {
|
|
|
|
|
|
impl<T> From<PhysicalPosition<T>> for PhysicalPositionWrapper<T> {
|
|
|
fn from(position: PhysicalPosition<T>) -> Self {
|
|
|
- Self(WryPhysicalPosition {
|
|
|
+ Self(TaoPhysicalPosition {
|
|
|
x: position.x,
|
|
|
y: position.y,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-struct LogicalPositionWrapper<T>(WryLogicalPosition<T>);
|
|
|
+struct LogicalPositionWrapper<T>(TaoLogicalPosition<T>);
|
|
|
|
|
|
impl<T> From<LogicalPosition<T>> for LogicalPositionWrapper<T> {
|
|
|
fn from(position: LogicalPosition<T>) -> Self {
|
|
|
- Self(WryLogicalPosition {
|
|
|
+ Self(TaoLogicalPosition {
|
|
|
x: position.x,
|
|
|
y: position.y,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct PhysicalSizeWrapper<T>(pub WryPhysicalSize<T>);
|
|
|
+pub struct PhysicalSizeWrapper<T>(pub TaoPhysicalSize<T>);
|
|
|
|
|
|
impl<T> From<PhysicalSizeWrapper<T>> for PhysicalSize<T> {
|
|
|
fn from(size: PhysicalSizeWrapper<T>) -> Self {
|
|
@@ -422,127 +421,127 @@ impl<T> From<PhysicalSizeWrapper<T>> for PhysicalSize<T> {
|
|
|
|
|
|
impl<T> From<PhysicalSize<T>> for PhysicalSizeWrapper<T> {
|
|
|
fn from(size: PhysicalSize<T>) -> Self {
|
|
|
- Self(WryPhysicalSize {
|
|
|
+ Self(TaoPhysicalSize {
|
|
|
width: size.width,
|
|
|
height: size.height,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-struct LogicalSizeWrapper<T>(WryLogicalSize<T>);
|
|
|
+struct LogicalSizeWrapper<T>(TaoLogicalSize<T>);
|
|
|
|
|
|
impl<T> From<LogicalSize<T>> for LogicalSizeWrapper<T> {
|
|
|
fn from(size: LogicalSize<T>) -> Self {
|
|
|
- Self(WryLogicalSize {
|
|
|
+ Self(TaoLogicalSize {
|
|
|
width: size.width,
|
|
|
height: size.height,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct SizeWrapper(pub WrySize);
|
|
|
+pub struct SizeWrapper(pub TaoSize);
|
|
|
|
|
|
impl From<Size> for SizeWrapper {
|
|
|
fn from(size: Size) -> Self {
|
|
|
match size {
|
|
|
- Size::Logical(s) => Self(WrySize::Logical(LogicalSizeWrapper::from(s).0)),
|
|
|
- Size::Physical(s) => Self(WrySize::Physical(PhysicalSizeWrapper::from(s).0)),
|
|
|
+ Size::Logical(s) => Self(TaoSize::Logical(LogicalSizeWrapper::from(s).0)),
|
|
|
+ Size::Physical(s) => Self(TaoSize::Physical(PhysicalSizeWrapper::from(s).0)),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct PositionWrapper(pub WryPosition);
|
|
|
+pub struct PositionWrapper(pub TaoPosition);
|
|
|
|
|
|
impl From<Position> for PositionWrapper {
|
|
|
fn from(position: Position) -> Self {
|
|
|
match position {
|
|
|
- Position::Logical(s) => Self(WryPosition::Logical(LogicalPositionWrapper::from(s).0)),
|
|
|
- Position::Physical(s) => Self(WryPosition::Physical(PhysicalPositionWrapper::from(s).0)),
|
|
|
+ Position::Logical(s) => Self(TaoPosition::Logical(LogicalPositionWrapper::from(s).0)),
|
|
|
+ Position::Physical(s) => Self(TaoPosition::Physical(PhysicalPositionWrapper::from(s).0)),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
-pub struct UserAttentionTypeWrapper(pub WryUserAttentionType);
|
|
|
+pub struct UserAttentionTypeWrapper(pub TaoUserAttentionType);
|
|
|
|
|
|
impl From<UserAttentionType> for UserAttentionTypeWrapper {
|
|
|
fn from(request_type: UserAttentionType) -> Self {
|
|
|
let o = match request_type {
|
|
|
- UserAttentionType::Critical => WryUserAttentionType::Critical,
|
|
|
- UserAttentionType::Informational => WryUserAttentionType::Informational,
|
|
|
+ UserAttentionType::Critical => TaoUserAttentionType::Critical,
|
|
|
+ UserAttentionType::Informational => TaoUserAttentionType::Informational,
|
|
|
};
|
|
|
Self(o)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
-pub struct CursorIconWrapper(pub WryCursorIcon);
|
|
|
+pub struct CursorIconWrapper(pub TaoCursorIcon);
|
|
|
|
|
|
impl From<CursorIcon> for CursorIconWrapper {
|
|
|
fn from(icon: CursorIcon) -> Self {
|
|
|
use CursorIcon::*;
|
|
|
let i = match icon {
|
|
|
- Default => WryCursorIcon::Default,
|
|
|
- Crosshair => WryCursorIcon::Crosshair,
|
|
|
- Hand => WryCursorIcon::Hand,
|
|
|
- Arrow => WryCursorIcon::Arrow,
|
|
|
- Move => WryCursorIcon::Move,
|
|
|
- Text => WryCursorIcon::Text,
|
|
|
- Wait => WryCursorIcon::Wait,
|
|
|
- Help => WryCursorIcon::Help,
|
|
|
- Progress => WryCursorIcon::Progress,
|
|
|
- NotAllowed => WryCursorIcon::NotAllowed,
|
|
|
- ContextMenu => WryCursorIcon::ContextMenu,
|
|
|
- Cell => WryCursorIcon::Cell,
|
|
|
- VerticalText => WryCursorIcon::VerticalText,
|
|
|
- Alias => WryCursorIcon::Alias,
|
|
|
- Copy => WryCursorIcon::Copy,
|
|
|
- NoDrop => WryCursorIcon::NoDrop,
|
|
|
- Grab => WryCursorIcon::Grab,
|
|
|
- Grabbing => WryCursorIcon::Grabbing,
|
|
|
- AllScroll => WryCursorIcon::AllScroll,
|
|
|
- ZoomIn => WryCursorIcon::ZoomIn,
|
|
|
- ZoomOut => WryCursorIcon::ZoomOut,
|
|
|
- EResize => WryCursorIcon::EResize,
|
|
|
- NResize => WryCursorIcon::NResize,
|
|
|
- NeResize => WryCursorIcon::NeResize,
|
|
|
- NwResize => WryCursorIcon::NwResize,
|
|
|
- SResize => WryCursorIcon::SResize,
|
|
|
- SeResize => WryCursorIcon::SeResize,
|
|
|
- SwResize => WryCursorIcon::SwResize,
|
|
|
- WResize => WryCursorIcon::WResize,
|
|
|
- EwResize => WryCursorIcon::EwResize,
|
|
|
- NsResize => WryCursorIcon::NsResize,
|
|
|
- NeswResize => WryCursorIcon::NeswResize,
|
|
|
- NwseResize => WryCursorIcon::NwseResize,
|
|
|
- ColResize => WryCursorIcon::ColResize,
|
|
|
- RowResize => WryCursorIcon::RowResize,
|
|
|
- _ => WryCursorIcon::Default,
|
|
|
+ Default => TaoCursorIcon::Default,
|
|
|
+ Crosshair => TaoCursorIcon::Crosshair,
|
|
|
+ Hand => TaoCursorIcon::Hand,
|
|
|
+ Arrow => TaoCursorIcon::Arrow,
|
|
|
+ Move => TaoCursorIcon::Move,
|
|
|
+ Text => TaoCursorIcon::Text,
|
|
|
+ Wait => TaoCursorIcon::Wait,
|
|
|
+ Help => TaoCursorIcon::Help,
|
|
|
+ Progress => TaoCursorIcon::Progress,
|
|
|
+ NotAllowed => TaoCursorIcon::NotAllowed,
|
|
|
+ ContextMenu => TaoCursorIcon::ContextMenu,
|
|
|
+ Cell => TaoCursorIcon::Cell,
|
|
|
+ VerticalText => TaoCursorIcon::VerticalText,
|
|
|
+ Alias => TaoCursorIcon::Alias,
|
|
|
+ Copy => TaoCursorIcon::Copy,
|
|
|
+ NoDrop => TaoCursorIcon::NoDrop,
|
|
|
+ Grab => TaoCursorIcon::Grab,
|
|
|
+ Grabbing => TaoCursorIcon::Grabbing,
|
|
|
+ AllScroll => TaoCursorIcon::AllScroll,
|
|
|
+ ZoomIn => TaoCursorIcon::ZoomIn,
|
|
|
+ ZoomOut => TaoCursorIcon::ZoomOut,
|
|
|
+ EResize => TaoCursorIcon::EResize,
|
|
|
+ NResize => TaoCursorIcon::NResize,
|
|
|
+ NeResize => TaoCursorIcon::NeResize,
|
|
|
+ NwResize => TaoCursorIcon::NwResize,
|
|
|
+ SResize => TaoCursorIcon::SResize,
|
|
|
+ SeResize => TaoCursorIcon::SeResize,
|
|
|
+ SwResize => TaoCursorIcon::SwResize,
|
|
|
+ WResize => TaoCursorIcon::WResize,
|
|
|
+ EwResize => TaoCursorIcon::EwResize,
|
|
|
+ NsResize => TaoCursorIcon::NsResize,
|
|
|
+ NeswResize => TaoCursorIcon::NeswResize,
|
|
|
+ NwseResize => TaoCursorIcon::NwseResize,
|
|
|
+ ColResize => TaoCursorIcon::ColResize,
|
|
|
+ RowResize => TaoCursorIcon::RowResize,
|
|
|
+ _ => TaoCursorIcon::Default,
|
|
|
};
|
|
|
Self(i)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct ProgressStateWrapper(pub WryProgressState);
|
|
|
+pub struct ProgressStateWrapper(pub TaoProgressState);
|
|
|
|
|
|
impl From<ProgressBarStatus> for ProgressStateWrapper {
|
|
|
fn from(status: ProgressBarStatus) -> Self {
|
|
|
let state = match status {
|
|
|
- ProgressBarStatus::None => WryProgressState::None,
|
|
|
- ProgressBarStatus::Normal => WryProgressState::Normal,
|
|
|
- ProgressBarStatus::Indeterminate => WryProgressState::Indeterminate,
|
|
|
- ProgressBarStatus::Paused => WryProgressState::Paused,
|
|
|
- ProgressBarStatus::Error => WryProgressState::Error,
|
|
|
+ ProgressBarStatus::None => TaoProgressState::None,
|
|
|
+ ProgressBarStatus::Normal => TaoProgressState::Normal,
|
|
|
+ ProgressBarStatus::Indeterminate => TaoProgressState::Indeterminate,
|
|
|
+ ProgressBarStatus::Paused => TaoProgressState::Paused,
|
|
|
+ ProgressBarStatus::Error => TaoProgressState::Error,
|
|
|
};
|
|
|
Self(state)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub struct ProgressBarStateWrapper(pub WryProgressBarState);
|
|
|
+pub struct ProgressBarStateWrapper(pub TaoProgressBarState);
|
|
|
|
|
|
impl From<ProgressBarState> for ProgressBarStateWrapper {
|
|
|
fn from(progress_state: ProgressBarState) -> Self {
|
|
|
- Self(WryProgressBarState {
|
|
|
+ Self(TaoProgressBarState {
|
|
|
progress: progress_state.progress,
|
|
|
state: progress_state
|
|
|
.status
|
|
@@ -554,7 +553,7 @@ impl From<ProgressBarState> for ProgressBarStateWrapper {
|
|
|
|
|
|
#[derive(Clone, Default)]
|
|
|
pub struct WindowBuilderWrapper {
|
|
|
- inner: WryWindowBuilder,
|
|
|
+ inner: TaoWindowBuilder,
|
|
|
center: bool,
|
|
|
#[cfg(target_os = "macos")]
|
|
|
tabbing_identifier: Option<String>,
|
|
@@ -659,28 +658,28 @@ impl WindowBuilder for WindowBuilderWrapper {
|
|
|
}
|
|
|
|
|
|
fn position(mut self, x: f64, y: f64) -> Self {
|
|
|
- self.inner = self.inner.with_position(WryLogicalPosition::new(x, y));
|
|
|
+ self.inner = self.inner.with_position(TaoLogicalPosition::new(x, y));
|
|
|
self
|
|
|
}
|
|
|
|
|
|
fn inner_size(mut self, width: f64, height: f64) -> Self {
|
|
|
self.inner = self
|
|
|
.inner
|
|
|
- .with_inner_size(WryLogicalSize::new(width, height));
|
|
|
+ .with_inner_size(TaoLogicalSize::new(width, height));
|
|
|
self
|
|
|
}
|
|
|
|
|
|
fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self {
|
|
|
self.inner = self
|
|
|
.inner
|
|
|
- .with_min_inner_size(WryLogicalSize::new(min_width, min_height));
|
|
|
+ .with_min_inner_size(TaoLogicalSize::new(min_width, min_height));
|
|
|
self
|
|
|
}
|
|
|
|
|
|
fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self {
|
|
|
self.inner = self
|
|
|
.inner
|
|
|
- .with_max_inner_size(WryLogicalSize::new(max_width, max_height));
|
|
|
+ .with_max_inner_size(TaoLogicalSize::new(max_width, max_height));
|
|
|
self
|
|
|
}
|
|
|
|
|
@@ -834,7 +833,7 @@ impl WindowBuilder for WindowBuilderWrapper {
|
|
|
fn icon(mut self, icon: Icon) -> Result<Self> {
|
|
|
self.inner = self
|
|
|
.inner
|
|
|
- .with_window_icon(Some(WryIcon::try_from(icon)?.0));
|
|
|
+ .with_window_icon(Some(TaoIcon::try_from(icon)?.0));
|
|
|
Ok(self)
|
|
|
}
|
|
|
|
|
@@ -853,8 +852,8 @@ impl WindowBuilder for WindowBuilderWrapper {
|
|
|
fn theme(mut self, theme: Option<Theme>) -> Self {
|
|
|
self.inner = self.inner.with_theme(if let Some(t) = theme {
|
|
|
match t {
|
|
|
- Theme::Dark => Some(WryTheme::Dark),
|
|
|
- _ => Some(WryTheme::Light),
|
|
|
+ Theme::Dark => Some(TaoTheme::Dark),
|
|
|
+ _ => Some(TaoTheme::Light),
|
|
|
}
|
|
|
} else {
|
|
|
None
|
|
@@ -902,11 +901,11 @@ impl From<FileDropEventWrapper> for FileDropEvent {
|
|
|
match event.0 {
|
|
|
WryFileDropEvent::Hovered { paths, position } => FileDropEvent::Hovered {
|
|
|
paths: paths.into_iter().map(decode_path).collect(),
|
|
|
- position: PhysicalPositionWrapper(position).into(),
|
|
|
+ position: PhysicalPosition::new(position.0 as f64, position.1 as f64),
|
|
|
},
|
|
|
WryFileDropEvent::Dropped { paths, position } => FileDropEvent::Dropped {
|
|
|
paths: paths.into_iter().map(decode_path).collect(),
|
|
|
- position: PhysicalPositionWrapper(position).into(),
|
|
|
+ position: PhysicalPosition::new(position.0 as f64, position.1 as f64),
|
|
|
},
|
|
|
// default to cancelled
|
|
|
// FIXME(maybe): Add `FileDropEvent::Unknown` event?
|
|
@@ -1038,7 +1037,7 @@ pub enum WindowMessage {
|
|
|
SetPosition(Position),
|
|
|
SetFullscreen(bool),
|
|
|
SetFocus,
|
|
|
- SetIcon(WryWindowIcon),
|
|
|
+ SetIcon(TaoWindowIcon),
|
|
|
SetSkipTaskbar(bool),
|
|
|
SetCursorGrab(bool),
|
|
|
SetCursorVisible(bool),
|
|
@@ -1077,7 +1076,7 @@ pub enum Message<T: 'static> {
|
|
|
CreateWebview(WebviewId, CreateWebviewClosure<T>),
|
|
|
CreateWindow(
|
|
|
WebviewId,
|
|
|
- Box<dyn FnOnce() -> (String, WryWindowBuilder) + Send>,
|
|
|
+ Box<dyn FnOnce() -> (String, TaoWindowBuilder) + Send>,
|
|
|
Sender<Result<Weak<Window>>>,
|
|
|
),
|
|
|
UserEvent(T),
|
|
@@ -1093,7 +1092,7 @@ impl<T: UserEvent> Clone for Message<T> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/// The Tauri [`Dispatch`] for [`Wry`].
|
|
|
+/// The Tauri [`Dispatch`] for [`Tao`].
|
|
|
#[derive(Debug, Clone)]
|
|
|
pub struct WryDispatcher<T: UserEvent> {
|
|
|
window_id: WebviewId,
|
|
@@ -1504,7 +1503,7 @@ impl<T: UserEvent> Dispatch<T> for WryDispatcher<T> {
|
|
|
&self.context,
|
|
|
Message::Window(
|
|
|
self.window_id,
|
|
|
- WindowMessage::SetIcon(WryIcon::try_from(icon)?.0),
|
|
|
+ WindowMessage::SetIcon(TaoIcon::try_from(icon)?.0),
|
|
|
),
|
|
|
)
|
|
|
}
|
|
@@ -1585,6 +1584,7 @@ impl<T: UserEvent> Dispatch<T> for WryDispatcher<T> {
|
|
|
#[derive(Clone)]
|
|
|
enum WindowHandle {
|
|
|
Webview {
|
|
|
+ window: Arc<Window>,
|
|
|
inner: Rc<WebView>,
|
|
|
context_store: WebContextStore,
|
|
|
// the key of the WebContext if it's not shared
|
|
@@ -1597,6 +1597,7 @@ impl Drop for WindowHandle {
|
|
|
fn drop(&mut self) {
|
|
|
if let Self::Webview {
|
|
|
inner,
|
|
|
+ window: _,
|
|
|
context_store,
|
|
|
context_key,
|
|
|
} = self
|
|
@@ -1620,17 +1621,17 @@ impl Deref for WindowHandle {
|
|
|
#[inline(always)]
|
|
|
fn deref(&self) -> &Window {
|
|
|
match self {
|
|
|
- Self::Webview { inner, .. } => inner.window(),
|
|
|
+ Self::Webview { window, .. } => window,
|
|
|
Self::Window(w) => w,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
impl WindowHandle {
|
|
|
- fn inner_size(&self) -> WryPhysicalSize<u32> {
|
|
|
+ fn inner_size(&self) -> TaoPhysicalSize<u32> {
|
|
|
match self {
|
|
|
WindowHandle::Window(w) => w.inner_size(),
|
|
|
- WindowHandle::Webview { inner, .. } => inner.inner_size(),
|
|
|
+ WindowHandle::Webview { window, .. } => window.inner_size(),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1651,7 +1652,7 @@ impl fmt::Debug for WindowWrapper {
|
|
|
}
|
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
-pub struct EventProxy<T: UserEvent>(WryEventLoopProxy<Message<T>>);
|
|
|
+pub struct EventProxy<T: UserEvent>(TaoEventLoopProxy<Message<T>>);
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
#[allow(clippy::non_send_fields_in_send_ty)]
|
|
@@ -1676,7 +1677,7 @@ pub trait Plugin<T: UserEvent> {
|
|
|
&mut self,
|
|
|
event: &Event<Message<T>>,
|
|
|
event_loop: &EventLoopWindowTarget<Message<T>>,
|
|
|
- proxy: &WryEventLoopProxy<Message<T>>,
|
|
|
+ proxy: &TaoEventLoopProxy<Message<T>>,
|
|
|
control_flow: &mut ControlFlow,
|
|
|
context: EventLoopIterationContext<'_, T>,
|
|
|
web_context: &WebContextStore,
|
|
@@ -1712,7 +1713,7 @@ unsafe impl<T: UserEvent> Sync for WryHandle<T> {}
|
|
|
|
|
|
impl<T: UserEvent> WryHandle<T> {
|
|
|
/// Creates a new tao window using a callback, and returns its window id.
|
|
|
- pub fn create_tao_window<F: FnOnce() -> (String, WryWindowBuilder) + Send + 'static>(
|
|
|
+ pub fn create_tao_window<F: FnOnce() -> (String, TaoWindowBuilder) + Send + 'static>(
|
|
|
&self,
|
|
|
f: F,
|
|
|
) -> Result<Weak<Window>> {
|
|
@@ -1845,7 +1846,7 @@ impl<T: UserEvent> Wry<T> {
|
|
|
) -> Result<Self> {
|
|
|
#[cfg(windows)]
|
|
|
if let Some(hook) = args.msg_hook {
|
|
|
- use wry::application::platform::windows::EventLoopBuilderExtWindows;
|
|
|
+ use tao::platform::windows::EventLoopBuilderExtWindows;
|
|
|
event_loop_builder.with_msg_hook(hook);
|
|
|
}
|
|
|
Self::init(event_loop_builder.build())
|
|
@@ -1897,7 +1898,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
target_os = "openbsd"
|
|
|
))]
|
|
|
fn new_any_thread(args: RuntimeInitArgs) -> Result<Self> {
|
|
|
- use wry::application::platform::unix::EventLoopBuilderExtUnix;
|
|
|
+ use tao::platform::unix::EventLoopBuilderExtUnix;
|
|
|
let mut event_loop_builder = EventLoopBuilder::<Message<T>>::with_user_event();
|
|
|
event_loop_builder.with_any_thread(true);
|
|
|
Self::init_with_builder(event_loop_builder, args)
|
|
@@ -1905,7 +1906,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
|
|
|
#[cfg(windows)]
|
|
|
fn new_any_thread(args: RuntimeInitArgs) -> Result<Self> {
|
|
|
- use wry::application::platform::windows::EventLoopBuilderExtWindows;
|
|
|
+ use tao::platform::windows::EventLoopBuilderExtWindows;
|
|
|
let mut event_loop_builder = EventLoopBuilder::<Message<T>>::with_user_event();
|
|
|
event_loop_builder.with_any_thread(true);
|
|
|
Self::init_with_builder(event_loop_builder, args)
|
|
@@ -1977,9 +1978,9 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
self
|
|
|
.event_loop
|
|
|
.set_activation_policy(match activation_policy {
|
|
|
- ActivationPolicy::Regular => WryActivationPolicy::Regular,
|
|
|
- ActivationPolicy::Accessory => WryActivationPolicy::Accessory,
|
|
|
- ActivationPolicy::Prohibited => WryActivationPolicy::Prohibited,
|
|
|
+ ActivationPolicy::Regular => TaoActivationPolicy::Regular,
|
|
|
+ ActivationPolicy::Accessory => TaoActivationPolicy::Accessory,
|
|
|
+ ActivationPolicy::Prohibited => TaoActivationPolicy::Prohibited,
|
|
|
_ => unimplemented!(),
|
|
|
});
|
|
|
}
|
|
@@ -2002,7 +2003,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
|
|
|
#[cfg(desktop)]
|
|
|
fn run_iteration<F: FnMut(RunEvent<T>) + 'static>(&mut self, mut callback: F) -> RunIteration {
|
|
|
- use wry::application::platform::run_return::EventLoopExtRunReturn;
|
|
|
+ use tao::platform::run_return::EventLoopExtRunReturn;
|
|
|
let windows = self.context.main_thread.windows.clone();
|
|
|
let webview_id_map = self.context.webview_id_map.clone();
|
|
|
let web_context = &self.context.main_thread.web_context;
|
|
@@ -2144,12 +2145,12 @@ fn handle_user_message<T: UserEvent>(
|
|
|
target_os = "openbsd"
|
|
|
))]
|
|
|
{
|
|
|
- use wry::webview::WebviewExtUnix;
|
|
|
+ use wry::WebViewExtUnix;
|
|
|
f(w.webview());
|
|
|
}
|
|
|
#[cfg(target_os = "macos")]
|
|
|
{
|
|
|
- use wry::webview::WebviewExtMacOS;
|
|
|
+ use wry::WebViewExtMacOS;
|
|
|
f(Webview {
|
|
|
webview: w.webview(),
|
|
|
manager: w.manager(),
|
|
@@ -2158,12 +2159,13 @@ fn handle_user_message<T: UserEvent>(
|
|
|
}
|
|
|
#[cfg(target_os = "ios")]
|
|
|
{
|
|
|
- use wry::{application::platform::ios::WindowExtIOS, webview::WebviewExtIOS};
|
|
|
+ use tao::platform::ios::WindowExtIOS;
|
|
|
+ use wry::WebViewExtIOS;
|
|
|
|
|
|
f(Webview {
|
|
|
webview: w.webview(),
|
|
|
manager: w.manager(),
|
|
|
- view_controller: w.window().ui_view_controller() as cocoa::base::id,
|
|
|
+ view_controller: window.ui_view_controller() as cocoa::base::id,
|
|
|
});
|
|
|
}
|
|
|
#[cfg(windows)]
|
|
@@ -2508,22 +2510,22 @@ fn handle_event_loop<T: UserEvent>(
|
|
|
|
|
|
match event {
|
|
|
#[cfg(windows)]
|
|
|
- WryWindowEvent::ThemeChanged(theme) => {
|
|
|
+ TaoWindowEvent::ThemeChanged(theme) => {
|
|
|
if let Some(window) = windows.borrow().get(&window_id) {
|
|
|
if let Some(WindowHandle::Webview { inner, .. }) = &window.inner {
|
|
|
let theme = match theme {
|
|
|
- WryTheme::Dark => wry::webview::Theme::Dark,
|
|
|
- WryTheme::Light => wry::webview::Theme::Light,
|
|
|
- _ => wry::webview::Theme::Light,
|
|
|
+ TaoTheme::Dark => wry::Theme::Dark,
|
|
|
+ TaoTheme::Light => wry::Theme::Light,
|
|
|
+ _ => wry::Theme::Light,
|
|
|
};
|
|
|
inner.set_theme(theme);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- WryWindowEvent::CloseRequested => {
|
|
|
+ TaoWindowEvent::CloseRequested => {
|
|
|
on_close_requested(callback, window_id, windows.clone());
|
|
|
}
|
|
|
- WryWindowEvent::Destroyed => {
|
|
|
+ TaoWindowEvent::Destroyed => {
|
|
|
let removed = windows.borrow_mut().remove(&window_id).is_some();
|
|
|
if removed {
|
|
|
let is_empty = windows.borrow().is_empty();
|
|
@@ -2611,13 +2613,13 @@ fn on_window_close(window_id: WebviewId, windows: Rc<RefCell<HashMap<WebviewId,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-pub fn center_window(window: &Window, window_size: WryPhysicalSize<u32>) -> Result<()> {
|
|
|
+pub fn center_window(window: &Window, window_size: TaoPhysicalSize<u32>) -> Result<()> {
|
|
|
if let Some(monitor) = window.current_monitor() {
|
|
|
let screen_size = monitor.size();
|
|
|
let monitor_pos = monitor.position();
|
|
|
let x = (screen_size.width as i32 - window_size.width as i32) / 2;
|
|
|
let y = (screen_size.height as i32 - window_size.height as i32) / 2;
|
|
|
- window.set_outer_position(WryPhysicalPosition::new(
|
|
|
+ window.set_outer_position(TaoPhysicalPosition::new(
|
|
|
monitor_pos.x + x,
|
|
|
monitor_pos.y + y,
|
|
|
));
|
|
@@ -2707,8 +2709,26 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
handler(raw);
|
|
|
}
|
|
|
|
|
|
- let mut webview_builder = WebViewBuilder::new(window)
|
|
|
- .map_err(|e| Error::CreateWebview(Box::new(e)))?
|
|
|
+ #[cfg(any(
|
|
|
+ target_os = "windows",
|
|
|
+ target_os = "macos",
|
|
|
+ target_os = "ios",
|
|
|
+ target_os = "android"
|
|
|
+ ))]
|
|
|
+ let builder = WebViewBuilder::new(&window);
|
|
|
+ #[cfg(not(any(
|
|
|
+ target_os = "windows",
|
|
|
+ target_os = "macos",
|
|
|
+ target_os = "ios",
|
|
|
+ target_os = "android"
|
|
|
+ )))]
|
|
|
+ let builder = {
|
|
|
+ use wry::WebViewBuilderExtUnix;
|
|
|
+ let vbox = window.default_vbox().unwrap();
|
|
|
+ WebViewBuilder::new_gtk(vbox)
|
|
|
+ };
|
|
|
+
|
|
|
+ let mut webview_builder = builder
|
|
|
.with_focused(focused)
|
|
|
.with_url(&url)
|
|
|
.unwrap() // safe to unwrap because we validate the URL beforehand
|
|
@@ -2732,8 +2752,8 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
page_load_handler(
|
|
|
url,
|
|
|
match event {
|
|
|
- wry::webview::PageLoadEvent::Started => tauri_runtime::window::PageLoadEvent::Started,
|
|
|
- wry::webview::PageLoadEvent::Finished => tauri_runtime::window::PageLoadEvent::Finished,
|
|
|
+ wry::PageLoadEvent::Started => tauri_runtime::window::PageLoadEvent::Started,
|
|
|
+ wry::PageLoadEvent::Finished => tauri_runtime::window::PageLoadEvent::Finished,
|
|
|
},
|
|
|
)
|
|
|
});
|
|
@@ -2752,9 +2772,9 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
|
|
|
if let Some(theme) = window_theme {
|
|
|
webview_builder = webview_builder.with_theme(match theme {
|
|
|
- WryTheme::Dark => wry::webview::Theme::Dark,
|
|
|
- WryTheme::Light => wry::webview::Theme::Light,
|
|
|
- _ => wry::webview::Theme::Light,
|
|
|
+ TaoTheme::Dark => wry::Theme::Dark,
|
|
|
+ TaoTheme::Light => wry::Theme::Light,
|
|
|
+ _ => wry::Theme::Light,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -2765,8 +2785,12 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
}
|
|
|
|
|
|
if let Some(handler) = ipc_handler {
|
|
|
- webview_builder =
|
|
|
- webview_builder.with_ipc_handler(create_ipc_handler(context.clone(), label.clone(), handler));
|
|
|
+ webview_builder = webview_builder.with_ipc_handler(create_ipc_handler(
|
|
|
+ window_id,
|
|
|
+ context.clone(),
|
|
|
+ label.clone(),
|
|
|
+ handler,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
for (scheme, protocol) in uri_scheme_protocols {
|
|
@@ -2810,11 +2834,11 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
};
|
|
|
|
|
|
if webview_attributes.clipboard {
|
|
|
- webview_builder.webview.clipboard = true;
|
|
|
+ webview_builder.attrs.clipboard = true;
|
|
|
}
|
|
|
|
|
|
if webview_attributes.incognito {
|
|
|
- webview_builder.webview.incognito = true;
|
|
|
+ webview_builder.attrs.incognito = true;
|
|
|
}
|
|
|
|
|
|
#[cfg(any(debug_assertions, feature = "devtools"))]
|
|
@@ -2876,6 +2900,7 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
Ok(WindowWrapper {
|
|
|
label,
|
|
|
inner: Some(WindowHandle::Webview {
|
|
|
+ window: Arc::new(window),
|
|
|
inner: Rc::new(webview),
|
|
|
context_store: web_context_store.clone(),
|
|
|
context_key: if automation_enabled {
|
|
@@ -2890,12 +2915,12 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
|
|
|
|
|
|
/// Create a wry ipc handler from a tauri ipc handler.
|
|
|
fn create_ipc_handler<T: UserEvent>(
|
|
|
+ window_id: u32,
|
|
|
context: Context<T>,
|
|
|
label: String,
|
|
|
handler: WebviewIpcHandler<T, Wry<T>>,
|
|
|
) -> Box<IpcHandler> {
|
|
|
- Box::new(move |window, request| {
|
|
|
- let window_id = context.webview_id_map.get(&window.id()).unwrap();
|
|
|
+ Box::new(move |request| {
|
|
|
handler(
|
|
|
DetachedWindow {
|
|
|
dispatcher: WryDispatcher {
|
|
@@ -2911,7 +2936,7 @@ fn create_ipc_handler<T: UserEvent>(
|
|
|
|
|
|
/// Create a wry file drop handler.
|
|
|
fn create_file_drop_handler(window_event_listeners: WindowEventListeners) -> Box<FileDropHandler> {
|
|
|
- Box::new(move |_window, event| {
|
|
|
+ Box::new(move |event| {
|
|
|
let event: FileDropEvent = FileDropEventWrapper(event).into();
|
|
|
let window_event = WindowEvent::FileDrop(event);
|
|
|
let listeners_map = window_event_listeners.lock().unwrap();
|