This commit is contained in:
Dentomologist 2026-03-17 15:48:34 -04:00 committed by GitHub
commit 47c9968b09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -1081,7 +1081,7 @@ void MainWindow::FullScreen()
if (was_fullscreen) if (was_fullscreen)
{ {
ShowRenderWidget(); ShowRenderWidget(was_fullscreen);
} }
else else
{ {
@ -1191,7 +1191,8 @@ void MainWindow::StartGame(std::unique_ptr<BootParameters>&& parameters)
} }
// We need the render widget before booting. // We need the render widget before booting.
ShowRenderWidget(); constexpr bool WAS_FULLSCREEN = false;
ShowRenderWidget(WAS_FULLSCREEN);
// Boot up, show an error if it fails to load the game. // Boot up, show an error if it fails to load the game.
if (!BootManager::BootCore(m_system, std::move(parameters), if (!BootManager::BootCore(m_system, std::move(parameters),
@ -1239,7 +1240,7 @@ void MainWindow::SetFullScreenResolution(bool fullscreen)
#endif #endif
} }
void MainWindow::ShowRenderWidget() void MainWindow::ShowRenderWidget(const bool was_fullscreen)
{ {
SetFullScreenResolution(false); SetFullScreenResolution(false);
Host::GetInstance()->SetRenderFullscreen(false); Host::GetInstance()->SetRenderFullscreen(false);
@ -1254,7 +1255,10 @@ void MainWindow::ShowRenderWidget()
m_stack->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); m_stack->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
m_stack->repaint(); m_stack->repaint();
Host::GetInstance()->SetRenderFocus(isActiveWindow()); const bool focus = was_fullscreen || isActiveWindow();
Host::GetInstance()->SetRenderFocus(focus);
if (focus)
m_render_widget->activateWindow();
} }
else else
{ {

View File

@ -163,7 +163,7 @@ private:
void StartGame(const std::vector<std::string>& paths, void StartGame(const std::vector<std::string>& paths,
std::unique_ptr<BootSessionData> boot_session_data = nullptr); std::unique_ptr<BootSessionData> boot_session_data = nullptr);
void StartGame(std::unique_ptr<BootParameters>&& parameters); void StartGame(std::unique_ptr<BootParameters>&& parameters);
void ShowRenderWidget(); void ShowRenderWidget(bool was_fullscreen);
void HideRenderWidget(bool reinit = true, bool is_exit = false); void HideRenderWidget(bool reinit = true, bool is_exit = false);
void ShowSettingsWindow(); void ShowSettingsWindow();