diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index cf2e9c66c6..f7a8a847a2 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -81,6 +81,8 @@ static atomic_t s_headless = false; static atomic_t s_no_gui = false; static atomic_t s_argv0; +atomic_t g_start_games_fullscreen = false; + extern thread_local std::string(*g_tls_log_prefix)(); extern thread_local std::string_view g_tls_serialize_name; @@ -274,6 +276,7 @@ constexpr auto arg_commit_db = "get-commit-db"; // Arguments that can be used with a gui application constexpr auto arg_no_gui = "no-gui"; +constexpr auto arg_fullscreen = "fullscreen"; // only useful with no-gui constexpr auto arg_high_dpi = "hidpi"; constexpr auto arg_rounding = "dpi-rounding"; constexpr auto arg_styles = "styles"; @@ -624,6 +627,7 @@ int main(int argc, char** argv) const QCommandLineOption version_option = parser.addVersionOption(); parser.addOption(QCommandLineOption(arg_headless, "Run RPCS3 in headless mode.")); parser.addOption(QCommandLineOption(arg_no_gui, "Run RPCS3 without its GUI.")); + parser.addOption(QCommandLineOption(arg_fullscreen, "Run games in fullscreen mode. Only used when no-gui is set.")); parser.addOption(QCommandLineOption(arg_high_dpi, "Enables Qt High Dpi Scaling.", "enabled", "1")); parser.addOption(QCommandLineOption(arg_rounding, "Sets the Qt::HighDpiScaleFactorRoundingPolicy for values like 150% zoom.", "rounding", "4")); parser.addOption(QCommandLineOption(arg_styles, "Lists the available styles.")); @@ -927,6 +931,12 @@ int main(int argc, char** argv) } s_no_gui = parser.isSet(arg_no_gui); + g_start_games_fullscreen = parser.isSet(arg_fullscreen); + + if (g_start_games_fullscreen && !s_no_gui) + { + report_fatal_error(fmt::format("The option '%s' can only be used in combination with '%s'.", arg_fullscreen, arg_no_gui)); + } if (auto gui_app = qobject_cast(app.data())) { diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 33cecd47bc..5e66f20ff1 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -50,6 +50,7 @@ extern atomic_t g_user_asked_for_recording; extern atomic_t g_user_asked_for_screenshot; extern atomic_t g_user_asked_for_frame_capture; extern atomic_t g_disable_frame_limit; +extern atomic_t g_start_games_fullscreen; extern atomic_t g_recording_mode; atomic_t g_game_window_focused = false; @@ -610,7 +611,7 @@ void gs_frame::show() Emu.CallFromMainThread([this]() { QWindow::show(); - if (g_cfg.misc.start_fullscreen) + if (g_cfg.misc.start_fullscreen || g_start_games_fullscreen) { setVisibility(FullScreen); }