talonvoice / beta

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

Windows - context issues #4

Closed mrob95 closed 4 years ago

mrob95 commented 4 years ago

Two probably unrelated issues.

  1. Every time on start-up and every so often during use I get the following error:
    
    2019-12-27 11:59:18    IO Traceback (most recent call last):

2019-12-27 11:59:18 IO File "talon\windows\winevents.py", line 118, in WinEventProc

2019-12-27 11:59:18 IO File "talon\windows\winevents.py", line 160, in WinEventProc

2019-12-27 11:59:18 IO pywintypes.error: (1400, 'GetWindowRect', 'Invalid window handle.')

2019-12-27 11:59:18 IO Traceback (most recent call last):

2019-12-27 11:59:18 IO File "talon\windows\winevents.py", line 118, in WinEventProc

2019-12-27 11:59:18 IO File "talon\windows\winevents.py", line 160, in WinEventProc

2019-12-27 11:59:18 IO pywintypes.error: (1400, 'GetWindowRect', 'Invalid window handle.')

The handle is always 1400.

2. Using the following context, and a few other similar ones,

ctx = Context("code", func=lambda app, win: 'Code.exe' in app.exe)


I quite often get error messages like this:

2019-12-27 11:59:35 ERROR cb error topic="scope" cb=<bound method Scope._matches of <talon.scripting.scope.Scope object at 0x0000000006E90408>> 33: /threading.py:890| 32: /threading.py:926| 31: /threading.py:870| 30: talon\windows\winevents.py:139| 29: talon\windows\winevents.py:118| 28: talon\windows\winevents.py:165| 27: talon\scripting\dispatch.py:92 | 26: talon\scripting\dispatch.py:126| 25: talon\scripting\dispatch.py:118| 24: talon\scripting\rctx.py:168| 23: talon\windows\ui.py:67 | 22: talon\scripting\dispatch.py:92 | 21: talon\scripting\dispatch.py:126| 20: talon\scripting\dispatch.py:118| 19: talon\scripting\rctx.py:168| 18: talon\scripting\scope.py:25 | 17: talon\scripting\dispatch.py:92 | 16: talon\scripting\dispatch.py:126| 15: talon\scripting\dispatch.py:120| 14: talon\scripting\rctx.py:168| 13: talon\scripting\scope.py:109| 12: talon\scripting\dispatch.py:92 | 11: talon\scripting\dispatch.py:126| 10: talon\scripting\dispatch.py:120| 9: talon\scripting\rctx.py:168| 8: talon\scripting\scope.py:41 | 7: talon\scripting\registry.py:210| 6: talon\scripting\registry.py:184| 5: talon\scripting\registry.py:184| 4: talon\scripting\context.py:172| 3: talon\scripting\context.py:172| 2: talon\scripting\scope.py:77 | 1: talon\scripting\rctx.py:170| [stack splice] 6: talon\scripting\rctx.py:168| 5: talon\scripting\scope.py:46 | 4: talon\scripting\match.py:122| 3: talon\scripting\match.py:88 | 2: talon\legacy\voice.py:90 | 1: user\apps\vscode.py:4 | ctx = Context("code", func=lambda app,.. TypeError: argument of type 'NoneType' is not iterable



Commands will fail to activate for that context, though usually if I click away to a different window and then back again it will work fine.
lunixbochs commented 4 years ago

Please confirm whether this issue persists on the latest beta, as there were some fixes around both of these errors recently.

mrob95 commented 4 years ago

Have been testing today and contexts are working fine in the latest version. Still getting the IO stuff in the log but isn't causing any actual issues. Thanks!

lunixbochs commented 4 years ago

IO just means a print() was redirected to the log, are you only referring to GetWindowRect errors? If so, can you take a quick look and see which lines in winevents.py it's coming from now? (There might be more than one place)

mrob95 commented 4 years ago

On version 884 they are still coming from lines 118 and 160 in winevents.py

lunixbochs commented 4 years ago

fixed in 962