Broadcast orphaned events in multi_window runtime
This commit is contained in:
parent
e400f972c1
commit
ae2bf8ee40
1 changed files with 14 additions and 7 deletions
|
|
@ -491,7 +491,7 @@ async fn run_instance<A, E, C>(
|
||||||
let mut clipboard = Clipboard::connect(&main_window.raw);
|
let mut clipboard = Clipboard::connect(&main_window.raw);
|
||||||
let mut events = {
|
let mut events = {
|
||||||
vec![(
|
vec![(
|
||||||
Some(window::Id::MAIN),
|
window::Id::MAIN,
|
||||||
core::Event::Window(window::Event::Opened {
|
core::Event::Window(window::Event::Opened {
|
||||||
position: main_window.position(),
|
position: main_window.position(),
|
||||||
size: main_window.size(),
|
size: main_window.size(),
|
||||||
|
|
@ -561,7 +561,7 @@ async fn run_instance<A, E, C>(
|
||||||
let _ = ui_caches.insert(id, user_interface::Cache::default());
|
let _ = ui_caches.insert(id, user_interface::Cache::default());
|
||||||
|
|
||||||
events.push((
|
events.push((
|
||||||
Some(id),
|
id,
|
||||||
core::Event::Window(window::Event::Opened {
|
core::Event::Window(window::Event::Opened {
|
||||||
position: window.position(),
|
position: window.position(),
|
||||||
size: window.size(),
|
size: window.size(),
|
||||||
|
|
@ -588,7 +588,7 @@ async fn run_instance<A, E, C>(
|
||||||
use crate::core::event;
|
use crate::core::event;
|
||||||
|
|
||||||
events.push((
|
events.push((
|
||||||
None,
|
window::Id::MAIN,
|
||||||
event::Event::PlatformSpecific(
|
event::Event::PlatformSpecific(
|
||||||
event::PlatformSpecific::MacOS(
|
event::PlatformSpecific::MacOS(
|
||||||
event::MacOS::ReceivedUrl(url),
|
event::MacOS::ReceivedUrl(url),
|
||||||
|
|
@ -795,7 +795,7 @@ async fn run_instance<A, E, C>(
|
||||||
let _ = ui_caches.remove(&id);
|
let _ = ui_caches.remove(&id);
|
||||||
|
|
||||||
events.push((
|
events.push((
|
||||||
None,
|
id,
|
||||||
core::Event::Window(window::Event::Closed),
|
core::Event::Window(window::Event::Closed),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -814,7 +814,7 @@ async fn run_instance<A, E, C>(
|
||||||
window.state.scale_factor(),
|
window.state.scale_factor(),
|
||||||
window.state.modifiers(),
|
window.state.modifiers(),
|
||||||
) {
|
) {
|
||||||
events.push((Some(id), event));
|
events.push((id, event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -830,8 +830,7 @@ async fn run_instance<A, E, C>(
|
||||||
let mut window_events = vec![];
|
let mut window_events = vec![];
|
||||||
|
|
||||||
events.retain(|(window_id, event)| {
|
events.retain(|(window_id, event)| {
|
||||||
if *window_id == Some(id) || window_id.is_none()
|
if *window_id == id {
|
||||||
{
|
|
||||||
window_events.push(event.clone());
|
window_events.push(event.clone());
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -871,6 +870,14 @@ async fn run_instance<A, E, C>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (id, event) in events.drain(..) {
|
||||||
|
runtime.broadcast(
|
||||||
|
event,
|
||||||
|
core::event::Status::Ignored,
|
||||||
|
id,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
debug.event_processing_finished();
|
debug.event_processing_finished();
|
||||||
|
|
||||||
// TODO mw application update returns which window IDs to update
|
// TODO mw application update returns which window IDs to update
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue