waveshare: fix focusgroup handling

This commit is contained in:
Thomas Farstrike
2025-10-08 18:23:35 +02:00
parent c70780d490
commit aea5f7a4cf
6 changed files with 19 additions and 15 deletions
+3 -3
View File
@@ -335,9 +335,9 @@ class ActivityNavigator:
activity._result_callback = result_callback # Pass callback to activity
start_time = utime.ticks_ms()
# Remove objects from previous screens from the focus group:
group = lv.group_get_default()
if group: # on esp32 this may not be set
group.remove_all_objs() # might be better to save and restore the group for "back" actions
focusgroup = lv.group_get_default()
if focusgroup: # on esp32 this may not be set
focusgroup.remove_all_objs() # might be better to save and restore the group for "back" actions
activity.onCreate()
end_time = utime.ticks_diff(utime.ticks_ms(), start_time)
print(f"apps.py _launch_activity: activity.onCreate took {end_time}ms")
+3 -3
View File
@@ -10,9 +10,9 @@ def get():
def paste_text(text): # called when CTRL-V is pressed on the keyboard
print(f"mpos.ui.clipboard.py paste_text adding {text}")
group = lv.group_get_default()
if not group:
focusgroup = lv.group_get_default()
if not focusgroup:
return
focused_obj = group.get_focused()
focused_obj = focusgroup.get_focused()
if focused_obj and isinstance(focused_obj, lv.textarea):
focused_obj.add_text(text)