# \[Workaround\] Full\_screen() is not working (py5 in VS Code on MacOs)

**URL:** <https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498>\
**Category:** py5\
**Created:** [June 3, 2025, 3:12pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498 "2025-06-03T15:12:13Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bcome](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bcome/32/20639_2.png) [@Bcome](https://discourse.processing.org/u/Bcome)\
**Post date:** [June 3, 2025, 3:12pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/1 "2025-06-03T15:12:13Z")

</div>

Hello! While `size()` is working fine, I can’t get `full_screen()` to work and get this error message below. The problem with `size()` is that I can’t click on the window’s green button that would allow me to be in a true full screen mode, even if I provide the pixel height and width that correspond to my Mac’s viewport dimensions.

```txt
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'API misuse: modification of a menu's items on a non-main thread when the menu is part of the main menu. Main menu contents may only be modified from the main thread.'
*** First throw call stack:

[lots of lines here]

libc++abi: terminating due to uncaught exception of type NSException
zsh: abort 

```

## What I tested

The [different sketches examples on py5’s doc](https://py5coding.org/reference/sketch_full_screen.html). I also tried to provide a screen number, put things in `settings()` instead of `setup()`… But maybe I missed something.

```auto
import py5

x = 0

def settings():
    py5.full_screen()
   # py5.size(400, 200) It works fine with size

def setup():
    py5.background(0)

def draw():
    py5.fill(100)
    py5.rect(100, 100, 20, 20)

py5.run_sketch()

```

## Specs

- Mac book pro M3 nov 2023, MacOs Sequoia 15.4.1
- ~~py5 0.10.4a2~~ Now 0.10.6a0
- Python 3.13.3
- Java JDK Temurin-21.0.7+6
- Visual Studio Code 1.99.3 (Universal), with some extensions (Microsoft’s ones for Python, autopep8…). No Jupyter Notebook, files run in the integrated terminal (zsh) with a virtual environment (venv).

## Resources I found

I could not find something strictly related to py5 or Processing but maybe this issue on GitHub can gives you a better understanding of what is happening behind [https://github.com/fyne-io/fyne/issues/782](https://github.com/fyne-io/fyne/issues/782).

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 3, 2025, 6:58pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/2 "2025-06-03T18:58:21Z")

</div>

I can’t get your demo to run on my mac either (no VSCode):  
Returns this error on my system:  
`*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow should only be instantiated on the main thread! '`

As stated, _size()_ works ok but green window button is not enabled at setup(). An alternate approach that you could use is _set\_resizable()_ to add this capability. The following works on my system using the Thonny editor:

```python
# Uses Imported mode for py5

def setup():
    size(400, 200)
    get_surface().set_resizable(True)
    background(0)

def draw():
    fill(100)
    rect(100, 100, 20, 20)

```

**Output:** - notice green button is enabled and window will go fullScreen

 ![fx2d](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/3/73d77c1c1cd733671e0ce2994e25b55a54ac1b68.png)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 3, 2025, 7:53pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/3 "2025-06-03T19:53:16Z")

</div>

> **[full\_screen is broken? · py5coding py5generator · Discussion #661](https://github.com/py5coding/py5generator/discussions/661)**
>
> This problem showed up in the Processing forum. Would someone else confirm that this doesn't work on macos: # Uses Imported mode for py5 def settings(): full\_screen() def setup(): background(0) def...

---

<div class="post-metadata">

**Author:** ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)\
**Post date:** [June 3, 2025, 8:22pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/4 "2025-06-03T20:22:28Z")

</div>

> [@Bcome](#):
>
> Hello! While `size()` is working fine, I can’t get `full_screen()` to work and get this error message below. The problem with `size()` is that I can’t click on the window’s green button that would allow me to be in a true full screen mode, even if I provide the pixel height and width that correspond to my Mac’s viewport dimensions.

Hi, @Bcome ! Thank you for reporting this.

First, I want to point out that I am currently recovering from surgery on my left arm. I can’t really type right now or do the kind of investigation that I want to do right now. However, I was able to test your example and `full_screen()` is working on my Mac computer.

Right now I am using Python 3.9. I did some preliminary testing with python 3.13 a week or two ago and I did find there were some issues with exceptions similar to yours that I have not yet gotten to the bottom of. I would suggest first trying a earlier version of Python. Not necessarily Python 3.9, but please try Python 3.10 or 3.11.

I am also using Java Temurin-17.0.13+11, but I doubt that is the problem here.

Also please upgrade to the latest version of py5. The latest version is 0.10.6a0, out two weeks ago. This version contains the latest processing jars.

---

<div class="post-metadata">

**Author:** ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)\
**Post date:** [June 3, 2025, 8:26pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/5 "2025-06-03T20:26:52Z")

</div>

Also, how are you running this? You mentioned VS code. Are you using VS code as an editor? Are you running the python code through the terminal? Or are you running it in a Jupyter notebook through VS code?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 3, 2025, 11:07pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/6 "2025-06-03T23:07:38Z")

