More cleanup
This commit is contained in:
@@ -254,6 +254,7 @@ impl<M: Mountable> MountedApp<M> {
|
||||
break;
|
||||
};
|
||||
|
||||
let mut should_flush_reactive_work = false;
|
||||
for event in iter::once(event).chain(ui.take_pending_events()) {
|
||||
match event {
|
||||
PlatformEvent::Configured {
|
||||
@@ -268,7 +269,7 @@ impl<M: Mountable> MountedApp<M> {
|
||||
);
|
||||
let _ = viewport.set(configuration.actual_inner_size);
|
||||
configure_serial.update(|value| *value = value.wrapping_add(1));
|
||||
current_reactor().flush_now();
|
||||
should_flush_reactive_work = true;
|
||||
}
|
||||
PlatformEvent::Pointer { window_id, event } if window_id == window.id() => {
|
||||
Self::handle_pointer_event(
|
||||
@@ -279,7 +280,7 @@ impl<M: Mountable> MountedApp<M> {
|
||||
&mut input_state,
|
||||
event,
|
||||
)?;
|
||||
current_reactor().flush_now();
|
||||
should_flush_reactive_work = true;
|
||||
}
|
||||
PlatformEvent::Keyboard { window_id, event } if window_id == window.id() => {
|
||||
Self::handle_keyboard_event(
|
||||
@@ -289,7 +290,7 @@ impl<M: Mountable> MountedApp<M> {
|
||||
&input_state,
|
||||
event,
|
||||
)?;
|
||||
current_reactor().flush_now();
|
||||
should_flush_reactive_work = true;
|
||||
}
|
||||
PlatformEvent::CloseRequested { window_id } if window_id == window.id() => {
|
||||
tracing::debug!(
|
||||
@@ -311,6 +312,9 @@ impl<M: Mountable> MountedApp<M> {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
if should_flush_reactive_work {
|
||||
current_reactor().flush_now();
|
||||
}
|
||||
}
|
||||
|
||||
ui.shutdown()?;
|
||||
|
||||
Reference in New Issue
Block a user