summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-01-11 13:47:43 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-01-11 13:47:43 +0700
commit6ab4611a6eec9c4bb4ca1ff1bb580bb7edf49add (patch)
treec96d3eb77ffe99a580ed13efecc50d2857f1b8f0 /winit
parent90c20ac46b72b6d8f735f7efd283b9d1dfecfb9d (diff)
downloadiced-6ab4611a6eec9c4bb4ca1ff1bb580bb7edf49add.tar.gz
iced-6ab4611a6eec9c4bb4ca1ff1bb580bb7edf49add.tar.bz2
iced-6ab4611a6eec9c4bb4ca1ff1bb580bb7edf49add.zip
Invalidate widget tree from `Responsive` widget
... by introducing a new `invalidate_widgets` method to `Shell`
Diffstat (limited to 'winit')
-rw-r--r--winit/src/application.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 32423e80..e9212b5e 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -15,7 +15,7 @@ use iced_futures::futures;
use iced_futures::futures::channel::mpsc;
use iced_graphics::window;
use iced_native::program::Program;
-use iced_native::{Cache, UserInterface};
+use iced_native::user_interface::{self, UserInterface};
use std::mem::ManuallyDrop;
@@ -250,7 +250,7 @@ async fn run_instance<A, E, C>(
let mut user_interface = ManuallyDrop::new(build_user_interface(
&mut application,
- Cache::default(),
+ user_interface::Cache::default(),
&mut renderer,
state.logical_size(),
&mut debug,
@@ -271,7 +271,7 @@ async fn run_instance<A, E, C>(
debug.event_processing_started();
- let statuses = user_interface.update(
+ let (interface_state, statuses) = user_interface.update(
&events,
state.cursor_position(),
&mut renderer,
@@ -285,7 +285,12 @@ async fn run_instance<A, E, C>(
runtime.broadcast(event);
}
- if !messages.is_empty() {
+ if !messages.is_empty()
+ || matches!(
+ interface_state,
+ user_interface::State::Outdated,
+ )
+ {
let cache =
ManuallyDrop::into_inner(user_interface).into_cache();
@@ -471,7 +476,7 @@ pub fn requests_exit(
/// [`struct@Debug`] information accordingly.
pub fn build_user_interface<'a, A: Application>(
application: &'a mut A,
- cache: Cache,
+ cache: user_interface::Cache,
renderer: &mut A::Renderer,
size: Size,
debug: &mut Debug,