Skip to content

Commit 3025d90

Browse files
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 <[email protected]> --------- Co-authored-by: Tony <[email protected]>
1 parent 9639146 commit 3025d90

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-runtime-wry': 'patch:changes'
3+
---
4+
5+
Makes some methods on `WindowIdStore`, `WindowsStore` and `WindowWrapper` public

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl WindowIdStore {
173173
self.0.lock().unwrap().insert(w, id);
174174
}
175175

176-
fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
176+
pub fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
177177
self.0.lock().unwrap().get(w).copied()
178178
}
179179
}
@@ -412,7 +412,7 @@ pub enum ActiveTracingSpan {
412412
}
413413

414414
#[derive(Debug)]
415-
pub struct WindowsStore(RefCell<BTreeMap<WindowId, WindowWrapper>>);
415+
pub struct WindowsStore(pub RefCell<BTreeMap<WindowId, WindowWrapper>>);
416416

417417
// SAFETY: we ensure this type is only used on the main thread.
418418
#[allow(clippy::non_send_fields_in_send_ty)]
@@ -2388,6 +2388,12 @@ pub struct WindowWrapper {
23882388
focused_webview: Arc<Mutex<Option<String>>>,
23892389
}
23902390

2391+
impl WindowWrapper {
2392+
pub fn label(&self) -> &str {
2393+
&self.label
2394+
}
2395+
}
2396+
23912397
impl fmt::Debug for WindowWrapper {
23922398
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23932399
f.debug_struct("WindowWrapper")

0 commit comments

Comments
 (0)