From: Toni Wilen Date: Sun, 16 Feb 2025 16:42:57 +0000 (+0200) Subject: Debugger window focus update X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c75e431175ef886d9068fe354633bb656c8ec7c4;p=francis%2Fwinuae.git Debugger window focus update --- 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;