mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-17 03:40:23 +03:00
chore(deps): update wry to 0.36 (#8795)
* chore(deps): update wry to 0.36 * rwh 0.6 * remove raw_window_handle usage * fix build * fix windows test
This commit is contained in:
parent
dd7571a780
commit
2f55bfecbf
7
.changes/rwh-06.md
Normal file
7
.changes/rwh-06.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch:breaking
|
||||||
|
"tauri-runtime": patch:breaking
|
||||||
|
"tauri-runtime-wry": patch:breaking
|
||||||
|
---
|
||||||
|
|
||||||
|
Update raw-window-handle to 0.6.
|
5
.changes/wry-0.36.md
Normal file
5
.changes/wry-0.36.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri-runtime-wry": patch:deps
|
||||||
|
---
|
||||||
|
|
||||||
|
Update `wry` to 0.36.
|
@ -13,11 +13,11 @@ edition = { workspace = true }
|
|||||||
rust-version = { workspace = true }
|
rust-version = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wry = { version = "0.35.2", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
|
wry = { version = "0.36", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
|
||||||
tao = { version = "0.25", default-features = false, features = [ "rwh_05", "rwh_06" ] }
|
tao = { version = "0.25", default-features = false, features = [ "rwh_06" ] }
|
||||||
tauri-runtime = { version = "2.0.0-beta.1", path = "../tauri-runtime" }
|
tauri-runtime = { version = "2.0.0-beta.1", path = "../tauri-runtime" }
|
||||||
tauri-utils = { version = "2.0.0-beta.1", path = "../tauri-utils" }
|
tauri-utils = { version = "2.0.0-beta.1", path = "../tauri-utils" }
|
||||||
raw-window-handle = "0.5"
|
raw-window-handle = "0.6"
|
||||||
http = "0.2"
|
http = "0.2"
|
||||||
tracing = { version = "0.1", optional = true }
|
tracing = { version = "0.1", optional = true }
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle, RawDisplayHandle};
|
use raw_window_handle::{DisplayHandle, HasDisplayHandle, HasWindowHandle};
|
||||||
use tauri_runtime::{
|
use tauri_runtime::{
|
||||||
monitor::Monitor,
|
monitor::Monitor,
|
||||||
webview::{DetachedWebview, DownloadEvent, PendingWebview, WebviewIpcHandler},
|
webview::{DetachedWebview, DownloadEvent, PendingWebview, WebviewIpcHandler},
|
||||||
@ -1077,8 +1077,8 @@ pub struct GtkBox(pub gtk::Box);
|
|||||||
#[allow(clippy::non_send_fields_in_send_ty)]
|
#[allow(clippy::non_send_fields_in_send_ty)]
|
||||||
unsafe impl Send for GtkBox {}
|
unsafe impl Send for GtkBox {}
|
||||||
|
|
||||||
pub struct RawWindowHandle(pub raw_window_handle::RawWindowHandle);
|
pub struct SendRawWindowHandle(pub raw_window_handle::RawWindowHandle);
|
||||||
unsafe impl Send for RawWindowHandle {}
|
unsafe impl Send for SendRawWindowHandle {}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@ -1125,7 +1125,7 @@ pub enum WindowMessage {
|
|||||||
target_os = "openbsd"
|
target_os = "openbsd"
|
||||||
))]
|
))]
|
||||||
GtkBox(Sender<GtkBox>),
|
GtkBox(Sender<GtkBox>),
|
||||||
RawWindowHandle(Sender<RawWindowHandle>),
|
RawWindowHandle(Sender<std::result::Result<SendRawWindowHandle, raw_window_handle::HandleError>>),
|
||||||
Theme(Sender<Theme>),
|
Theme(Sender<Theme>),
|
||||||
// Setters
|
// Setters
|
||||||
Center,
|
Center,
|
||||||
@ -1400,6 +1400,12 @@ pub struct WryWindowDispatcher<T: UserEvent> {
|
|||||||
#[allow(clippy::non_send_fields_in_send_ty)]
|
#[allow(clippy::non_send_fields_in_send_ty)]
|
||||||
unsafe impl<T: UserEvent> Sync for WryWindowDispatcher<T> {}
|
unsafe impl<T: UserEvent> Sync for WryWindowDispatcher<T> {}
|
||||||
|
|
||||||
|
fn get_raw_window_handle<T: UserEvent>(
|
||||||
|
dispatcher: &WryWindowDispatcher<T>,
|
||||||
|
) -> Result<std::result::Result<SendRawWindowHandle, raw_window_handle::HandleError>> {
|
||||||
|
window_getter!(dispatcher, WindowMessage::RawWindowHandle)
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: UserEvent> WindowDispatch<T> for WryWindowDispatcher<T> {
|
impl<T: UserEvent> WindowDispatch<T> for WryWindowDispatcher<T> {
|
||||||
type Runtime = Wry<T>;
|
type Runtime = Wry<T>;
|
||||||
type WindowBuilder = WindowBuilderWrapper;
|
type WindowBuilder = WindowBuilderWrapper;
|
||||||
@ -1531,8 +1537,12 @@ impl<T: UserEvent> WindowDispatch<T> for WryWindowDispatcher<T> {
|
|||||||
window_getter!(self, WindowMessage::GtkBox).map(|w| w.0)
|
window_getter!(self, WindowMessage::GtkBox).map(|w| w.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn raw_window_handle(&self) -> Result<raw_window_handle::RawWindowHandle> {
|
fn window_handle(
|
||||||
window_getter!(self, WindowMessage::RawWindowHandle).map(|w| w.0)
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||||
|
get_raw_window_handle(self)
|
||||||
|
.map_err(|_| raw_window_handle::HandleError::Unavailable)
|
||||||
|
.and_then(|r| r.map(|h| unsafe { raw_window_handle::WindowHandle::borrow_raw(h.0) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
@ -2046,8 +2056,8 @@ impl<T: UserEvent> RuntimeHandle<T> for WryHandle<T> {
|
|||||||
send_user_message(&self.context, Message::Task(Box::new(f)))
|
send_user_message(&self.context, Message::Task(Box::new(f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
fn display_handle(&self) -> std::result::Result<DisplayHandle, raw_window_handle::HandleError> {
|
||||||
self.context.main_thread.window_target.raw_display_handle()
|
self.context.main_thread.window_target.display_handle()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn primary_monitor(&self) -> Option<Monitor> {
|
fn primary_monitor(&self) -> Option<Monitor> {
|
||||||
@ -2547,7 +2557,11 @@ fn handle_user_message<T: UserEvent>(
|
|||||||
.send(GtkBox(window.default_vbox().unwrap().clone()))
|
.send(GtkBox(window.default_vbox().unwrap().clone()))
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
WindowMessage::RawWindowHandle(tx) => tx
|
WindowMessage::RawWindowHandle(tx) => tx
|
||||||
.send(RawWindowHandle(window.raw_window_handle()))
|
.send(
|
||||||
|
window
|
||||||
|
.window_handle()
|
||||||
|
.map(|h| SendRawWindowHandle(h.as_raw())),
|
||||||
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
WindowMessage::Theme(tx) => {
|
WindowMessage::Theme(tx) => {
|
||||||
tx.send(map_theme(&window.theme())).unwrap();
|
tx.send(map_theme(&window.theme())).unwrap();
|
||||||
|
@ -31,7 +31,7 @@ serde_json = "1.0"
|
|||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tauri-utils = { version = "2.0.0-beta.1", path = "../tauri-utils" }
|
tauri-utils = { version = "2.0.0-beta.1", path = "../tauri-utils" }
|
||||||
http = "0.2.4"
|
http = "0.2.4"
|
||||||
raw-window-handle = "0.5"
|
raw-window-handle = "0.6"
|
||||||
url = { version = "2" }
|
url = { version = "2" }
|
||||||
|
|
||||||
[target."cfg(windows)".dependencies.windows]
|
[target."cfg(windows)".dependencies.windows]
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
)]
|
)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
use raw_window_handle::RawDisplayHandle;
|
use raw_window_handle::DisplayHandle;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::{fmt::Debug, sync::mpsc::Sender};
|
use std::{fmt::Debug, sync::mpsc::Sender};
|
||||||
use tauri_utils::{ProgressBarState, Theme};
|
use tauri_utils::{ProgressBarState, Theme};
|
||||||
@ -233,7 +233,7 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
|
|||||||
/// Run a task on the main thread.
|
/// Run a task on the main thread.
|
||||||
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>;
|
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>;
|
||||||
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle;
|
fn display_handle(&self) -> std::result::Result<DisplayHandle, raw_window_handle::HandleError>;
|
||||||
|
|
||||||
fn primary_monitor(&self) -> Option<Monitor>;
|
fn primary_monitor(&self) -> Option<Monitor>;
|
||||||
fn available_monitors(&self) -> Vec<Monitor>;
|
fn available_monitors(&self) -> Vec<Monitor>;
|
||||||
@ -525,7 +525,9 @@ pub trait WindowDispatch<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 's
|
|||||||
fn default_vbox(&self) -> Result<gtk::Box>;
|
fn default_vbox(&self) -> Result<gtk::Box>;
|
||||||
|
|
||||||
/// Raw window handle.
|
/// Raw window handle.
|
||||||
fn raw_window_handle(&self) -> Result<raw_window_handle::RawWindowHandle>;
|
fn window_handle(
|
||||||
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError>;
|
||||||
|
|
||||||
/// Returns the current window theme.
|
/// Returns the current window theme.
|
||||||
fn theme(&self) -> Result<Theme>;
|
fn theme(&self) -> Result<Theme>;
|
||||||
|
@ -62,7 +62,7 @@ dirs-next = "2.0"
|
|||||||
percent-encoding = "2.3"
|
percent-encoding = "2.3"
|
||||||
reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] }
|
reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] }
|
||||||
bytes = { version = "1", features = [ "serde" ] }
|
bytes = { version = "1", features = [ "serde" ] }
|
||||||
raw-window-handle = "0.5"
|
raw-window-handle = "0.6"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
data-url = { version = "0.3", optional = true }
|
data-url = { version = "0.3", optional = true }
|
||||||
@ -86,11 +86,11 @@ webkit2gtk = { version = "=2.0.1", features = [ "v2_38" ] }
|
|||||||
embed_plist = "1.2"
|
embed_plist = "1.2"
|
||||||
cocoa = "0.25"
|
cocoa = "0.25"
|
||||||
objc = "0.2"
|
objc = "0.2"
|
||||||
window-vibrancy = "0.4"
|
window-vibrancy = "0.5"
|
||||||
|
|
||||||
[target."cfg(windows)".dependencies]
|
[target."cfg(windows)".dependencies]
|
||||||
webview2-com = "0.28"
|
webview2-com = "0.28"
|
||||||
window-vibrancy = "0.4"
|
window-vibrancy = "0.5"
|
||||||
|
|
||||||
[target."cfg(windows)".dependencies.windows]
|
[target."cfg(windows)".dependencies.windows]
|
||||||
version = "0.52"
|
version = "0.52"
|
||||||
|
@ -28,7 +28,7 @@ use crate::{
|
|||||||
use crate::menu::{Menu, MenuEvent};
|
use crate::menu::{Menu, MenuEvent};
|
||||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||||
use crate::tray::{TrayIcon, TrayIconBuilder, TrayIconEvent, TrayIconId};
|
use crate::tray::{TrayIcon, TrayIconBuilder, TrayIconEvent, TrayIconId};
|
||||||
use raw_window_handle::HasRawDisplayHandle;
|
use raw_window_handle::HasDisplayHandle;
|
||||||
use serialize_to_javascript::{default_template, DefaultTemplate, Template};
|
use serialize_to_javascript::{default_template, DefaultTemplate, Template};
|
||||||
use tauri_macros::default_runtime;
|
use tauri_macros::default_runtime;
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
@ -1730,15 +1730,19 @@ fn init_app_menu<R: Runtime>(menu: &Menu<R>) -> crate::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<R: Runtime> HasRawDisplayHandle for AppHandle<R> {
|
impl<R: Runtime> HasDisplayHandle for AppHandle<R> {
|
||||||
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
|
fn display_handle(
|
||||||
self.runtime_handle.raw_display_handle()
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||||
|
self.runtime_handle.display_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<R: Runtime> HasRawDisplayHandle for App<R> {
|
impl<R: Runtime> HasDisplayHandle for App<R> {
|
||||||
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
|
fn display_handle(
|
||||||
self.handle.raw_display_handle()
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||||
|
self.handle.display_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +148,10 @@ pub enum Error {
|
|||||||
/// Failed to deserialize scope object.
|
/// Failed to deserialize scope object.
|
||||||
#[error("error deserializing scope: {0}")]
|
#[error("error deserializing scope: {0}")]
|
||||||
CannotDeserializeScope(Box<dyn std::error::Error + Send + Sync>),
|
CannotDeserializeScope(Box<dyn std::error::Error + Send + Sync>),
|
||||||
|
|
||||||
|
/// Failed to get a raw handle.
|
||||||
|
#[error(transparent)]
|
||||||
|
RawHandleError(#[from] raw_window_handle::HandleError),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `Result<T, ::tauri::Error>`
|
/// `Result<T, ::tauri::Error>`
|
||||||
|
@ -203,17 +203,27 @@ impl<T: UserEvent> RuntimeHandle<T> for MockRuntimeHandle {
|
|||||||
self.context.send_message(Message::Task(Box::new(f)))
|
self.context.send_message(Message::Task(Box::new(f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
|
fn display_handle(
|
||||||
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
return raw_window_handle::RawDisplayHandle::Xlib(raw_window_handle::XlibDisplayHandle::empty());
|
return Ok(unsafe {
|
||||||
|
raw_window_handle::DisplayHandle::borrow_raw(raw_window_handle::RawDisplayHandle::Xlib(
|
||||||
|
raw_window_handle::XlibDisplayHandle::new(None, 0),
|
||||||
|
))
|
||||||
|
});
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
return raw_window_handle::RawDisplayHandle::AppKit(
|
return Ok(unsafe {
|
||||||
raw_window_handle::AppKitDisplayHandle::empty(),
|
raw_window_handle::DisplayHandle::borrow_raw(raw_window_handle::RawDisplayHandle::AppKit(
|
||||||
);
|
raw_window_handle::AppKitDisplayHandle::new(),
|
||||||
|
))
|
||||||
|
});
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
return raw_window_handle::RawDisplayHandle::Windows(
|
return Ok(unsafe {
|
||||||
raw_window_handle::WindowsDisplayHandle::empty(),
|
raw_window_handle::DisplayHandle::borrow_raw(raw_window_handle::RawDisplayHandle::Windows(
|
||||||
);
|
raw_window_handle::WindowsDisplayHandle::new(),
|
||||||
|
))
|
||||||
|
});
|
||||||
#[cfg(not(any(target_os = "linux", target_os = "macos", windows)))]
|
#[cfg(not(any(target_os = "linux", target_os = "macos", windows)))]
|
||||||
return unimplemented!();
|
return unimplemented!();
|
||||||
}
|
}
|
||||||
@ -641,19 +651,31 @@ impl<T: UserEvent> WindowDispatch<T> for MockWindowDispatcher {
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn raw_window_handle(&self) -> Result<raw_window_handle::RawWindowHandle> {
|
fn window_handle(
|
||||||
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
return Ok(raw_window_handle::RawWindowHandle::Xlib(
|
return unsafe {
|
||||||
raw_window_handle::XlibWindowHandle::empty(),
|
Ok(raw_window_handle::WindowHandle::borrow_raw(
|
||||||
));
|
raw_window_handle::RawWindowHandle::Xlib(raw_window_handle::XlibWindowHandle::new(0)),
|
||||||
|
))
|
||||||
|
};
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
return Ok(raw_window_handle::RawWindowHandle::AppKit(
|
return unsafe {
|
||||||
raw_window_handle::AppKitWindowHandle::empty(),
|
Ok(raw_window_handle::WindowHandle::borrow_raw(
|
||||||
));
|
raw_window_handle::RawWindowHandle::AppKit(raw_window_handle::AppKitWindowHandle::new(
|
||||||
|
std::ptr::NonNull::from(&()).cast(),
|
||||||
|
)),
|
||||||
|
))
|
||||||
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
return Ok(raw_window_handle::RawWindowHandle::Win32(
|
return unsafe {
|
||||||
raw_window_handle::Win32WindowHandle::empty(),
|
Ok(raw_window_handle::WindowHandle::borrow_raw(
|
||||||
));
|
raw_window_handle::RawWindowHandle::Win32(raw_window_handle::Win32WindowHandle::new(
|
||||||
|
std::num::NonZeroIsize::MIN,
|
||||||
|
)),
|
||||||
|
))
|
||||||
|
};
|
||||||
#[cfg(not(any(target_os = "linux", target_os = "macos", windows)))]
|
#[cfg(not(any(target_os = "linux", target_os = "macos", windows)))]
|
||||||
return unimplemented!();
|
return unimplemented!();
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
use crate::utils::config::WindowEffectsConfig;
|
use crate::utils::config::WindowEffectsConfig;
|
||||||
use crate::window::{Effect, EffectState};
|
use crate::window::{Effect, EffectState};
|
||||||
use raw_window_handle::HasRawWindowHandle;
|
use raw_window_handle::HasWindowHandle;
|
||||||
use window_vibrancy::{NSVisualEffectMaterial, NSVisualEffectState};
|
use window_vibrancy::{NSVisualEffectMaterial, NSVisualEffectState};
|
||||||
|
|
||||||
pub fn apply_effects(window: impl HasRawWindowHandle, effects: WindowEffectsConfig) {
|
pub fn apply_effects(window: impl HasWindowHandle, effects: WindowEffectsConfig) {
|
||||||
let WindowEffectsConfig {
|
let WindowEffectsConfig {
|
||||||
effects,
|
effects,
|
||||||
radius,
|
radius,
|
||||||
|
@ -11,10 +11,10 @@ use std::ffi::c_void;
|
|||||||
|
|
||||||
use crate::utils::config::WindowEffectsConfig;
|
use crate::utils::config::WindowEffectsConfig;
|
||||||
use crate::window::{Color, Effect};
|
use crate::window::{Color, Effect};
|
||||||
use raw_window_handle::HasRawWindowHandle;
|
use raw_window_handle::HasWindowHandle;
|
||||||
use windows::Win32::Foundation::HWND;
|
use windows::Win32::Foundation::HWND;
|
||||||
|
|
||||||
pub fn apply_effects(window: impl HasRawWindowHandle, effects: WindowEffectsConfig) {
|
pub fn apply_effects(window: impl HasWindowHandle, effects: WindowEffectsConfig) {
|
||||||
let WindowEffectsConfig { effects, color, .. } = effects;
|
let WindowEffectsConfig { effects, color, .. } = effects;
|
||||||
let effect = if let Some(effect) = effects.iter().find(|e| {
|
let effect = if let Some(effect) = effects.iter().find(|e| {
|
||||||
matches!(
|
matches!(
|
||||||
@ -47,7 +47,7 @@ pub fn apply_effects(window: impl HasRawWindowHandle, effects: WindowEffectsConf
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear_effects(window: impl HasRawWindowHandle) {
|
pub fn clear_effects(window: impl HasWindowHandle) {
|
||||||
window_vibrancy::clear_blur(&window);
|
window_vibrancy::clear_blur(&window);
|
||||||
window_vibrancy::clear_acrylic(&window);
|
window_vibrancy::clear_acrylic(&window);
|
||||||
window_vibrancy::clear_mica(&window);
|
window_vibrancy::clear_mica(&window);
|
||||||
|
@ -864,9 +864,11 @@ impl<R: Runtime> PartialEq for WebviewWindow<R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<R: Runtime> raw_window_handle::HasRawWindowHandle for WebviewWindow<R> {
|
impl<R: Runtime> raw_window_handle::HasWindowHandle for WebviewWindow<R> {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn window_handle(
|
||||||
self.webview.window().raw_window_handle()
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||||
|
self.webview.window().window_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -877,9 +877,11 @@ impl<R: Runtime> std::fmt::Debug for Window<R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<R: Runtime> raw_window_handle::HasRawWindowHandle for Window<R> {
|
impl<R: Runtime> raw_window_handle::HasWindowHandle for Window<R> {
|
||||||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
fn window_handle(
|
||||||
self.window.dispatcher.raw_window_handle().unwrap()
|
&self,
|
||||||
|
) -> std::result::Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||||
|
self.window.dispatcher.window_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1418,11 +1420,16 @@ impl<R: Runtime> Window<R> {
|
|||||||
self
|
self
|
||||||
.window
|
.window
|
||||||
.dispatcher
|
.dispatcher
|
||||||
.raw_window_handle()
|
.window_handle()
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
.and_then(|handle| {
|
.and_then(|handle| {
|
||||||
if let raw_window_handle::RawWindowHandle::AppKit(h) = handle {
|
if let raw_window_handle::RawWindowHandle::AppKit(h) = handle.as_raw() {
|
||||||
Ok(h.ns_window)
|
Ok(unsafe {
|
||||||
|
use objc::*;
|
||||||
|
let ns_window: cocoa::base::id =
|
||||||
|
objc::msg_send![h.ns_view.as_ptr() as cocoa::base::id, window];
|
||||||
|
ns_window as *mut _
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
Err(crate::Error::InvalidWindowHandle)
|
Err(crate::Error::InvalidWindowHandle)
|
||||||
}
|
}
|
||||||
@ -1435,11 +1442,11 @@ impl<R: Runtime> Window<R> {
|
|||||||
self
|
self
|
||||||
.window
|
.window
|
||||||
.dispatcher
|
.dispatcher
|
||||||
.raw_window_handle()
|
.window_handle()
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
.and_then(|handle| {
|
.and_then(|handle| {
|
||||||
if let raw_window_handle::RawWindowHandle::AppKit(h) = handle {
|
if let raw_window_handle::RawWindowHandle::AppKit(h) = handle.as_raw() {
|
||||||
Ok(h.ns_view)
|
Ok(h.ns_view.as_ptr())
|
||||||
} else {
|
} else {
|
||||||
Err(crate::Error::InvalidWindowHandle)
|
Err(crate::Error::InvalidWindowHandle)
|
||||||
}
|
}
|
||||||
@ -1452,11 +1459,11 @@ impl<R: Runtime> Window<R> {
|
|||||||
self
|
self
|
||||||
.window
|
.window
|
||||||
.dispatcher
|
.dispatcher
|
||||||
.raw_window_handle()
|
.window_handle()
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
.and_then(|handle| {
|
.and_then(|handle| {
|
||||||
if let raw_window_handle::RawWindowHandle::Win32(h) = handle {
|
if let raw_window_handle::RawWindowHandle::Win32(h) = handle.as_raw() {
|
||||||
Ok(HWND(h.hwnd as _))
|
Ok(HWND(h.hwnd.get()))
|
||||||
} else {
|
} else {
|
||||||
Err(crate::Error::InvalidWindowHandle)
|
Err(crate::Error::InvalidWindowHandle)
|
||||||
}
|
}
|
||||||
|
6
examples/api/src-tauri/Cargo.lock
generated
6
examples/api/src-tauri/Cargo.lock
generated
@ -4960,9 +4960,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wry"
|
name = "wry"
|
||||||
version = "0.35.2"
|
version = "0.36.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3016c47c9b6f7029a9da7cd48af8352327226bba0e955f3c92e2966651365a9"
|
checksum = "3a9e7b81968555303086ef882a0c213896a76099de4ed0b86a798775c2d54304"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"block",
|
"block",
|
||||||
@ -4986,7 +4986,7 @@ dependencies = [
|
|||||||
"objc",
|
"objc",
|
||||||
"objc_id",
|
"objc_id",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"raw-window-handle 0.5.2",
|
"raw-window-handle 0.6.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
Loading…
Reference in New Issue
Block a user