Skip to content

Commit 0ad9531

Browse files
authored
chore(deps): update tao to 0.13, wry to 0.20, rfd to 0.10, raw-window-handle to 0.5 (#4804)
1 parent 0983d7c commit 0ad9531

File tree

9 files changed

+213
-190
lines changed

9 files changed

+213
-190
lines changed

.changes/raw-display-handle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": "patch"
3+
---
4+
5+
Implement `raw_window_handle::HasRawDisplayHandle` for `App` and `AppHandle`

core/tauri-runtime-wry/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
1313
readme = "README.md"
1414

1515
[dependencies]
16-
wry = { version = "0.19", default-features = false, features = [ "file-drop", "protocol" ] }
16+
wry = { version = "0.20", default-features = false, features = [ "file-drop", "protocol" ] }
1717
tauri-runtime = { version = "0.10.2", path = "../tauri-runtime" }
1818
tauri-utils = { version = "1.0.3", path = "../tauri-utils" }
1919
uuid = { version = "1", features = [ "v4" ] }
2020
rand = "0.8"
21-
raw-window-handle = "0.4.3"
21+
raw-window-handle = "0.5"
2222

2323
[target."cfg(windows)".dependencies]
2424
webview2-com = "0.16.0"

core/tauri-runtime-wry/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
//! The [`wry`] Tauri [`Runtime`].
66
7-
pub use raw_window_handle::HasRawWindowHandle;
7+
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle, RawDisplayHandle};
88
use tauri_runtime::{
99
http::{
1010
Request as HttpRequest, RequestParts as HttpRequestParts, Response as HttpResponse,
@@ -1739,6 +1739,10 @@ impl<T: UserEvent> RuntimeHandle<T> for WryHandle<T> {
17391739
fn remove_system_tray(&self) -> Result<()> {
17401740
send_user_message(&self.context, Message::Tray(TrayMessage::Close))
17411741
}
1742+
1743+
fn raw_display_handle(&self) -> RawDisplayHandle {
1744+
self.context.main_thread.window_target.raw_display_handle()
1745+
}
17421746
}
17431747

17441748
impl<T: UserEvent> Wry<T> {

core/tauri-runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ uuid = { version = "1", features = [ "v4" ] }
3131
http = "0.2.4"
3232
http-range = "0.1.4"
3333
infer = "0.7"
34-
raw-window-handle = "0.4.3"
34+
raw-window-handle = "0.5"
3535

3636
[target."cfg(windows)".dependencies]
3737
webview2-com = "0.16.0"

core/tauri-runtime/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
#![cfg_attr(doc_cfg, feature(doc_cfg))]
88

9+
use raw_window_handle::RawDisplayHandle;
910
use serde::Deserialize;
1011
use std::{fmt::Debug, sync::mpsc::Sender};
1112
use tauri_utils::Theme;
@@ -263,6 +264,8 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
263264
#[cfg(all(windows, feature = "system-tray"))]
264265
#[cfg_attr(doc_cfg, doc(cfg(all(windows, feature = "system-tray"))))]
265266
fn remove_system_tray(&self) -> Result<()>;
267+
268+
fn raw_display_handle(&self) -> RawDisplayHandle;
266269
}
267270

268271
/// A global shortcut manager.

core/tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ attohttpc = { version = "0.19", features = [ "json", "form" ], optional = true }
8080
open = { version = "3.0", optional = true }
8181
shared_child = { version = "1.0", optional = true }
8282
os_pipe = { version = "1.0", optional = true }
83-
rfd = { version = "0.9", optional = true }
84-
raw-window-handle = "0.4.3"
83+
rfd = { version = "0.10", optional = true }
84+
raw-window-handle = "0.5"
8585
minisign-verify = { version = "0.2", optional = true }
8686
time = { version = "0.3", features = [ "parsing", "formatting" ], optional = true }
8787
os_info = { version = "3.4.0", optional = true }

core/tauri/src/app.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use crate::{
3030
#[cfg(shell_scope)]
3131
use crate::scope::ShellScope;
3232

33+
use raw_window_handle::HasRawDisplayHandle;
3334
use tauri_macros::default_runtime;
3435
use tauri_runtime::window::{
3536
dpi::{PhysicalPosition, PhysicalSize},
@@ -1587,6 +1588,18 @@ impl<R: Runtime> Builder<R> {
15871588
}
15881589
}
15891590

1591+
unsafe impl HasRawDisplayHandle for AppHandle {
1592+
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
1593+
self.runtime_handle.raw_display_handle()
1594+
}
1595+
}
1596+
1597+
unsafe impl HasRawDisplayHandle for App {
1598+
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
1599+
self.handle.raw_display_handle()
1600+
}
1601+
}
1602+
15901603
fn on_event_loop_event<R: Runtime, F: FnMut(&AppHandle<R>, RunEvent) + 'static>(
15911604
app_handle: &AppHandle<R>,
15921605
event: RuntimeRunEvent<EventLoopMessage>,

core/tauri/src/test/mock_runtime.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ impl<T: UserEvent> RuntimeHandle<T> for MockRuntimeHandle {
8585
fn remove_system_tray(&self) -> Result<()> {
8686
Ok(())
8787
}
88+
89+
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
90+
unimplemented!()
91+
}
8892
}
8993

9094
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)