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
This commit is contained in:
drmext
2026-05-31 06:59:54 +00:00
committed by GitHub
parent ef384e85dd
commit 465d6c6c18
+3
View File
@@ -495,6 +495,9 @@ LRESULT CALLBACK cfg::ConfiguratorWindow::window_proc(HWND hWnd, UINT uMsg, WPAR
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYUP: { case WM_SYSKEYUP: {
if (wParam == VK_F4) {
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
const bool down = (uMsg == WM_KEYDOWN) || (uMsg == WM_SYSKEYDOWN); const bool down = (uMsg == WM_KEYDOWN) || (uMsg == WM_SYSKEYDOWN);
auto &io = ImGui::GetIO(); auto &io = ImGui::GetIO();
const ImGuiKey key = vk_to_imgui_key(wParam); const ImGuiKey key = vk_to_imgui_key(wParam);