Multi monitor wrong axis precedence

We used this code in the VisionWindowOpened event:

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)

#Force full screen multi-monitor
javaWin.setExtendedState(0)

#Force axis precedence multi-monitor
from com.inductiveautomation.factorypmi.application.DockingDesktopManager import AxisPrecedence
from org.apache.commons.lang3.reflect import FieldUtils
current = system.gui.getCurrentDesktop()
gui = system.gui.desktop(current)
desktop = FieldUtils.readField(gui, "desktop", True)
desktop.setAxisPrecedence(AxisPrecedence.NorthSouth)
1 Like