mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Merge pull request #555 from placroix74/screensaver-consume-input
[ScreenSaver] Consume input on cancel
This commit is contained in:
commit
289d89aad1
|
@ -140,10 +140,6 @@ void Window::input(InputConfig* config, Input input)
|
|||
mSleeping = true;
|
||||
}
|
||||
}
|
||||
/*else if(input.value != 0)
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,7 +154,8 @@ void Window::input(InputConfig* config, Input input)
|
|||
}
|
||||
|
||||
mTimeSinceLastInput = 0;
|
||||
cancelScreenSaver();
|
||||
if (cancelScreenSaver())
|
||||
return;
|
||||
|
||||
if(config->getDeviceId() == DEVICE_KEYBOARD && input.value && input.id == SDLK_g && SDL_GetModState() & KMOD_LCTRL && Settings::getInstance()->getBool("Debug"))
|
||||
{
|
||||
|
@ -418,34 +415,38 @@ bool Window::isProcessing()
|
|||
}
|
||||
|
||||
void Window::startScreenSaver()
|
||||
{
|
||||
if (mScreenSaver && !mRenderScreenSaver)
|
||||
{
|
||||
// Tell the GUI components the screensaver is starting
|
||||
for(auto i = mGuiStack.cbegin(); i != mGuiStack.cend(); i++)
|
||||
(*i)->onScreenSaverActivate();
|
||||
{
|
||||
if (mScreenSaver && !mRenderScreenSaver)
|
||||
{
|
||||
// Tell the GUI components the screensaver is starting
|
||||
for(auto i = mGuiStack.cbegin(); i != mGuiStack.cend(); i++)
|
||||
(*i)->onScreenSaverActivate();
|
||||
|
||||
mScreenSaver->startScreenSaver();
|
||||
mRenderScreenSaver = true;
|
||||
}
|
||||
}
|
||||
mScreenSaver->startScreenSaver();
|
||||
mRenderScreenSaver = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Window::cancelScreenSaver()
|
||||
{
|
||||
if (mScreenSaver && mRenderScreenSaver)
|
||||
{
|
||||
mScreenSaver->stopScreenSaver();
|
||||
mRenderScreenSaver = false;
|
||||
mScreenSaver->resetCounts();
|
||||
bool Window::cancelScreenSaver()
|
||||
{
|
||||
if (mScreenSaver && mRenderScreenSaver)
|
||||
{
|
||||
mScreenSaver->stopScreenSaver();
|
||||
mRenderScreenSaver = false;
|
||||
mScreenSaver->resetCounts();
|
||||
|
||||
// Tell the GUI components the screensaver has stopped
|
||||
for(auto i = mGuiStack.cbegin(); i != mGuiStack.cend(); i++)
|
||||
(*i)->onScreenSaverDeactivate();
|
||||
}
|
||||
}
|
||||
// Tell the GUI components the screensaver has stopped
|
||||
for(auto i = mGuiStack.cbegin(); i != mGuiStack.cend(); i++)
|
||||
(*i)->onScreenSaverDeactivate();
|
||||
|
||||
void Window::renderScreenSaver()
|
||||
{
|
||||
if (mScreenSaver)
|
||||
mScreenSaver->renderScreenSaver();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Window::renderScreenSaver()
|
||||
{
|
||||
if (mScreenSaver)
|
||||
mScreenSaver->renderScreenSaver();
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
inline void stopInfoPopup() { if (mInfoPopup) mInfoPopup->stop(); };
|
||||
|
||||
void startScreenSaver();
|
||||
void cancelScreenSaver();
|
||||
bool cancelScreenSaver();
|
||||
void renderScreenSaver();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue