diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 3f0bf779077b..54af2418989a 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -848,14 +848,14 @@ void CDisasm::SetDebugMode(bool _bDebug, bool switchPC) } } -void CDisasm::Show(bool bShow) { +void CDisasm::Show(bool bShow, bool includeToTop) { if (deferredSymbolFill_ && bShow) { if (g_symbolMap) { g_symbolMap->FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), ST_FUNCTION); deferredSymbolFill_ = false; } } - Dialog::Show(bShow); + Dialog::Show(bShow, includeToTop); } void CDisasm::NotifyMapLoaded() { diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index c95ba39bd721..e77a9bb2caa5 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -49,7 +49,7 @@ class CDisasm : public Dialog CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *cpu); ~CDisasm(); - void Show(bool bShow) override; + void Show(bool bShow, bool includeToTop = true) override; void Update() override { UpdateDialog(true); diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index d01074b92b4f..26c64a1c332e 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -540,7 +540,7 @@ namespace MainWindow void CreateDebugWindows() { disasmWindow = new CDisasm(MainWindow::GetHInstance(), MainWindow::GetHWND(), currentDebugMIPS); DialogManager::AddDlg(disasmWindow); - disasmWindow->Show(g_Config.bShowDebuggerOnLoad); + disasmWindow->Show(g_Config.bShowDebuggerOnLoad, false); #if PPSSPP_API(ANY_GL) geDebuggerWindow = new CGEDebugger(MainWindow::GetHInstance(), MainWindow::GetHWND()); @@ -935,8 +935,6 @@ namespace MainWindow if (disasmWindow) disasmWindow->UpdateDialog(); - - SetForegroundWindow(hwndMain); break; case WM_USER_SAVESTATE_FINISH: diff --git a/Windows/W32Util/DialogManager.cpp b/Windows/W32Util/DialogManager.cpp index fdb89ac6002b..df131d9db4e7 100644 --- a/Windows/W32Util/DialogManager.cpp +++ b/Windows/W32Util/DialogManager.cpp @@ -30,11 +30,16 @@ void Dialog::Destroy() DestroyWindow(m_hDlg); } -void Dialog::Show(bool _bShow) +void Dialog::Show(bool _bShow, bool includeToTop) { - m_bShowState = _bShow ? SW_NORMAL : SW_HIDE; + if (_bShow && includeToTop) + m_bShowState = SW_SHOWNORMAL; + else if (_bShow) + m_bShowState = SW_SHOWNOACTIVATE; + else + m_bShowState = SW_HIDE; ShowWindow(m_hDlg, m_bShowState); - if (_bShow) + if (_bShow && includeToTop) BringWindowToTop(m_hDlg); } diff --git a/Windows/W32Util/DialogManager.h b/Windows/W32Util/DialogManager.h index f1093deb1494..fc943b3ddd5f 100644 --- a/Windows/W32Util/DialogManager.h +++ b/Windows/W32Util/DialogManager.h @@ -8,7 +8,7 @@ class Dialog Dialog(LPCSTR res, HINSTANCE _hInstance, HWND _hParent); virtual ~Dialog(); - virtual void Show(bool _bShow); + virtual void Show(bool _bShow, bool includeToTop = true); virtual void Update() {} HWND GetDlgHandle() {