diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/core.h | 7 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/core.h b/src/core/core.h index 790e23cae..7188dabdc 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -187,6 +187,13 @@ public: | |||
| 187 | return current_process; | 187 | return current_process; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | /// Gets the name of the current game | ||
| 191 | Loader::ResultStatus GetGameName(std::string& out) const { | ||
| 192 | if (app_loader == nullptr) | ||
| 193 | return Loader::ResultStatus::ErrorNotInitialized; | ||
| 194 | return app_loader->ReadTitle(out); | ||
| 195 | } | ||
| 196 | |||
| 190 | PerfStats perf_stats; | 197 | PerfStats perf_stats; |
| 191 | FrameLimiter frame_limiter; | 198 | FrameLimiter frame_limiter; |
| 192 | 199 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 98a41a725..53410fb91 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -556,6 +556,15 @@ void GMainWindow::BootGame(const QString& filename) { | |||
| 556 | } | 556 | } |
| 557 | status_bar_update_timer.start(2000); | 557 | status_bar_update_timer.start(2000); |
| 558 | 558 | ||
| 559 | std::string title_name; | ||
| 560 | const auto res = Core::System::GetInstance().GetGameName(title_name); | ||
| 561 | if (res != Loader::ResultStatus::Success) | ||
| 562 | title_name = FileUtil::GetFilename(filename.toStdString()); | ||
| 563 | |||
| 564 | setWindowTitle(QString("yuzu %1| %4 | %2-%3") | ||
| 565 | .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc, | ||
| 566 | QString::fromStdString(title_name))); | ||
| 567 | |||
| 559 | render_window->show(); | 568 | render_window->show(); |
| 560 | render_window->setFocus(); | 569 | render_window->setFocus(); |
| 561 | 570 | ||
| @@ -587,6 +596,8 @@ void GMainWindow::ShutdownGame() { | |||
| 587 | render_window->hide(); | 596 | render_window->hide(); |
| 588 | game_list->show(); | 597 | game_list->show(); |
| 589 | game_list->setFilterFocus(); | 598 | game_list->setFilterFocus(); |
| 599 | setWindowTitle(QString("yuzu %1| %2-%3") | ||
| 600 | .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); | ||
| 590 | 601 | ||
| 591 | // Disable status bar updates | 602 | // Disable status bar updates |
| 592 | status_bar_update_timer.stop(); | 603 | status_bar_update_timer.stop(); |