From 9abf8d5ab811bf8f14a481a3334acf880bb7a7e5 Mon Sep 17 00:00:00 2001
From: Sebastian Krzyszkowiak <dos@dosowisko.net>
Date: Sun, 10 Sep 2023 16:15:30 +0200
Subject: [PATCH] py,st3m: MenuController: Don't handle input when the view
 isn't active

Fixes a bug with launching the application second time if the user
presses the button again during the transition. The bug has existed
before, but got much easier to trigger with ViewManager improvements.
---
 python_payload/st3m/ui/menu.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python_payload/st3m/ui/menu.py b/python_payload/st3m/ui/menu.py
index a502b69c36..4615b16fe8 100644
--- a/python_payload/st3m/ui/menu.py
+++ b/python_payload/st3m/ui/menu.py
@@ -203,6 +203,9 @@ class MenuController(BaseView):
 
         self._scroll_controller.think(ins, delta_ms)
 
+        if not self.is_active():
+            return
+
         target = self._scroll_controller.target_position()
 
         if self.input.buttons.app.middle.pressed:
-- 
GitLab