Replies: 3 comments 2 replies
-
I'll ask my former students about M1 experience, as I remember - the main problem was during install and java machine connection. |
Beta Was this translation helpful? Give feedback.
-
Hi ! Same problem with me (Mac mini M1, IDLE 3.13, py5). The graphics window pops behind the toplevel window, very annoying... |
Beta Was this translation helpful? Give feedback.
-
Recently I revisited py5 on macOS machines, both with Apple Silicon and Intel CPUs, and came up with a coding change that will significantly improve things for all macOS users. Consider the following code: def setup():
py5.size(500, 500)
def draw():
py5.rect(py5.mouse_x, py5.mouse_y, 10, 10)
def key_typed(e):
py5.println(f"key typed - key = {e.get_key()}")
py5.run_sketch() This will work well on Linux and Windows. It would work well on macOS if I used the
Previously I thought that these were three unrelated problems. This is not correct. It turns out, both number 1 and number 2 are symptoms of number 3. When the Sketch window does not appear on the dock, macOS does not consider the window to be something that is worthy of getting "focus." Calling Not being worthy of focus means the Sketch window can't receive key events. That's why I need to click on it repeatedly to get macOS to acknowledge that I really want to interact with the window. I figured all of this out because I noticed that if I ran the above code in Jupyter, I would experience problems 1, 2, and 3. But if I changed the renderer to Anyhow, the problem became how to get the The solution I came up with is as follows. On macOS, when you call One consequence is that when the logo appears on the taskbar, wherever you are typing loses focus. This isn't a problem if you are running a python script because you'd see focus going to the Sketch window anyway. When using Jupyter, it is a bit odd but is obviously manageable. It is certainly a minor issue compared to the above problems. I do think that this is a serious bug and want to get this fix out ASAP. I have finished testing the fix on apple silicon and on an intel mac and it works great for both of them. I do want to double check some things on Windows though - I can leverage what I learned over the past week to improve the code a bit. I also need to update the documentation. The Special Notes for MacOS users should be updated to reflect the improvements and changes described here. How does everyone feel about this change? @villares , do you see any problems with the py5 logo appearing on the taskbar when |
Beta Was this translation helpful? Give feedback.
-
Recently I bought a M1 MacOS machine.
The first thing I did is I followed the Thonny + py5 plugin install instructions, as found here:
https://github.com/tabreturn/thonny-py5mode
Everything worked perfectly. Both with the py5 plugin using imported mode and not using the plugin with module mode.
Next I wanted to setup my development environment so I could do development on this machine. I installed the ARM64 DMG Installer from here:
https://www.oracle.com/java/technologies/downloads/#jdk17-mac
(I also had to install brew, then use brew to install ant and make. Both are necessary to run the build.)
I was able to run the build. I can import py5 from a python terminal.
However, when I create a sketch and attempt to run it, it will work but if I use the default renderer the window will open up behind everything else. This is not the case when I use the P2D renderer.
I will open a bug for this but before I do that I wanted to ask if anyone else experienced this? And equally important, what are the current outstanding issues with MacOS on Apple Silicon? What can I do to investigate the known issues to make things better for others?
Beta Was this translation helpful? Give feedback.
All reactions