From 596cd164a34287325cbade84907ddbe25217ea94 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 31 Mar 2021 02:48:25 +0900 Subject: [PATCH] [win] Handle focus in/out events This fixes the errant console behavior (cursor wasn't showing because QF thought it had never received focus). --- config.d/windows.m4 | 2 +- libs/video/targets/in_win.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.d/windows.m4 b/config.d/windows.m4 index 4a59a473b..e0ee907c8 100644 --- a/config.d/windows.m4 +++ b/config.d/windows.m4 @@ -12,8 +12,8 @@ case "$host_os" in CPPFLAGS="$CPPFLAGS $CFLAGS" ;; esac - SYSTYPE=WIN32 fi + SYSTYPE=WIN32 AC_DEFINE(NEED_GNUPRINTF) endian="little" ;; diff --git a/libs/video/targets/in_win.c b/libs/video/targets/in_win.c index b372bc379..a610167a1 100644 --- a/libs/video/targets/in_win.c +++ b/libs/video/targets/in_win.c @@ -776,9 +776,13 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg = WM_MOUSEWHEEL; switch (uMsg) { + case WM_SETFOCUS: + Key_FocusEvent (1); + break; case WM_KILLFOCUS: if (modestate == MS_FULLDIB) ShowWindow (win_mainwindow, SW_SHOWMINNOACTIVE); + Key_FocusEvent (0); break; case WM_CREATE: break;