Skip to content

Commit

Permalink
[MacOS] Fix deadlock on maximizing window from event callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 19, 2023
1 parent 1886949 commit 67b5a25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ And please only add new entries to the top of this list, right below the `# Unre
- On Android, upgrade `ndk` and `ndk-glue` dependencies to the recently released `0.7.0`.
- All platforms can now be relied on to emit a `Resumed` event. Applications are recommended to lazily initialize graphics state and windows on first resume for portability.
- **Breaking:**: Reverse horizontal scrolling sign in `MouseScrollDelta` to match the direction of vertical scrolling. A positive X value now means moving the content to the right. The meaning of vertical scrolling stays the same: a positive Y value means moving the content down.
- On MacOS, fix deadlock when calling `set_maximized` from event loop.

# 0.26.1 (2022-01-05)

Expand Down
5 changes: 4 additions & 1 deletion src/platform_impl/macos/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ impl AppState {
}

pub fn handle_redraw(window_id: WindowId) {
HANDLER.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
if !HANDLER.get_in_callback() {
HANDLER
.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
}
}

pub fn queue_event(wrapper: EventWrapper) {
Expand Down

0 comments on commit 67b5a25

Please sign in to comment.