Skip to content
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

On MacOS M1 machines, the default renderer opens the Sketch window behind other windows #564

Open
hx2A opened this issue Nov 23, 2024 · 3 comments

Comments

@hx2A
Copy link
Collaborator

hx2A commented Nov 23, 2024

As discussed in #562 , the following code opens the Sketch window behind the terminal window.

import py5

def setup():
    py5.size(100,30)
    global x,y
    (x,y) = (0,15)
    
def draw():
    global x
    x = x + 1
    py5.ellipse(x,y,10,10)
    if x > 100 : py5.no_loop()

py5.run_sketch()

Workarounds are to use the P2D renderer or to call py5.get_surface().set_always_on_top(True). This should work correctly though.

@wissme
Copy link

wissme commented Nov 23, 2024

py5.get_surface().set_always_on_top(True) works fine, thanks.
Using py5.size(100,100,py5.P2D) --> Python crash !!
Mac mini M1

@hx2A
Copy link
Collaborator Author

hx2A commented Nov 23, 2024

py5.get_surface().set_always_on_top(True) works fine, thanks. Using py5.size(100,100,py5.P2D) --> Python crash !! Mac mini M1

So, same code as above, but with the P2D renderer, in the generic python interpreter causes py5 to crash? I will look into this further later today.

@wissme
Copy link

wissme commented Nov 24, 2024

Let me refine my sketch. After execution in IDLE 3.13 on a Mac mini M1 (MacOS 14.7), I can see "End!" so the sketch has terminated. The python shell is blocked (acceptable). Now I close the sketch window with the mouse click. The window closes, 'End' is NOT written at the Python shell, which his still blocked. I must restart the shell manually. I tried with Spyder 6.0.2 app on Mac, installed spyder-kernels=3.0, opened a console in py5 env and it's ok, the py5 env. console is not blocked even during the sketch (with 'End' coming immediately !). So the problem may be tied to IDLE 3.13 ? I use both IDLE and Spyder for a book in preparation... Hum, I notice that if I do not close the sketch window and quit Spyder app (yeah bad), the Spyder app hangs, I must force kill it :-( The app is killed BUT the sketch window is still here, with the diabolic wheel turning, impossible to force quit. Gasp. Maybe test a bit more on Mac ARM machines ?...

%gui osx            # for Spyder 6.0.2 IPython

import py5         # 0.10.3a1

def setup():
    py5.size(100,100)
    py5.get_surface().set_always_on_top(True)    # ok but I hope this will be fixed :-)
    global x,y
    (x,y) = (0,50)
    
def draw():
    global x
    x = x + 1
    py5.ellipse(x,y,20,20)
    if x > 100 : py5.no_loop()

py5.run_sketch()
print('End')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants