]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Debugger window focus update
authorToni Wilen <twilen@winuae.net>
Sun, 16 Feb 2025 16:42:57 +0000 (18:42 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 16 Feb 2025 16:42:57 +0000 (18:42 +0200)
debug.cpp
od-win32/writelog.cpp

index af2f366eb5558d9982c41b91d95f6c960e396bd5..3b5920199999a8a9e12f65f2948cf03d32a08634 100644 (file)
--- 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;
index 7e34b4dcd33e15ac5ba64801617503e628adf836..9fef564268cd2a3c87aaef11fb8d914ef49587a1 100644 (file)
@@ -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;