Fix power button leak on startup
This commit is contained in:
@@ -48,6 +48,10 @@ int clampPercent(int percent) {
|
||||
void EpubReaderActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
|
||||
// Drop any input events that arrived from the activity that launched us (e.g. a wake-up power
|
||||
// button hold) before they reach detectPageTurn() — see ReaderUtils::InputDrainGuard.
|
||||
inputDrainGuard.arm();
|
||||
|
||||
if (!epub) {
|
||||
return;
|
||||
}
|
||||
@@ -118,6 +122,10 @@ void EpubReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (inputDrainGuard.shouldDrain(mappedInput)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (automaticPageTurnActive) {
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Back)) {
|
||||
|
||||
Reference in New Issue
Block a user