wgpu-py icon indicating copy to clipboard operation
wgpu-py copied to clipboard

Gui layer run() method does not return after closing window

Open Korijn opened this issue 3 years ago • 3 comments

Like the title says, closing a WgpuCanvas window does not cause the event loop to return, and thus run() to return. Should be pretty easy?

Korijn avatar May 24 '22 08:05 Korijn

As far as I can tell this is the (intended) behavior. What GUI backend does not do it this way?

almarklein avatar May 24 '22 10:05 almarklein

GLFW for example uses loop.run_forever() instead of loop.run_until_complete(...):

https://github.com/pygfx/wgpu-py/blob/e1987d044eaab480f03b08c2ed97e7f2faae8446/wgpu/gui/glfw.py#L514-L518

Korijn avatar May 24 '22 10:05 Korijn

But there is also a loop.stop right above. Could probably be refactored to use run_until_complete and remove the stop though.

almarklein avatar May 24 '22 11:05 almarklein

Looks like this has been fixed a while ago in #319.

almarklein avatar Oct 12 '23 19:10 almarklein