Quit via File -> Exit / Alt+F4 instead of Escape

Escape was a leftover spike convenience that quit the tool. Esc is a common
in-game key, so dropping it from a borderless mirror was too easy to do by
accident. Remove the Escape-quit handler and add a File -> Exit menu item
(shown with its Alt+F4 shortcut). Alt+F4 already worked via DefWindowProc ->
WM_CLOSE -> WM_DESTROY; the menu item sets a one-shot flag the main loop reads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 00:07:28 +02:00
parent 699ca31d31
commit a813465fd7
4 changed files with 21 additions and 10 deletions

View File

@@ -204,14 +204,10 @@ LRESULT CALLBACK D3D11Window::wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
self->resize_height_ = HIWORD(lparam);
}
return 0;
case WM_KEYDOWN:
// Spike convenience: Esc quits so we aren't stuck in a borderless window.
if (wparam == VK_ESCAPE)
{
PostQuitMessage(0);
}
return 0;
case WM_DESTROY:
// Reached by the close button, Alt+F4 (DefWindowProc turns it into WM_CLOSE ->
// DestroyWindow), and our own teardown. Esc deliberately does NOT quit -- it's a
// common in-game key, so quitting is via the File -> Exit menu item or Alt+F4.
PostQuitMessage(0);
return 0;
default: