Change Windowed/Fullscreen Mode Dynamically

Does anyone know of a way to switch a currently running application between ‘Fullscreen’ or ‘Windowed’ mode? I’m thinking something like system.util.retarget() to itself may work but couldn’t find the proper parameter for it.

Thanks,
Pete

Unfortunately, it’s not really possible to do this - fullscreen and windowed modes are fundamentally different from the moment they launch, down to the actual “main” java class that’s executed.

You can always add a minimize button to your full screen windows. Don’t know if that’s what you’re looking for but the code is below. The code below was placed on the actionPerformed event of a button component.

from javax.swing import JFrame
from org.python.core import Py
win = system.gui.getParentWindow(event)
while not isinstance(win,JFrame):   
   win = win.getParent()
javaWin = Py.tojava(win,JFrame)
javaWin.setState(JFrame.ICONIFIED)

Thanks Sam. We’ll give that a try and let you know how it goes.

Hi @PGriffith,
It’s been more than a year when your comment says that this is not possible to do. Is it now possible to do it? If not then is there a plan to launch an update for this and what’s the timeline?

Thanks in advance

No, it’s still not possible to do this, and there are no plans to introduce the capability. Fullscreen mode is fundamentally different (in terms of technical implementation), so the best case scenario we could implement would require the application window completely disappearing to be replaced by another application window instance entirely - which would almost certainly not be seamless with regard to component focus, binding state(s), incomplete text entered into fields, etc.

If you submit a feature request to the ideas portal, we can gauge community interest and see whether that decision might change, but right now there are zero plans (short or long term) to re architect Vision to support this functionality.

Thank you for the reply. Have suggested the idea in the portal. Hope something comes up soon!!

1 Like

Depending on your application, something like this may do what you're looking for. It removes/adds the window frame and title bar at runtime, giving you the effect of fullscreen and windowed modes.