talonvoice / beta

Issue tracker for the private Talon Beta
10 stars 0 forks source link

Invalid python in @imggui.open causes infinite loop and host UI doesn't respond to mouse input #85

Closed hbk619 closed 3 years ago

hbk619 commented 4 years ago

OS: Windows Talon version: Talon Version: 0.0.8.29-1369-g9618e8f Expected behaviour: An error to be logged once and the mouse to continue to function

If you have a runtime error in the Python of a method annotated with @imggui.open then Talon logs the error and loops infinitely, trying to draw the GUI, and blocks the UI from having mouse input (clicking other windows etc does nothing). Saying a command that will hide the GUI you're trying to draw or using the keyboard to open Powershell as admin and killing Talon seems to be the only ways to get the mouse responding again.

For example, I got the syntax wrong for looping a dictionary resulting in "too many values to unpack" with the stack trace below after modifying https://github.com/knausj85/knausj_talon/blob/master/code/switcher.py#L81 and saying "list running"

2020-06-29 14:48:29 ERROR cb error topic="draw" cb=<bound method GUI._draw_event of <talon.imgui.GUI object at 0x000000000B304E08>>
   11:                                  talon\canvas.py:16 |
   10:                                  talon\canvas.py:152|
    9:                      talon\scripting\dispatch.py:133|
    8:                      talon\scripting\dispatch.py:126|
    7:                          talon\scripting\rctx.py:201|
    6: ----------------------------------------------------# 'draw' user.talon_new_api_starter_pack.code.switcher:_draw_event()
    5: ----------------------------------------------------# stack splice
    4:                          talon\scripting\rctx.py:199|
    3:                                   talon\imgui.py:765|
    2:                                   talon\imgui.py:756|
    1: user\talon_new_api_starter_pack\code\switcher.py:81 | for k, line in  ctx.lists['self.running']:
lunixbochs commented 3 years ago

fixed in next beta, imgui will now hide itself on exception instead of attempting to draw further