</div>

Just reporting **full\_screen()** works in my PC on [Garuda Linux](https://GarudaLinux.org) (Arch-based distro).  
Although more like a maximized window rather than an actual fullscreen.

Graphics card is an NVIDIA GeForce GTX 1660 SUPER on KDE Plasma 6.3.5 (Wayland) under Linux kernel 6.14.9-zen1-1-zen.

Other specs are:

- (‘JAVA\_HOME environment variable’, ‘/usr/lib/jvm/default’)
- (‘jvm version’, (21, 0, 7))
- (‘default jvm path’, ‘/usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so’)

Here’s the code I use to inspect the Java/py5/Jpype environment:

```py
#!/usr/bin/env python

import py5
import py5_tools

import sys
from os import environ as env

from java.lang.System import getenv, getProperty as prop

print(*py5_tools.get_jvm_debug_info().items(), sep="\n")

print("\nVendor:", prop("java.vendor"))
print("Version:", prop("java.version"))
print("OS:", prop("os.name"), prop("os.arch"), prop("os.version"))

print("\nUser:", prop("user.name"), prop("user.dir"))
print("Java:", prop("java.home"))

print("\nJAVA_HOME:", getenv("JAVA_HOME"), env.get("JAVA_HOME"))
# print("JDK_HOME:", getenv("JDK_HOME"), env.get("JDK_HOME"))
# print("GRAALVM_HOME:", getenv("GRAALVM_HOME"), env.get("GRAALVM_HOME"))

print("\nVenv:", sys.prefix)
print("\nInstance:", getattr(py5, "_instance"))

# print("\nJars:", prop("java.class.path"))

```

---

<div class="post-metadata">

**Author:** ![Bcome](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bcome/32/20639_2.png) [@Bcome](https://discourse.processing.org/u/Bcome)\
**Post date:** [June 4, 2025, 8:27am UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/7 "2025-06-04T08:27:04Z")

</div>

Hello, I tried this alternate approach and it works, thanks a lot!

---

<div class="post-metadata">

**Author:** ![Bcome](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/bcome/32/20639_2.png) [@Bcome](https://discourse.processing.org/u/Bcome)\
**Post date:** [June 4, 2025, 8:35am UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/8 "2025-06-04T08:35:59Z")

</div>

Hello, first of all, all the best with your recovery and thanks for testing my example code. Svan pointed an alternate approach that I’ll use for now, as I have a project to finish and present next week. Since I’m using other libraries and I’m not very familiar with working with Python, venv and so on, I’m afraid of breaking something if I try to downgrade my python version. Or to spend to much time on that.

But when my project will be over, I’ll be happy to test that. I also upgraded py5 as you suggested. Regarding VS Code, I’m using it as an editor (no Jupyter notebook). I run python files in the integrated terminal (zsh apparently) and since VS Code proposed me to do that, I’m using a virtual environment. Hope that helps.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 4, 2025, 3:31pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/9 "2025-06-04T15:31:28Z")

</div>

> [@Bcome](#):
>
> @Svan pointed a workaround that I’ll use for now,

Another workaround is calling **size()** passing _display\_width_ & _display\_height_ as its arguments:  
`py5.size(py5.display_width, py5.display_height)`

It should behave similarly to `py5.full_screen()`

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 4, 2025, 3:54pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/10 "2025-06-04T15:54:12Z")

</div>

`py5.size(py5.display_width, py5.display_height)`  
Could you toggle fullScreen back to regular like the green button on macos window?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 4, 2025, 4:03pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/11 "2025-06-04T16:03:58Z")

</div>

I don’t own a Mac, sorry. 🍎

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 4, 2025, 4:08pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/12 "2025-06-04T16:08:13Z")

