summaryrefslogtreecommitdiffstats
path: root/native/src/subscription.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-12 02:59:08 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-12 02:59:08 +0100
commit7354f68b3ca345767de3f09dccddf168493977bf (patch)
treea09626c11a25ab4260c576733f1700e9ad12894b /native/src/subscription.rs
parent7ccd87c36b54e0d53f65f5774f140a0528ae4504 (diff)
downloadiced-7354f68b3ca345767de3f09dccddf168493977bf.tar.gz
iced-7354f68b3ca345767de3f09dccddf168493977bf.tar.bz2
iced-7354f68b3ca345767de3f09dccddf168493977bf.zip
Draft `Shell:request_redraw` API
... and implement `TextInput` cursor blink :tada:
Diffstat (limited to 'native/src/subscription.rs')
-rw-r--r--native/src/subscription.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/native/src/subscription.rs b/native/src/subscription.rs
index c60b1281..980a8116 100644
--- a/native/src/subscription.rs
+++ b/native/src/subscription.rs
@@ -1,5 +1,6 @@
//! Listen to external events in your application.
use crate::event::{self, Event};
+use crate::window;
use crate::Hasher;
use iced_futures::futures::{self, Future, Stream};
@@ -33,7 +34,7 @@ pub type Tracker =
pub use iced_futures::subscription::Recipe;
-/// Returns a [`Subscription`] to all the runtime events.
+/// Returns a [`Subscription`] to all the ignored runtime events.
///
/// This subscription will notify your application of any [`Event`] that was
/// not captured by any widget.
@@ -65,7 +66,10 @@ where
use futures::stream::StreamExt;
events.filter_map(move |(event, status)| {
- future::ready(f(event, status))
+ future::ready(match event {
+ Event::Window(window::Event::RedrawRequested(_)) => None,
+ _ => f(event, status),
+ })
})
},
})