Merge pull request #555 from placroix74/screensaver-consume-input

[ScreenSaver] Consume input on cancel
This commit is contained in:
Jools Wills 2019-04-09 05:14:02 +01:00 committed by GitHub
commit 289d89aad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 33 deletions

View file

@ -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"))
{
@ -430,7 +427,7 @@ void Window::startScreenSaver()
}
}
void Window::cancelScreenSaver()
bool Window::cancelScreenSaver()
{
if (mScreenSaver && mRenderScreenSaver)
{
@ -441,7 +438,11 @@ void Window::startScreenSaver()
// Tell the GUI components the screensaver has stopped
for(auto i = mGuiStack.cbegin(); i != mGuiStack.cend(); i++)
(*i)->onScreenSaverDeactivate();
return true;
}
return false;
}
void Window::renderScreenSaver()

View file

@ -74,7 +74,7 @@ public:
inline void stopInfoPopup() { if (mInfoPopup) mInfoPopup->stop(); };
void startScreenSaver();
void cancelScreenSaver();
bool cancelScreenSaver();
void renderScreenSaver();
private: