Qt: Fix -fullscreen command line parameter

This commit is contained in:
Connor McLaughlin 2022-12-19 23:30:22 +10:00
parent 11ecf2bb46
commit 52817d967b
2 changed files with 5 additions and 7 deletions

View file

@ -327,9 +327,9 @@ void EmuThread::loadSettings(SettingsInterface& si)
//
}
void EmuThread::setInitialState()
void EmuThread::setInitialState(std::optional<bool> override_fullscreen)
{
m_is_fullscreen = Host::GetBaseBoolSettingValue("Main", "StartFullscreen", false);
m_is_fullscreen = override_fullscreen.value_or(Host::GetBaseBoolSettingValue("Main", "StartFullscreen", false));
m_is_rendering_to_main = shouldRenderToMain();
m_is_surfaceless = false;
}
@ -451,10 +451,8 @@ void EmuThread::startFullscreenUI()
// we want settings loaded so we choose the correct renderer
// this also sorts out input sources.
System::LoadSettings(false);
setInitialState();
setInitialState(s_start_fullscreen_ui_fullscreen ? std::optional<bool>(true) : std::optional<bool>());
m_run_fullscreen_ui = true;
if (s_start_fullscreen_ui_fullscreen)
m_is_fullscreen = true;
if (!acquireHostDisplay(Settings::GetRenderAPIForRenderer(g_settings.gpu_renderer)))
{
@ -500,7 +498,7 @@ void EmuThread::bootSystem(std::shared_ptr<SystemBootParameters> params)
return;
}
setInitialState();
setInitialState(params->override_fullscreen);
if (!System::BootSystem(std::move(*params)))
return;

View file

@ -105,7 +105,6 @@ public:
bool shouldRenderToMain() const;
void loadSettings(SettingsInterface& si);
void setInitialState();
void checkForSettingsChanges(const Settings& old_settings);
void bootOrLoadState(std::string path);
@ -208,6 +207,7 @@ private:
void createBackgroundControllerPollTimer();
void destroyBackgroundControllerPollTimer();
void setInitialState(std::optional<bool> override_fullscreen);
void updateDisplayState();
QThread* m_ui_thread;