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>
This commit is contained in:
Siddharth
2025-07-15 12:02:19 +05:30
committed by GitHub
parent 96391467e9
commit 3025d90951
2 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'tauri-runtime-wry': 'patch:changes'
---
Makes some methods on `WindowIdStore`, `WindowsStore` and `WindowWrapper` public

View File

@@ -173,7 +173,7 @@ impl WindowIdStore {
self.0.lock().unwrap().insert(w, id);
}
fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
pub fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
self.0.lock().unwrap().get(w).copied()
}
}
@@ -412,7 +412,7 @@ pub enum ActiveTracingSpan {
}
#[derive(Debug)]
pub struct WindowsStore(RefCell<BTreeMap<WindowId, WindowWrapper>>);
pub struct WindowsStore(pub RefCell<BTreeMap<WindowId, WindowWrapper>>);
// 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<Mutex<Option<String>>>,
}
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")