-
Notifications
You must be signed in to change notification settings - Fork 22
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
Kojo gets stuck in fullscreen in MacOS #21
Comments
Ok, thanks to my son playing with Kojo, and his sharper observational skills (there is nothing like being 10! :-), we now suspect it is the "Clear" command in the context menu of the canvas that caused this. Once we click on it, the onKeyPress stops working. |
Once you do a clear, all event handlers are gone. So that part seems to be working as expected. btw, the code fragment above is missing stuff. It does not compile... |
The full code below. I will have to get back to reproducing it.. (I wasn't too eager as I need to reboot the mac again to get out of it if I can successfully reproduce it :-)
|
Played with it quite a bit, but, couldn't reproduce it :-( Upon second thought, I don't think it is the "Clear" command in the context menu of the canvas. I distinctly remember seeing the triangles during the full-screen that got stuck. I suspect that it is one of the other commands in the context menu, as I think I remember that the event loop froze first and then I switched to full-screen. But, I can't be sure. When the event loop didn't respond to any keyboard event during the freeze, it didn't respond to mouse click events either. The triangulation didn't change despite many mouse clicks and keyboard events... But, I was also changing the Kojo script, especially the onKeyPress part.. |
Ok, let me know if you run into this again (I am also unable to reproduce the problem). |
I will! Bug in OS is very likely as this happened soon after the OS was upgraded to BigSur. Bunch of other stuff had some crashes (e.g., tkdiff/tcl/wish) and even the kojo exec script in the package (from makezip.sh) had issues. |
I had another encounter with this issue. This time, there was an infinite loop nested within onMouseClick { ... }. The escape key becomes inactive, I believe. No other key (Cmd/Ctrl etc.) in MacOS had any effect and I had to reboot the machine again. Just try it with while(true) {} within onMouseClick { ... } and click on the button. If it doesn't reproduce for you, I will re-produce on my end and submit the code/stack trace. Please let me know. |
If you put an infinite loop in a GUI thread callback, the Kojo GUI will freeze. That is the expected behavior. On Linux, after freezing Kojo via the above method, I can go (for example) to the terminal and kill the frozen Kojo process. |
I agree 100%. The issue is a problem only in fullscreen mode in MacOS where none of the keys like Esc or Cmd-Tab work to switch to another window like terminal or even bring up the Force-Stop program. So, yes, there is no freezing, but, there doesn't seem to be any way to get out of fullscreen. I suspect this won't happen in Windows due to Ctrl-Alt-Delete interrupt to fullscreen which brings up the task manager... Or in Linux where a similar interrupt (maybe Ctrl-C or Ctrl-D) is likely to work.. |
Yes. On Linux (in fullscreen mode), you can just Alt-Tab to switch away or run a keyboard shortcut to open a terminal. |
Here is what I just confirmed in MacOS (Version 11.1, Big Sur):
Is it Kojo that disables Cmd-Tab functionality in full-screen mode? I checked some other apps and even in full-screen Cmd-Tab works. It is also interesting and may provide a hint that Cmd-Shift-3 (screen capture) does work in full-screen, but the related Cmd-Shift-4 (screen capture with interactive bounding box) does not. Just to note, they both work in non-full screen mode as expected even when the focus is in the canvas. Finally, please also note that when all of Kojo is switched to full-screen (using the green dot on the upper left of every macOs window), Cmd-Tab works. Only when we get into Full-Screen Canvas mode, Cmd-Tab is disabled. |
Nope. Alt-Tab works fine to switch away on Linux. |
It might be helpful to know that Cmd-Option-Esc combo forcibly quits Kojo when Kojo is in fullscreen mode. This saves a reboot for me when JVM is stuck. That's at least the case in MacOS v11.4 (Big Sur). In non-fullscreen, the same combo brings up the "Force Quit Applications" window. |
Had to reboot the macbook. No key or key combo worked. Esc, Cmd-Tab, Cmd-Ctr-F.
The code that's the culprit is rather simple (see below).
It worked fine until I switched to full screen and then back, turned on the axes (not sure that's relevant, but just to capture the sequence of events. I will write again after root-causing this), turned the axes off again and the keys (defined below) stopped working. I then switch it to full screen using the context menu (stupid thing to do, but, that's hindsight for you :-) and got stuck. Now that I captured this so far, let me try to reproduce it. Wish me luck.
The text was updated successfully, but these errors were encountered: