From c042d26ffd2164a16bd63b64098f93d31d524bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Tue, 27 Dec 2022 10:53:41 +0100 Subject: [PATCH] fix: set byposition flag when removing menus (#304) --- src/os/windows/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 924d785..2ea0511 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -1087,7 +1087,11 @@ impl Window { for i in 0..self.menus.len() { if self.menus[i].menu_handle == handle.0 as windef::HMENU { unsafe { - let _t = winuser::RemoveMenu(main_menu, i as minwindef::UINT, 0); + let _t = winuser::RemoveMenu( + main_menu, + i as minwindef::UINT, + winuser::MF_BYPOSITION, + ); winuser::DrawMenuBar(self.window.unwrap()); } self.menus.swap_remove(i);