You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
fix esp32 run if there's no focus group
This commit is contained in:
@@ -346,7 +346,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:
|
||||
lv.group_get_default().remove_all_objs() # might be better to save and restore the group for "back" actions
|
||||
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
|
||||
activity.onCreate()
|
||||
end_time = utime.ticks_diff(utime.ticks_ms(), start_time)
|
||||
print(f"apps.py _launch_activity: activity.onCreate took {end_time}ms")
|
||||
|
||||
@@ -11,6 +11,8 @@ 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:
|
||||
return
|
||||
focused_obj = group.get_focused()
|
||||
if focused_obj and isinstance(focused_obj, lv.textarea):
|
||||
focused_obj.add_text(text)
|
||||
|
||||
Reference in New Issue
Block a user