From 97ebddea666f84dfc40a982814b117255e9800f7 Mon Sep 17 00:00:00 2001 From: Collecting Date: Sun, 1 Feb 2026 00:30:25 +0100 Subject: [PATCH] fix(CLI): Defer the game boot for main event loop Signed-off-by: Collecting --- src/citron/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/citron/main.cpp b/src/citron/main.cpp index 7d6e188bc..27a038de6 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -662,7 +662,13 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk } if (!game_path.isEmpty()) { + // Defer the game boot until after the main event loop has started. + QTimer::singleShot(0, this, [this, game_path, is_fullscreen, has_gamepath]() { + if (has_gamepath || is_fullscreen) { + ui->action_Fullscreen->setChecked(is_fullscreen); + } BootGame(game_path, ApplicationAppletParameters()); + }); } } @@ -2183,8 +2189,8 @@ void GMainWindow::BootGame(const QString& filename, Service::AM::FrontendAppletP connect(emu_thread.get(), &EmuThread::LoadProgress, loading_screen, &LoadingScreen::OnLoadProgress, Qt::QueuedConnection); - // Start the thread AFTER all connections are set up and the event loop has started - QTimer::singleShot(0, this, [this] { emu_thread->start(); }); + // Start the thread AFTER all connections are set up + emu_thread->start(); // Update the GUI UpdateStatusButtons();