Windowed Client Start Position

A client has a large 4K monitor they are using for cameras, with a 1920x1080 area for their Ignition client in the bottom right. I can set the size of the client, but how can I set the launch position coordinates to the bottom right, instead of default top left?

There’s no way to do this (directly) within the NCL’s settings. Two possible approaches:

  1. Some 4k monitors have the capacity to ‘fake’ being four separate monitors to the driving OS; if your monitor/drivers support that, then you can just set the correct screen index in the launch params (make sure to use the NCL or clear your Java cache if using webstart).
  2. Depending on OS, there are definitely external tools capable of driving a position change; for Windows AutoHotKey is a powerful, albeit somewhat convoluted, scripting language capable of a variety of tasks. You could have an Ignition client startup script run an AutoHotKey script with system.util.execute. Other OSes (Linux especially) undoubtedly have options; that’s just the one I’m familiar with on Windows.

Thanks Paul. I’ll look at using AutoHotKey. From your answer though, I assume it’s not possible to move around the client window via a Jython script on client launch?

From some searching around, it looks like it might be possible to setLocation() on the parent JFrame containing the entire client, but it’s not something I’ve ever experimented with. If you decide to do some experimentation, I’d recommend using SwingUtilities to help get the root frame.

1 Like

Just in case anyone else is looking, I found this works:

# set the location of the Ignition Client window
from javax.swing import SwingUtilities
def SetLocation(left=100, top=200):
	allWindows = system.gui.getOpenedWindows()
	if len(allWindows)==0:
		#No Windows open? open one first
		allWindows = system.gui.getOpenedWindows()
	topWindow = SwingUtilities.getAncestorOfClass(Window, allWindows[0])

I know this may be a stupid question but where did you run this script? Also doesn’t it still go to top left as it is written?

Probably on the window’s startup event, can’t recall the name :thinking:
Client is positioned at left=100 top=200