mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-18 03:11:11 +00:00
MainWindow: Fix focus leaving fullscreen with Render To Main Window
Fix loss of focus when leaving fullscreen mode with `Render To Main Window` enabled. This prevented controller inputs and hotkeys from working, and in particular prevented the user from going back to fullscreen with the hotkey.
This commit is contained in:
parent
66db206e34
commit
5346b23aec
@ -1081,7 +1081,7 @@ void MainWindow::FullScreen()
|
||||
|
||||
if (was_fullscreen)
|
||||
{
|
||||
ShowRenderWidget();
|
||||
ShowRenderWidget(was_fullscreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -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),
|
||||
@ -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);
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -163,7 +163,7 @@ private:
|
||||
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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user