diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 4c56b30112..f12bec8af7 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -414,6 +414,7 @@ THREAD_RETURN EmuThread(void *pArg) if (g_pUpdateFPSDisplay != NULL) g_pUpdateFPSDisplay(("Loading " + _CoreParameter.m_strFilename).c_str()); + Host_UpdateTitle(("Loading " + _CoreParameter.m_strFilename).c_str()); // Setup our core, but can't use dynarec if we are compare server if (_CoreParameter.iCPUCore && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient)) @@ -435,6 +436,7 @@ THREAD_RETURN EmuThread(void *pArg) if (g_pUpdateFPSDisplay != NULL) g_pUpdateFPSDisplay(("Loaded " + _CoreParameter.m_strFilename).c_str()); + Host_UpdateTitle(("Loaded " + _CoreParameter.m_strFilename).c_str()); // Update the window again because all stuff is initialized Host_UpdateDisasmDialog(); @@ -454,6 +456,7 @@ THREAD_RETURN EmuThread(void *pArg) if (g_pUpdateFPSDisplay != NULL) g_pUpdateFPSDisplay(("Loaded " + _CoreParameter.m_strFilename).c_str()); + Host_UpdateTitle(("Loaded " + _CoreParameter.m_strFilename).c_str()); // Update the window again because all stuff is initialized Host_UpdateDisasmDialog(); @@ -663,6 +666,7 @@ void VideoThrottle() // Show message if (g_pUpdateFPSDisplay != NULL) g_pUpdateFPSDisplay(SMessage.c_str()); + Host_UpdateTitle(SMessage.c_str()); Host_UpdateStatusBar(SMessage.c_str()); diff --git a/Source/Core/Core/Src/Host.h b/Source/Core/Core/Src/Host.h index f4f7ab94f1..e91c2138cd 100644 --- a/Source/Core/Core/Src/Host.h +++ b/Source/Core/Core/Src/Host.h @@ -38,6 +38,7 @@ void Host_Message(int Id); void Host_UpdateMainFrame(); +void Host_UpdateTitle(const char* title); void Host_UpdateDisasmDialog(); void Host_UpdateLogDisplay(); void Host_UpdateMemoryView(); diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index a048c14363..1dbd17b519 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -732,6 +732,11 @@ void CFrame::OnHostMessage(wxCommandEvent& event) } break; + case IDM_UPDATETITLE: + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && m_RenderFrame) + m_RenderFrame->SetTitle(event.GetString()); + break; + case WM_USER_CREATE: DoFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen); if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 9be2cde545..0c7588a363 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -236,6 +236,7 @@ enum IDM_UPDATEDISASMDIALOG, IDM_UPDATEGUI, IDM_UPDATESTATUSBAR, + IDM_UPDATETITLE, IDM_UPDATEBREAKPOINTS, IDM_HOST_MESSAGE, diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 2bb74210c1..93c0066d8e 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -611,6 +611,13 @@ void Host_UpdateMainFrame() } } +void Host_UpdateTitle(const char* title) +{ + wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATETITLE); + event.SetString(wxString::FromAscii(title)); + main_frame->GetEventHandler()->AddPendingEvent(event); +} + void Host_UpdateBreakPointView() { wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index 7738c3d610..4071e0ddc8 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -248,9 +248,6 @@ void Initialize(void *init) void Video_Prepare() { - // Tell the host the window is ready - g_VideoInitialize.pCoreMessage(WM_USER_CREATE); - // Better be safe... s_efbAccessRequested = FALSE; s_FifoShuttingDown = FALSE; @@ -269,6 +266,9 @@ void Video_Prepare() PixelShaderManager::Init(); CommandProcessor::Init(); PixelEngine::Init(); + + // Tell the host the window is ready + g_VideoInitialize.pCoreMessage(WM_USER_CREATE); } void Shutdown()