[MacOS] Fix deadlock on maximizing window from event callback (#2636)
This commit is contained in:
parent
b711a11549
commit
a867032e1e
2 changed files with 8 additions and 1 deletions
|
|
@ -352,7 +352,13 @@ impl AppState {
|
|||
}
|
||||
|
||||
pub fn handle_redraw(window_id: WindowId) {
|
||||
HANDLER.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
|
||||
// Redraw request might come out of order from the OS.
|
||||
// -> Don't go back into the callback when our callstack originates from there
|
||||
if !HANDLER.in_callback.swap(true, Ordering::AcqRel) {
|
||||
HANDLER
|
||||
.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
|
||||
HANDLER.set_in_callback(false);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn queue_event(wrapper: EventWrapper) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue