Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Source/Core/DolphinQt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ void MainWindow::FullScreen()

if (was_fullscreen)
{
ShowRenderWidget();
ShowRenderWidget(was_fullscreen);
}
else
{
Expand Down Expand Up @@ -1191,7 +1191,8 @@ void MainWindow::StartGame(std::unique_ptr<BootParameters>&& parameters)
}

// 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.
if (!BootManager::BootCore(m_system, std::move(parameters),
Expand Down Expand Up @@ -1239,7 +1240,7 @@ void MainWindow::SetFullScreenResolution(bool fullscreen)
#endif
}

void MainWindow::ShowRenderWidget()
void MainWindow::ShowRenderWidget(const bool was_fullscreen)
{
SetFullScreenResolution(false);
Host::GetInstance()->SetRenderFullscreen(false);
Expand All @@ -1254,7 +1255,10 @@ void MainWindow::ShowRenderWidget()
m_stack->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
m_stack->repaint();

Host::GetInstance()->SetRenderFocus(isActiveWindow());
const bool focus = was_fullscreen || isActiveWindow();
Host::GetInstance()->SetRenderFocus(focus);
if (focus)
m_render_widget->activateWindow();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class MainWindow final : public QMainWindow
void StartGame(const std::vector<std::string>& paths,
std::unique_ptr<BootSessionData> boot_session_data = nullptr);
void StartGame(std::unique_ptr<BootParameters>&& parameters);
void ShowRenderWidget();
void ShowRenderWidget(bool was_fullscreen);
void HideRenderWidget(bool reinit = true, bool is_exit = false);

void ShowSettingsWindow();
Expand Down