summaryrefslogtreecommitdiffstats
path: root/native/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-03-13 14:16:45 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-03-13 14:16:45 -0700
commit8ba18430800142965549077373e2a45d0a3429a1 (patch)
tree0ba36d187e3c66e88476779dc40ba3cf0b28bff0 /native/src/window.rs
parentfa068b904a904c86195ebfaa4e953466426a27aa (diff)
downloadiced-8ba18430800142965549077373e2a45d0a3429a1.tar.gz
iced-8ba18430800142965549077373e2a45d0a3429a1.tar.bz2
iced-8ba18430800142965549077373e2a45d0a3429a1.zip
Code cleanup, clearer comments + removed some unnecessary dupe;
Removed `Frames` struct return for `window::frames()` since we are just redrawing every window anyways; Interface dropping;
Diffstat (limited to '')
-rw-r--r--native/src/window.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/native/src/window.rs b/native/src/window.rs
index a8f8b10f..660cd54f 100644
--- a/native/src/window.rs
+++ b/native/src/window.rs
@@ -30,20 +30,9 @@ 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<Frame> {
+pub fn frames() -> Subscription<Instant> {
subscription::raw_events(|event, _status| match event {
- crate::Event::Window(id, Event::RedrawRequested(at)) => {
- Some(Frame { id, at })
- }
+ crate::Event::Window(_, Event::RedrawRequested(at)) => Some(at),
_ => None,
})
}
-
-/// The returned `Frame` for a framerate subscription.
-#[derive(Debug)]
-pub struct Frame {
- /// The `window::Id` that the `Frame` was produced in.
- pub id: Id,
- /// The `Instant` at which the frame was produced.
- pub at: Instant,
-}