Implement ApplicationHandler::can_create|destroy_surfaces() (#3765)
This commit is contained in:
parent
a0d69c782a
commit
75ce71f05a
21 changed files with 178 additions and 114 deletions
|
|
@ -496,8 +496,12 @@ pub fn did_finish_launching(mtm: MainThreadMarker) {
|
|||
|
||||
let (windows, events) = AppState::get_mut(mtm).did_finish_launching_transition();
|
||||
|
||||
let events = std::iter::once(EventWrapper::StaticEvent(Event::NewEvents(StartCause::Init)))
|
||||
.chain(events);
|
||||
let events = [
|
||||
EventWrapper::StaticEvent(Event::NewEvents(StartCause::Init)),
|
||||
EventWrapper::StaticEvent(Event::CreateSurfaces),
|
||||
]
|
||||
.into_iter()
|
||||
.chain(events);
|
||||
handle_nonuser_events(mtm, events);
|
||||
|
||||
// the above window dance hack, could possibly trigger new windows to be created.
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ fn map_user_event<A: ApplicationHandler>(
|
|||
},
|
||||
Event::Suspended => app.suspended(window_target),
|
||||
Event::Resumed => app.resumed(window_target),
|
||||
Event::CreateSurfaces => app.can_create_surfaces(window_target),
|
||||
Event::AboutToWait => app.about_to_wait(window_target),
|
||||
Event::LoopExiting => app.exiting(window_target),
|
||||
Event::MemoryWarning => app.memory_warning(window_target),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue