From 5c4be5dd3bf261e6ee2747508df85fd14d9eb194 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 16 Jun 2026 01:28:19 +0200 Subject: [PATCH] Qt: stop movies when the main window gets inactive --- rpcs3/rpcs3qt/game_list_frame.cpp | 6 ++++++ rpcs3/rpcs3qt/game_list_frame.h | 10 ++++++---- rpcs3/rpcs3qt/main_window.cpp | 13 +++++++++++++ rpcs3/rpcs3qt/main_window.h | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 5308412072..9dfd6a940e 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -1237,6 +1237,12 @@ void game_list_frame::ShowCustomConfigIcon(const game_info& game) RepaintIcons(); } +void game_list_frame::stop_movie() +{ + if (m_game_list) m_game_list->stop_movie(); + if (m_game_grid) m_game_grid->stop_movie(); +} + void game_list_frame::ResizeIcons(int slider_pos) { m_icon_size_index = slider_pos; diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index 0659b350c8..775258d02d 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -56,10 +56,10 @@ public: void SetShowHidden(bool show); - content_integrity* GetIsoIntegrity() const { return m_iso_integrity; } - content_integrity* GetPsnContentIntegrity() const { return m_psn_content_integrity; } - content_integrity* GetPsnDlcIntegrity() const { return m_psn_dlc_integrity; } - content_integrity* GetPsnUpdateIntegrity() const { return m_psn_update_integrity; } + content_integrity* GetIsoIntegrity() const { return ensure(m_iso_integrity); } + content_integrity* GetPsnContentIntegrity() const { return ensure(m_psn_content_integrity); } + content_integrity* GetPsnDlcIntegrity() const { return ensure(m_psn_dlc_integrity); } + content_integrity* GetPsnUpdateIntegrity() const { return ensure(m_psn_update_integrity); } game_compatibility* GetGameCompatibility() const { return ensure(m_game_compat); } config_database* GetConfigDatabase() const { return ensure(m_config_db); } const std::vector& GetGameInfo() const { return m_game_data; } @@ -75,6 +75,8 @@ public: void ShowCustomConfigIcon(const game_info& game); + void stop_movie(); + // Enqueue slot for refreshed signal // Allowing for an individual container for each distinct use case (currently disabled and contains only one such entry) template diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 251b1d937f..d51c52e7b9 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -4100,6 +4100,19 @@ void main_window::closeEvent(QCloseEvent* closeEvent) Emu.Quit(true); } +void main_window::changeEvent(QEvent* event) +{ + if (event->type() == QEvent::ActivationChange) + { + if (m_game_list_frame && !isActiveWindow()) + { + m_game_list_frame->stop_movie(); + } + } + + QMainWindow::changeEvent(event); +} + /** Add valid disc games to gamelist (games.yml) @param paths = dir paths to scan for game diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index 0dcf48200d..19a85865a4 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -126,6 +126,7 @@ private Q_SLOTS: protected: void closeEvent(QCloseEvent *event) override; + void changeEvent(QEvent *event) override; void mouseDoubleClickEvent(QMouseEvent *event) override; void dropEvent(QDropEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override;