Skip to content

Commit

Permalink
fix: MenuItem::Quit on Windows (#303)
Browse files Browse the repository at this point in the history
* fix: `MenuItem::Close` on Windows

* use `PostQuitMessage` instead

Co-authored-by: amrbashir <[email protected]>
  • Loading branch information
lucasfernog and amrbashir authored Feb 4, 2022
1 parent 7811284 commit cf3d3b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-quit-menuitem-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fixes the `MenuItem::Quit` behavior on Windows.
2 changes: 1 addition & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl<T: 'static> EventLoop<T> {
.p
.runner_shared
.set_event_handler(move |event, control_flow| {
event_handler(event, event_loop_windows_ref, control_flow)
event_handler(event, event_loop_windows_ref, control_flow);
});
}

Expand Down
1 change: 1 addition & 0 deletions src/platform_impl/windows/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ pub(crate) unsafe extern "system" fn subclass_proc(
}
QUIT_ID => {
subclass_input.send_event(Event::LoopDestroyed);
PostQuitMessage(0);
}
MINIMIZE_ID => {
ShowWindow(hwnd, SW_MINIMIZE);
Expand Down

0 comments on commit cf3d3b5

Please sign in to comment.