hyprland-community / pyprland

Scratchpads & many goodies for Hyprland [maintainer=@fdev31]
MIT License
390 stars 17 forks source link

activewindow can return an empty result, crashing pypr #41

Closed pdf closed 9 months ago

pdf commented 10 months ago

Need some guards around these cast values (and probably anywhere else this assumption is made).

expose::run_expose(()) failed:
'address'
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyprland/command.py", line 119, in _run_plugin_handler
    await getattr(plugin, full_name)(*params)
  File "/usr/lib/python3.11/site-packages/pyprland/plugins/expose.py", line 44, in run_expose
    focused_addr = aw["address"]
                   ~~^^^^^^^^^^^
KeyError: 'address'
expose::run_expose(()) failed:
'address'
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyprland/command.py", line 119, in _run_plugin_handler
    await getattr(plugin, full_name)(*params)
  File "/usr/lib/python3.11/site-packages/pyprland/plugins/expose.py", line 44, in run_expose
    focused_addr = aw["address"]
                   ~~^^^^^^^^^^^
KeyError: 'address'

When this happened during expose I had to manually move all my windows back to their original workspaces from the expose workspace.

fdev31 commented 10 months ago

I don't think it's expected that a window have no address, I'll have a look at this code to see how to make it more robust. Thank you for the report!