diff --git a/CHANGELOG.md b/CHANGELOG.md index f53bb569..c8be853d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- On macOS, fix crash when starting maximized without decorations. - On macOS, fix application not to terminate on `run_return`. - On Wayland, fix cursor icon updates on window borders when using CSD. - On Wayland, under mutter(GNOME Wayland), fix CSD being behind the status bar, when starting window in maximized mode. diff --git a/src/platform_impl/macos/util/async.rs b/src/platform_impl/macos/util/async.rs index ad1a891b..c2d117b6 100644 --- a/src/platform_impl/macos/util/async.rs +++ b/src/platform_impl/macos/util/async.rs @@ -60,11 +60,15 @@ pub unsafe fn set_style_mask_async(ns_window: id, ns_view: id, mask: NSWindowSty } pub unsafe fn set_style_mask_sync(ns_window: id, ns_view: id, mask: NSWindowStyleMask) { let context = SetStyleMaskData::new_ptr(ns_window, ns_view, mask); - dispatch_sync_f( - dispatch_get_main_queue(), - context as *mut _, - set_style_mask_callback, - ); + if msg_send![class!(NSThread), isMainThread] { + set_style_mask_callback(context as *mut _); + } else { + dispatch_sync_f( + dispatch_get_main_queue(), + context as *mut _, + set_style_mask_callback, + ); + } } struct SetContentSizeData {