</div>

> [@GoToLoop](#):
>
> I don’t own a Mac, sorry

Then try out it out with whatever you have. How do you re-size a window that you have set to display width/height?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 4, 2025, 4:37pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/13 "2025-06-04T16:37:30Z")

</div>

By default, no canvas is resizable, unless we configure it so:

```py
#!/usr/bin/env python

import py5

def setup():
    # py5.full_screen()
    py5.size(py5.display_width, py5.display_height)
    py5.get_surface().set_resizable(True)

py5.run_sketch()

```

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 4, 2025, 5:00pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/14 "2025-06-04T17:00:52Z")

</div>

On a mac that’s not really full screen; you can see the title bar at the top. With true full screen all you see is the canvas; depends on what interface the user wants.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 4, 2025, 5:21pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/15 "2025-06-04T17:21:38Z")

</div>

> [@GoToLoop](#):
>
> By default, no canvas is resizable

Perhaps you meant ‘window’ and not ‘canvas’? The canvas is part of a window. It’s true that the Processing runtime creates windows without the resizable mask baked in; it has to be added later if the user wants it (in the objc world the user controls the mac window buttons enabled at startup). The exception in our sphere is the window created by the FX2D renderer; it comes pre-packaged with the resizable attribute and doesn’t have to be added later.

```python
# Uses Imported mode for py5

import javafx

def settings():
    size(400, 200, FX2D)

def setup():
    background(0)
    
def draw():
    fill(100)
    rect(100, 100, 20, 20)

```

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 4, 2025, 5:26pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/16 "2025-06-04T17:26:10Z")

</div>

> [@svan](#):
>
> On a Mac that’s not really full screen; you can see the menubar at the top.

That’s why I said using **size()** + _display\_width_ + _display\_height_ was another “workaround”!

Only **full\_screen()**, which works for me on Linux btW, is supposed to provide an actual non-“menubar” window.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [June 4, 2025, 5:43pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/17 "2025-06-04T17:43:20Z")

</div>

It’s not worth debating, but if the user uses _set\_resizable()_ they get the real deal on a mac, and not a ‘workaround’ (initial post indicates macos). What we should be trying to figure out is why full\_screen works in Linux and not on a mac using a later python version. I’m editing my answer to call it an ‘alternate approach’ instead of a ‘workaround’.

---

<div class="post-metadata">

**Author:** ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)\
**Post date:** [June 11, 2025, 7:14pm UTC](https://discourse.processing.org/t/workaround-full-screen-is-not-working-py5-in-vs-code-on-macos/46498/18 "2025-06-11T19:14:34Z")

</div>

> [@Bcome](#):
>
> Hello, first of all, all the best with your recovery and thanks for testing my example code. Svan pointed an alternate approach that I’ll use for now, as I have a project to finish and present next week

Thank you! I am recovering nicely and am able to type again. I hope your project worked well.

I wanted to follow up with this to see where we are on this. I can’t reproduce the problem, but if multiple people are experiencing this problem on MacOS, I’d like to help figure out what is going on.
