summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-02-15 11:28:36 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-02-15 11:28:36 -0800
commit367fea5dc8e94584334e880970126b40a046bfa6 (patch)
tree8678a00263edd4e4ef8dfc2abf2b6b4c9ca7e067 /native
parent0a643287deece9234b64cc843a9f6ae3e6e4806e (diff)
downloadiced-367fea5dc8e94584334e880970126b40a046bfa6.tar.gz
iced-367fea5dc8e94584334e880970126b40a046bfa6.tar.bz2
iced-367fea5dc8e94584334e880970126b40a046bfa6.zip
Redraw request events for multiwindow.
Diffstat (limited to 'native')
-rw-r--r--native/src/window.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/native/src/window.rs b/native/src/window.rs
index 660cd54f..aa11756f 100644
--- a/native/src/window.rs
+++ b/native/src/window.rs
@@ -30,9 +30,18 @@ use crate::time::Instant;
///
/// In any case, this [`Subscription`] is useful to smoothly draw application-driven
/// animations without missing any frames.
-pub fn frames() -> Subscription<Instant> {
+pub fn frames() -> Subscription<Frame> {
subscription::raw_events(|event, _status| match event {
- crate::Event::Window(_, Event::RedrawRequested(at)) => Some(at),
+ crate::Event::Window(id, Event::RedrawRequested(at)) => {
+ Some(Frame { id, at })
+ }
_ => None,
})
}
+
+/// The returned `Frame` for a framerate subscription.
+#[derive(Debug)]
+pub struct Frame {
+ pub id: Id,
+ pub at: Instant,
+}