summaryrefslogtreecommitdiffstats
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/main.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 3c2824362..552c2cc63 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1384,6 +1384,9 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
system.RegisterExecuteProgramCallback(
[this](std::size_t program_index) { render_window->ExecuteProgram(program_index); });
+ // Register an Exit callback such that Core can exit the currently running application.
+ system.RegisterExitCallback([this]() { render_window->Exit(); });
+
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
connect(render_window, &GRenderWindow::MouseActivity, this, &GMainWindow::OnMouseActivity);
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
@@ -2469,6 +2472,10 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
BootGame(last_filename_booted, 0, program_index);
}
+void GMainWindow::OnExit() {
+ OnStopGame();
+}
+
void GMainWindow::ErrorDisplayDisplayError(QString error_code, QString error_text) {
OverlayDialog dialog(render_window, Core::System::GetInstance(), error_code, error_text,
QString{}, tr("OK"), Qt::AlignLeft | Qt::AlignVCenter);
@@ -2913,8 +2920,13 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie
if (title_name.empty()) {
setWindowTitle(QString::fromStdString(window_title));
} else {
- const auto run_title =
- fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor);
+ const auto run_title = [window_title, title_name, title_version, gpu_vendor]() {
+ if (title_version.empty()) {
+ return fmt::format("{} | {} | {}", window_title, title_name, gpu_vendor);
+ }
+ return fmt::format("{} | {} | {} | {}", window_title, title_name, title_version,
+ gpu_vendor);
+ }();
setWindowTitle(QString::fromStdString(run_title));
}
}