diff --git a/.changes/windows-about-menu-item.md b/.changes/windows-about-menu-item.md new file mode 100644 index 0000000..d2c8d29 --- /dev/null +++ b/.changes/windows-about-menu-item.md @@ -0,0 +1,5 @@ +--- +"muda": "patch" +--- + +On Windows, fix panic when click a menu item while the `PredefinedMenuItem::about` dialog is open. diff --git a/src/platform_impl/windows/mod.rs b/src/platform_impl/windows/mod.rs index c37ea2a..3878a5c 100644 --- a/src/platform_impl/windows/mod.rs +++ b/src/platform_impl/windows/mod.rs @@ -1154,7 +1154,14 @@ unsafe extern "system" fn menu_subclass_proc( "About {}", metadata.name.as_deref().unwrap_or_default() )); - MessageBoxW(hwnd, message.as_ptr(), title.as_ptr(), MB_ICONINFORMATION); + std::thread::spawn(move || { + MessageBoxW( + hwnd, + message.as_ptr(), + title.as_ptr(), + MB_ICONINFORMATION, + ); + }); } _ => {}