Skip to content

Commit ed796ee

Browse files
jasaavedF0bes
authored andcommitted
Qt: Fix Exclusive Fullscreen Mode Saving to Config
Add a variable to keep track if the window was in exclusive fullscreen. This helps prevent saving geometry to config which is for windows rendered separate from main. The variable is set back to false when render window is released.
1 parent b1962d2 commit ed796ee

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

pcsx2-qt/MainWindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,7 @@ std::optional<WindowInfo> MainWindow::acquireRenderWindow(bool recreate_window,
25382538
return std::nullopt;
25392539
}
25402540

2541+
m_display_is_exclusive_fullscreen = g_emu_thread->isExclusiveFullscreen();
25412542
g_emu_thread->connectDisplaySignals(m_display_surface);
25422543

25432544
updateWindowTitle();
@@ -2709,6 +2710,7 @@ void MainWindow::releaseRenderWindow()
27092710
// Now we can safely destroy the display window.
27102711
destroyDisplayWidget(true);
27112712
m_display_created = false;
2713+
m_display_is_exclusive_fullscreen = false;
27122714

27132715
m_ui.actionViewSystemDisplay->setEnabled(false);
27142716
m_ui.actionFullscreen->setEnabled(false);
@@ -2719,7 +2721,7 @@ void MainWindow::destroyDisplayWidget(bool show_game_list)
27192721
if (!m_display_surface)
27202722
return;
27212723

2722-
if (!m_display_surface->isFullScreen() && !isRenderingToMain())
2724+
if (!(m_display_surface->isFullScreen() || m_display_is_exclusive_fullscreen) && !isRenderingToMain())
27232725
saveDisplayWindowGeometryToConfig();
27242726

27252727
if (isRenderingToMain())

pcsx2-qt/MainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ private Q_SLOTS:
317317
QMenu* m_settings_toolbar_menu = nullptr;
318318

319319
bool m_display_created = false;
320+
bool m_display_is_exclusive_fullscreen = false;
320321
bool m_relative_mouse_mode = false;
321322
bool m_hide_mouse_cursor = false;
322323
bool m_was_paused_on_surface_loss = false;

0 commit comments

Comments
 (0)