Introduce extended button handler

This commit is contained in:
jpirnay
2026-04-26 12:26:29 +02:00
parent 499702a754
commit a1d0ddec49
19 changed files with 833 additions and 33 deletions
+8
View File
@@ -154,6 +154,7 @@ void ActivityManager::loop() {
// Arm input drain so the button that triggered the pop doesn't bleed into the
// restored activity (or into a new activity the handler just pushed).
drainInput = true;
buttonEvents.drain();
// Request an update to ensure the popped activity gets re-rendered
if (pendingAction == PendingAction::None) {
@@ -204,6 +205,7 @@ void ActivityManager::loop() {
// Arm input drain so the button that triggered the transition doesn't bleed
// into the new activity.
drainInput = true;
buttonEvents.drain();
// onEnter may request another pending action, we will handle it in the next loop iteration
continue;
@@ -387,6 +389,12 @@ bool ActivityManager::isReaderActivity() const { return currentActivity && curre
bool ActivityManager::skipLoopDelay() const { return currentActivity && currentActivity->skipLoopDelay(); }
void ActivityManager::dispatchButtonAction(const CrossPointSettings::BUTTON_ACTION action) {
if (currentActivity) {
currentActivity->onButtonAction(action);
}
}
void ActivityManager::requestUpdate(bool immediate) {
if (immediate) {
if (renderTaskHandle) {