fix: set byposition flag when removing menus (#304)

This commit is contained in:
nils måsén 2022-12-27 10:53:41 +01:00 committed by GitHub
parent e4881e77f9
commit c042d26ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);