mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
Qt: Fix application exiting on fullscreen+lang change
This commit is contained in:
parent
66934cc5b8
commit
cdadda85b5
@ -737,8 +737,13 @@ void MainWindow::recreate()
|
|||||||
destroySubWindows();
|
destroySubWindows();
|
||||||
|
|
||||||
const bool was_display_created = m_display_created;
|
const bool was_display_created = m_display_created;
|
||||||
|
const bool was_fullscreen = (was_display_created && g_emu_thread->isFullscreen());
|
||||||
if (was_display_created)
|
if (was_display_created)
|
||||||
{
|
{
|
||||||
|
// Ensure the main window is visible, otherwise last-window-closed terminates the application.
|
||||||
|
if (!isVisible())
|
||||||
|
show();
|
||||||
|
|
||||||
g_emu_thread->setSurfaceless(true);
|
g_emu_thread->setSurfaceless(true);
|
||||||
QtUtils::ProcessEventsWithSleep(QEventLoop::ExcludeUserInputEvents,
|
QtUtils::ProcessEventsWithSleep(QEventLoop::ExcludeUserInputEvents,
|
||||||
[this]() { return (m_display_widget || !g_emu_thread->isSurfaceless()); });
|
[this]() { return (m_display_widget || !g_emu_thread->isSurfaceless()); });
|
||||||
@ -770,6 +775,8 @@ void MainWindow::recreate()
|
|||||||
if (was_display_created)
|
if (was_display_created)
|
||||||
{
|
{
|
||||||
g_emu_thread->setSurfaceless(false);
|
g_emu_thread->setSurfaceless(false);
|
||||||
|
if (was_fullscreen)
|
||||||
|
g_emu_thread->setFullscreen(true, true);
|
||||||
g_main_window->updateEmulationActions(false, s_system_valid, s_achievements_hardcore_mode);
|
g_main_window->updateEmulationActions(false, s_system_valid, s_achievements_hardcore_mode);
|
||||||
g_main_window->onFullscreenUIStartedOrStopped(s_fullscreen_ui_started);
|
g_main_window->onFullscreenUIStartedOrStopped(s_fullscreen_ui_started);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user