From 3025d90951bfa152fc6f4255ac5a3fdd0f6353ca Mon Sep 17 00:00:00 2001 From: Siddharth Date: Tue, 15 Jul 2025 12:02:19 +0530 Subject: [PATCH] feat: expose some window props from runtime-wry (#13822) * test: make some of window id + stores public * test: make window wrapper label pub * feat: make label accessible for windowwrapper * chore: adds wry runtime changefile * chore: avoid forced clone on label Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/export-window-props-from-wry-runtime.md | 5 +++++ crates/tauri-runtime-wry/src/lib.rs | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changes/export-window-props-from-wry-runtime.md diff --git a/.changes/export-window-props-from-wry-runtime.md b/.changes/export-window-props-from-wry-runtime.md new file mode 100644 index 000000000..fbf6e676a --- /dev/null +++ b/.changes/export-window-props-from-wry-runtime.md @@ -0,0 +1,5 @@ +--- +'tauri-runtime-wry': 'patch:changes' +--- + +Makes some methods on `WindowIdStore`, `WindowsStore` and `WindowWrapper` public diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index 13d9bc7ab..af7ddf5e7 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -173,7 +173,7 @@ impl WindowIdStore { self.0.lock().unwrap().insert(w, id); } - fn get(&self, w: &TaoWindowId) -> Option { + pub fn get(&self, w: &TaoWindowId) -> Option { self.0.lock().unwrap().get(w).copied() } } @@ -412,7 +412,7 @@ pub enum ActiveTracingSpan { } #[derive(Debug)] -pub struct WindowsStore(RefCell>); +pub struct WindowsStore(pub RefCell>); // SAFETY: we ensure this type is only used on the main thread. #[allow(clippy::non_send_fields_in_send_ty)] @@ -2388,6 +2388,12 @@ pub struct WindowWrapper { focused_webview: Arc>>, } +impl WindowWrapper { + pub fn label(&self) -> &str { + &self.label + } +} + impl fmt::Debug for WindowWrapper { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("WindowWrapper")