From 6f43f8eef5a0340a4aa60998fc94da11a660d0fb Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 17 Aug 2025 13:33:40 -0700 Subject: [PATCH 1/3] FIFOPlayerWindow: Add stretch to Play/Record tab --- Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp index 5dfd10b547..f271bca7d7 100644 --- a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp +++ b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp @@ -168,6 +168,7 @@ void FIFOPlayerWindow::CreateWidgets() layout->addWidget(info_group); layout->addWidget(playback_group); layout->addWidget(recording_group); + layout->addStretch(); layout->addWidget(m_button_box); m_main_widget = new QWidget(this); From 99be30c0e15694031ec094549b3f84d3b5a9c3eb Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 17 Aug 2025 13:36:29 -0700 Subject: [PATCH 2/3] FIFOPlayerWindow: Trigger destructor on Dolphin shutdown Make MainWindow::m_fifo_window a unique_ptr to ensure its destructor is triggered when MainWindow is destroyed. FIFOPlayerWindow doesn't set MainWindow as its parent in order to prevent raising MainWindow when focusing FIFOPlayerWindow. This avoids MainWindow covering up RenderWidget when, e.g., trying to use the object range feature to pinpoint the index of a particular object. As a consequence, unlike most QObjects FIFOPlayerWindow wasn't destroyed when its parent widget was since it didn't have one. --- Source/Core/DolphinQt/MainWindow.cpp | 4 ++-- Source/Core/DolphinQt/MainWindow.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 488ca8ecd6..a8e4e0764d 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -1379,8 +1379,8 @@ void MainWindow::ShowFIFOPlayer() { if (!m_fifo_window) { - m_fifo_window = new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder()); - connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this, + m_fifo_window.reset(new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder())); + connect(m_fifo_window.get(), &FIFOPlayerWindow::LoadFIFORequested, this, [this](const QString& path) { StartGame(path, ScanForSecondDisc::No); }); } diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index d648e6189c..38250058ed 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -16,6 +16,7 @@ #endif // USE_RETRO_ACHIEVEMENTS #include "Core/Boot/Boot.h" +#include "DolphinQt/FIFO/FIFOPlayerWindow.h" class QMenu; class QStackedWidget; @@ -29,7 +30,6 @@ class CheatsManager; class CodeWidget; class DiscordHandler; class DragEnterEvent; -class FIFOPlayerWindow; class FreeLookWindow; class GameList; class GBATASInputWindow; @@ -245,7 +245,9 @@ private: std::unique_ptr m_pending_boot; SettingsWindow* m_settings_window = nullptr; - FIFOPlayerWindow* m_fifo_window = nullptr; + // m_fifo_window doesn't set MainWindow as its parent so that the fifo can be focused without + // raising the main window, so use a unique_ptr to make sure it gets destroyed. + std::unique_ptr m_fifo_window = nullptr; SkylanderPortalWindow* m_skylander_window = nullptr; InfinityBaseWindow* m_infinity_window = nullptr; WiiSpeakWindow* m_wii_speak_window = nullptr; From 1841c151c4e9d361ee29797952d2e98933423bc2 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 17 Aug 2025 13:44:13 -0700 Subject: [PATCH 3/3] FIFOPlayerWindow: Save and restore window geometry Aside from allowing users to persistently set the window to their desired size, this is also necessary to allow saving of the splitter positions in FIFOAnalyzer to work correctly. --- Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp index f271bca7d7..d1309d709f 100644 --- a/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp +++ b/Source/Core/DolphinQt/FIFO/FIFOPlayerWindow.cpp @@ -83,6 +83,8 @@ FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_r FIFOPlayerWindow::~FIFOPlayerWindow() { + Settings::GetQSettings().setValue(QStringLiteral("fifoplayerwindow/geometry"), saveGeometry()); + m_fifo_player.SetFileLoadedCallback({}); m_fifo_player.SetFrameWrittenCallback({}); } @@ -189,6 +191,9 @@ void FIFOPlayerWindow::CreateWidgets() void FIFOPlayerWindow::LoadSettings() { + restoreGeometry( + Settings::GetQSettings().value(QStringLiteral("fifoplayerwindow/geometry")).toByteArray()); + m_early_memory_updates->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES)); m_loop->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY)); }