uae_ppc_pause(0);
#endif
setmouseactive(0, wasactive ? 2 : 0);
+ target_inputdevice_acquire();
last_cycles1 = get_cycles();
last_vpos1 = vpos;
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;