From 4e9c1361bed8487d10fb6559160c50153612ba20 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 27 Sep 2020 13:14:50 +0200 Subject: [PATCH] Fixed two additional instances where video would start playing when it shouldn't. --- USERGUIDE.md | 2 +- es-app/src/guis/GuiMetaDataEd.cpp | 7 +++++-- es-core/src/Window.cpp | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/USERGUIDE.md b/USERGUIDE.md index 7ba0cc083..679408645 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -911,7 +911,7 @@ A statistics counter that counts how many times you're played the game. You norm ### Buttons -For game files, there will be four buttons displayed on the bottom of the metadata editor window, and for folders there will be three buttons. These are their functions: +For game files, there will be five buttons displayed on the bottom of the metadata editor window, and for folders there will be four. These are their functions: **Scrape** diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index c6493a21a..9fd0c34ac 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -248,8 +248,11 @@ GuiMetaDataEd::GuiMetaDataEd( buttons.push_back(std::make_shared(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this))); - buttons.push_back(std::make_shared(mWindow, "SAVE", "save metadata", - [&] { save(); delete this; })); + buttons.push_back(std::make_shared(mWindow, "SAVE", "save metadata", [&] { + save(); + ViewController::get()->onPauseVideo(); + delete this; + })); buttons.push_back(std::make_shared(mWindow, "CANCEL", "cancel changes", [&] { delete this; })); diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 3cbee9b2f..45c07f2a4 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -604,8 +604,12 @@ bool Window::cancelScreenSaver() mScreenSaver->resetCounts(); // Tell the GUI components the screensaver has stopped. - for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) + for (auto it = mGuiStack.cbegin(); it != mGuiStack.cend(); it++) { (*it)->onScreenSaverDeactivate(); + // If the menu is open, pause the video so it won't start playing beneath the menu. + if (mGuiStack.front() != mGuiStack.back()) + (*it)->onPauseVideo(); + } mSaturationAmount = 1.0; mDimValue = 1.0;