Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macOS): backport fix about windows frozen when starting in fullscreen to v0.16 #729

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/fullscreen-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tao": patch
---

On macOS, fix window frozed when starting with fullscreen.

13 changes: 1 addition & 12 deletions src/platform_impl/macos/window_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,7 @@ extern "C" fn window_will_close(this: &Object, _: Sel, _: id) {
extern "C" fn window_did_resize(this: &Object, _: Sel, _: id) {
trace!("Triggered `windowDidResize:`");
with_state(this, |state| {
// If window is entering/exiting, resize and move event will be emitted in
// window_did_enter_fullscreen & window_did_exit_fullscreen.
let in_fullscreen_transition = state
.with_window(|window| {
trace!("Locked shared state in `window_did_resize`");
let shared_state = window.shared_state.lock().unwrap();
trace!("Unlocked shared state in `window_did_resize`");
shared_state.in_fullscreen_transition
})
.unwrap_or(false);

if !state.is_checking_zoomed_in && !in_fullscreen_transition {
if !state.is_checking_zoomed_in {
state.emit_resize_event();
state.emit_move_event();
}
Expand Down