From c75e431175ef886d9068fe354633bb656c8ec7c4 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 16 Feb 2025 18:42:57 +0200 Subject: [PATCH] Debugger window focus update --- debug.cpp | 1 + od-win32/writelog.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debug.cpp b/debug.cpp index af2f366e..3b592019 100644 --- a/debug.cpp +++ b/debug.cpp @@ -7731,6 +7731,7 @@ void debug (void) uae_ppc_pause(0); #endif setmouseactive(0, wasactive ? 2 : 0); + target_inputdevice_acquire(); last_cycles1 = get_cycles(); last_vpos1 = vpos; diff --git a/od-win32/writelog.cpp b/od-win32/writelog.cpp index 7e34b4dc..9fef5642 100644 --- a/od-win32/writelog.cpp +++ b/od-win32/writelog.cpp @@ -145,15 +145,23 @@ void deactivate_console(void) void activate_console(void) { - previousactivewindow = NULL; - if (!consoleopen) + if (!consoleopen) { + previousactivewindow = NULL; return; - previousactivewindow = GetForegroundWindow(); - SetForegroundWindow(GetConsoleWindow()); + } + HWND w = GetForegroundWindow(); + HWND cw = GetConsoleWindow(); + if (cw != w) { + previousactivewindow = w; + } + SetForegroundWindow(cw); } static void open_console_window (void) { + if (!consoleopen) { + previousactivewindow = GetForegroundWindow(); + } AllocConsole (); getconsole (); consoleopen = -1; -- 2.47.3