|
@@ -175,8 +175,6 @@ pub(crate) fn send_user_message<T: UserEvent>(
|
|
|
webview_id_map: context.webview_id_map.clone(),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager: context.main_thread.global_shortcut_manager.clone(),
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: context.main_thread.clipboard_manager.clone(),
|
|
|
windows: context.main_thread.windows.clone(),
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: context.main_thread.system_tray_manager.clone(),
|
|
@@ -276,8 +274,6 @@ pub struct DispatcherMainThreadContext<T: UserEvent> {
|
|
|
pub web_context: WebContextStore,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
pub global_shortcut_manager: Rc<Mutex<WryShortcutManager>>,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- pub clipboard_manager: Arc<Mutex<Clipboard>>,
|
|
|
pub windows: Rc<RefCell<HashMap<WebviewId, WindowWrapper>>>,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: SystemTrayManager,
|
|
@@ -1213,8 +1209,6 @@ pub enum Message<T: 'static> {
|
|
|
),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
GlobalShortcut(GlobalShortcutMessage),
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- Clipboard(ClipboardMessage),
|
|
|
UserEvent(T),
|
|
|
}
|
|
|
|
|
@@ -1226,8 +1220,6 @@ impl<T: UserEvent> Clone for Message<T> {
|
|
|
Self::Tray(i, m) => Self::Tray(*i, m.clone()),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
Self::GlobalShortcut(m) => Self::GlobalShortcut(m.clone()),
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- Self::Clipboard(m) => Self::Clipboard(m.clone()),
|
|
|
Self::UserEvent(t) => Self::UserEvent(t.clone()),
|
|
|
_ => unimplemented!(),
|
|
|
}
|
|
@@ -1829,7 +1821,7 @@ pub struct Wry<T: UserEvent> {
|
|
|
global_shortcut_manager_handle: GlobalShortcutManagerHandle<T>,
|
|
|
|
|
|
#[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager_handle: ClipboardManagerWrapper<T>,
|
|
|
+ clipboard_manager_handle: ClipboardManagerWrapper,
|
|
|
|
|
|
event_loop: EventLoop<Message<T>>,
|
|
|
}
|
|
@@ -1860,11 +1852,7 @@ impl<T: UserEvent> fmt::Debug for Wry<T> {
|
|
|
);
|
|
|
|
|
|
#[cfg(feature = "clipboard")]
|
|
|
- d.field(
|
|
|
- "clipboard_manager",
|
|
|
- &self.context.main_thread.clipboard_manager,
|
|
|
- )
|
|
|
- .field("clipboard_manager_handle", &self.clipboard_manager_handle);
|
|
|
+ d.field("clipboard_manager_handle", &self.clipboard_manager_handle);
|
|
|
|
|
|
d.finish()
|
|
|
}
|
|
@@ -1985,9 +1973,6 @@ impl<T: UserEvent> Wry<T> {
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
let global_shortcut_manager = Rc::new(Mutex::new(WryShortcutManager::new(&event_loop)));
|
|
|
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- let clipboard_manager = Arc::new(Mutex::new(Clipboard::new()));
|
|
|
-
|
|
|
let windows = Rc::new(RefCell::new(HashMap::default()));
|
|
|
let webview_id_map = WebviewIdStore::default();
|
|
|
|
|
@@ -2003,8 +1988,6 @@ impl<T: UserEvent> Wry<T> {
|
|
|
web_context,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager,
|
|
|
windows,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager,
|
|
@@ -2023,7 +2006,7 @@ impl<T: UserEvent> Wry<T> {
|
|
|
#[cfg(feature = "clipboard")]
|
|
|
#[allow(clippy::redundant_clone)]
|
|
|
let clipboard_manager_handle = ClipboardManagerWrapper {
|
|
|
- context: context.clone(),
|
|
|
+ clipboard: Arc::new(Mutex::new(Clipboard::new().unwrap())),
|
|
|
};
|
|
|
|
|
|
Ok(Self {
|
|
@@ -2056,7 +2039,7 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
type GlobalShortcutManager = GlobalShortcutManagerHandle<T>;
|
|
|
|
|
|
#[cfg(feature = "clipboard")]
|
|
|
- type ClipboardManager = ClipboardManagerWrapper<T>;
|
|
|
+ type ClipboardManager = ClipboardManagerWrapper;
|
|
|
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
type TrayHandler = SystemTrayHandle<T>;
|
|
@@ -2221,8 +2204,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
let global_shortcut_manager_handle = self.global_shortcut_manager_handle.clone();
|
|
|
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- let clipboard_manager = self.context.main_thread.clipboard_manager.clone();
|
|
|
let mut iteration = RunIteration::default();
|
|
|
|
|
|
let proxy = self.event_loop.create_proxy();
|
|
@@ -2249,8 +2230,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
global_shortcut_manager: global_shortcut_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager_handle: &global_shortcut_manager_handle,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: clipboard_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: system_tray_manager.clone(),
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2275,8 +2254,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
global_shortcut_manager: global_shortcut_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager_handle: &global_shortcut_manager_handle,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: clipboard_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: system_tray_manager.clone(),
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2306,9 +2283,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
let global_shortcut_manager_handle = self.global_shortcut_manager_handle.clone();
|
|
|
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- let clipboard_manager = self.context.main_thread.clipboard_manager.clone();
|
|
|
-
|
|
|
let proxy = self.event_loop.create_proxy();
|
|
|
|
|
|
self.event_loop.run(move |event, event_loop, control_flow| {
|
|
@@ -2326,8 +2300,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
global_shortcut_manager: global_shortcut_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager_handle: &global_shortcut_manager_handle,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: clipboard_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: system_tray_manager.clone(),
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2351,8 +2323,6 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
|
|
|
global_shortcut_manager: global_shortcut_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager_handle: &global_shortcut_manager_handle,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: clipboard_manager.clone(),
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: system_tray_manager.clone(),
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2372,8 +2342,6 @@ pub struct EventLoopIterationContext<'a, T: UserEvent> {
|
|
|
pub global_shortcut_manager: Rc<Mutex<WryShortcutManager>>,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
pub global_shortcut_manager_handle: &'a GlobalShortcutManagerHandle<T>,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- pub clipboard_manager: Arc<Mutex<Clipboard>>,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
pub system_tray_manager: SystemTrayManager,
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -2385,8 +2353,6 @@ struct UserMessageContext {
|
|
|
webview_id_map: WebviewIdStore,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager: Rc<Mutex<WryShortcutManager>>,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager: Arc<Mutex<Clipboard>>,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager: SystemTrayManager,
|
|
|
}
|
|
@@ -2401,8 +2367,6 @@ fn handle_user_message<T: UserEvent>(
|
|
|
webview_id_map,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager,
|
|
|
windows,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager,
|
|
@@ -2805,8 +2769,6 @@ fn handle_user_message<T: UserEvent>(
|
|
|
Message::GlobalShortcut(message) => {
|
|
|
handle_global_shortcut_message(message, &global_shortcut_manager)
|
|
|
}
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- Message::Clipboard(message) => handle_clipboard_message(message, &clipboard_manager),
|
|
|
Message::UserEvent(_) => (),
|
|
|
}
|
|
|
|
|
@@ -2831,8 +2793,6 @@ fn handle_event_loop<T: UserEvent>(
|
|
|
global_shortcut_manager,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager_handle,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager,
|
|
|
#[cfg(feature = "tracing")]
|
|
@@ -3079,8 +3039,6 @@ fn handle_event_loop<T: UserEvent>(
|
|
|
webview_id_map,
|
|
|
#[cfg(all(desktop, feature = "global-shortcut"))]
|
|
|
global_shortcut_manager,
|
|
|
- #[cfg(feature = "clipboard")]
|
|
|
- clipboard_manager,
|
|
|
windows,
|
|
|
#[cfg(all(desktop, feature = "system-tray"))]
|
|
|
system_tray_manager,
|