summaryrefslogtreecommitdiffstats
path: root/winit/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'winit/src/application.rs')
-rw-r--r--winit/src/application.rs27
1 files changed, 16 insertions, 11 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 4aed1eee..d93ea42e 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -12,7 +12,8 @@ use crate::core::widget::operation;
use crate::core::window;
use crate::core::{Color, Event, Point, Size, Theme};
use crate::futures::futures;
-use crate::futures::{Executor, Runtime, Subscription};
+use crate::futures::subscription::{self, Subscription};
+use crate::futures::{Executor, Runtime};
use crate::graphics;
use crate::graphics::compositor::{self, Compositor};
use crate::runtime::clipboard;
@@ -574,12 +575,10 @@ async fn run_instance<A, E, C>(
event::Event::PlatformSpecific(event::PlatformSpecific::MacOS(
event::MacOS::ReceivedUrl(url),
)) => {
- use crate::core::event;
-
- events.push(Event::PlatformSpecific(
- event::PlatformSpecific::MacOS(event::MacOS::ReceivedUrl(
- url,
- )),
+ runtime.broadcast(subscription::Event::PlatformSpecific(
+ subscription::PlatformSpecific::MacOS(
+ subscription::MacOS::ReceivedUrl(url),
+ ),
));
}
event::Event::UserEvent(message) => {
@@ -623,7 +622,6 @@ async fn run_instance<A, E, C>(
// Then, we can use the `interface_state` here to decide if a redraw
// is needed right away, or simply wait until a specific time.
let redraw_event = Event::Window(
- window::Id::MAIN,
window::Event::RedrawRequested(Instant::now()),
);
@@ -651,7 +649,11 @@ async fn run_instance<A, E, C>(
_ => ControlFlow::Wait,
});
- runtime.broadcast(redraw_event, core::event::Status::Ignored);
+ runtime.broadcast(subscription::Event::Interaction {
+ window: window::Id::MAIN,
+ event: redraw_event,
+ status: core::event::Status::Ignored,
+ });
debug.draw_started();
let new_mouse_interaction = user_interface.draw(
@@ -714,7 +716,6 @@ async fn run_instance<A, E, C>(
state.update(&window, &window_event, &mut debug);
if let Some(event) = conversion::window_event(
- window::Id::MAIN,
window_event,
state.scale_factor(),
state.modifiers(),
@@ -742,7 +743,11 @@ async fn run_instance<A, E, C>(
for (event, status) in
events.drain(..).zip(statuses.into_iter())
{
- runtime.broadcast(event, status);
+ runtime.broadcast(subscription::Event::Interaction {
+ window: window::Id::MAIN,
+ event,
+ status,
+ });
}
if !messages.is_empty()