FIX: stop video when not visible

Change-Id: Ibc5204084efec5381a7ede9face0519276592aa8
This commit is contained in:
chunmao.guo authored and Lane.Wei committed 2022-09-02 13:16:54 +08:00
1 parent 08c9385383
commit 4601022aaa
3 files changed
+15 -3

No files matched your search

+2 -1
View File
@@ -146,9 +146,10 @@ MediaFilePanel::MediaFilePanel(wxWindow * parent)
m_button_delete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &e) { m_image_grid->DoActionOnSelection(0); });
auto onShowHide = [this](auto &e) {
e.Skip();
if (m_isBeingDeleted) return;
auto fs = m_image_grid ? m_image_grid->GetFileSystem() : nullptr;
if (fs) e.IsShown() && IsShown() ? fs->Start() : fs->Stop();
if (fs) IsShownOnScreen() ? fs->Start() : fs->Stop();
};
Bind(wxEVT_SHOW, onShowHide);
parent->GetParent()->Bind(wxEVT_SHOW, onShowHide);