From 465d6c6c181ff86d6726e5c758b5dbb2ce13625e Mon Sep 17 00:00:00 2001 From: drmext <71258889+drmext@users.noreply.github.com> Date: Sun, 31 May 2026 06:59:54 +0000 Subject: [PATCH] cfg: fix alt+f4 exit (#723) ## Link to GitHub Issue or related Pull Request, if one exists #720 ## Description of change Pass `VK_F4` sys-key messages through to `DefWindowProc` before ImGui ingestion, restoring the normal Alt+F4 -> `WM_CLOSE` -> `launcher::shutdown()` path. ## Testing - [x] Launch `spicecfg` (D3D9 default path) and press Alt+F4; window closes and process exits - [x] Launch `spicecfg` (software path) and press Alt+F4; window closes and process exits - [x] Close via title-bar X; still works --- src/spice2x/cfg/configurator_wnd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spice2x/cfg/configurator_wnd.cpp b/src/spice2x/cfg/configurator_wnd.cpp index 3776268..fb3e22c 100644 --- a/src/spice2x/cfg/configurator_wnd.cpp +++ b/src/spice2x/cfg/configurator_wnd.cpp @@ -495,6 +495,9 @@ LRESULT CALLBACK cfg::ConfiguratorWindow::window_proc(HWND hWnd, UINT uMsg, WPAR case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: { + if (wParam == VK_F4) { + return DefWindowProc(hWnd, uMsg, wParam, lParam); + } const bool down = (uMsg == WM_KEYDOWN) || (uMsg == WM_SYSKEYDOWN); auto &io = ImGui::GetIO(); const ImGuiKey key = vk_to_imgui_key(wParam);