New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyglet's Window Display For Apple Silicon (M1, M2) Devices #1100
Comments
The were quite a few bugfixes that were backported, and I believe some changes to the text and font modules. There were also some fixes related to memory leaks and references. It might be necessary to do a git bisect to trace down the exact changes. The default behavior of the pyglet event loop is to exit when all Windows are closes. The can be overridden of course: https://github.com/pyglet/pyglet/blob/master/pyglet/app/base.py#L277 |
As a follow up just so we can get some alignment @benmoran56 , what I mean by saying "my program terminates", is that all subsequent code after the window is closed never gets executed because the process running the python snippet terminates. To make a more reproducible example for you to replicate try: running this snippet of code with pyglet version
Video: pyglet-1.5.28-error.mov |
I'm not sure we really support looping a I think when the loop terminates it will terminate the whole program for the alternate loop. Lines 184 to 186 in a728a77
You could try replacing it with this code instead: def nsapp_stop(self):
"""Used only for CocoaAlternateEventLoop"""
self.NSApp.stop_(None)
if self.timer:
self.timer.invalidate()
self.timer = None
if self.appdelegate:
self.appdelegate.dealloc()
self.appdelegate = None |
That's correct @caffeinepills the alternate loop never gets executed following a closure of the pyglet window after a
|
I have experienced the same. In my case, the error message tells me that all Python threads are terminated. Here is the error message: |
Background
I had a question regarding a strange Apple Silicon specific behavior I am facing when working with
pyglet
. I have noticed that if we usepyglet < 1.5.28
as a dependency fortrimesh
on Apple Silicon devices, after it runs ashow()
from trimesh which uses a class named SceneViewer that haspyglet <2.0
dependencies to show the screen, when you close out the popped up display window, it completely terminates the program. You can see it best represented in this video in our issues: BerkeleyLearnVerify/Scenic#230Some more information describing the behavior can be found on this issue from the trimesh side: mikedh/trimesh#2131
However when I downgrade the
pyglet
dependency to say 1.5.26 for trimesh, I am able to close out the opened display window and still have the program continue without crashing. This can be best illustrated by this video here: BerkeleyLearnVerify/Scenic#248Question?
Were there any implementation differences between
pyglet
1.5.26 and 1.5.28 that aren't reflected in the changelog regarding how to handle terminating a opened display window?The text was updated successfully, but these errors were encountered: