# Run 4 Ignition Desktops on 4k Diplay

**URL:** <https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 4, 2020, 8:34pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387 "2020-08-04T20:34:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 4, 2020, 8:34pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/1 "2020-08-04T20:34:25Z")

</div>

Hi All,

Looking for a little guidance on opening 4 desktops at 1080P resolution in a 2 by 2 matrix on a single 4k display. I have tried using the system.gui.openDesktop in the client event script which works but each desktop including the main that are opened are all full screen and fill the entire display. I don't think I want to launch windowed mode and I do not want the box around the view client. Is there a hack in the settings I can use to make this work?

Thanks,

Frank

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 4, 2020, 8:43pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/2 "2020-08-04T20:43:10Z")

</div>

Could you do 4 x 1920x1080 windows instead? Then you can have the client launch in full screen but get your 2x2.

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 4, 2020, 9:42pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/3 "2020-08-04T21:42:05Z")

</div>

Not a bad idea but the app has already been developed out and it isn’t setup in that fashion.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 4, 2020, 10:41pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/4 "2020-08-04T22:41:14Z")

</div>

Open the desktops in windowed mode instead of fullscreen mode, setting the size and location of each appropriately to get your 2x2 tiled display.

If you’d like to eliminate the window title bars and frames, run something like this in each desktop (works from a button, you probably want to adapt it to a window opened event, or something similar–conditioned on which computer it is opened on if this is opened on other clients that won’t want this layout):

```python
from javax.swing import JFrame
# Get parent window of button.
window = system.gui.getParentWindow(event)
# Get parent JFrame.
while not isinstance(window, JFrame):
	window = window.getParent()
# Hide JFrame so we can change its decorated state.
window.dispose()
# Remove frame and title bar.
window.setUndecorated(True)
# Display JFrame.
window.setVisible(True)

```

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 5, 2020, 12:11am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/5 "2020-08-05T00:11:23Z")

</div>

I tried this but each window can be moved around and i am afraid they would have them all closed in no time.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 5, 2020, 12:58am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/6 "2020-08-05T00:58:07Z")

</div>

Did you try setUndecorated on each desktop’s JFrame with code something like above after opening, sizing, and positioning via system.gui.openDesktop?

If the above code ran on each desktop’s JFrame, you should see no title bar (so no min/max/close buttons) and no window frame/box around each desktop/window making them a little more difficult to move or close. This won’t prevent access to the taskbar–though neither does fullscreen mode if a keyboard with Windows key is available (assuming this is on Windows).

I expect this would give you the 2x2 tile of apparent fullscreen mode that you’re looking for, except that they won’t cover the Windows taskbar.

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 5, 2020, 2:01am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/7 "2020-08-05T02:01:43Z")

</div>

Witman,

Could I roll this extra scripting into the client startup script that is conditioned for specific hosts only? Or does it have to exist on every window in the project?

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 5, 2020, 4:53am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/8 "2020-08-05T04:53:28Z")

</div>

I haven’t tried this in a client startup script, but [system.gui.openDesktop](https://docs.inductiveautomation.com/display/DOC80/system.gui.openDesktop) returns a reference to the new desktop’s JFrame, so I expect you could integrate the removal of frames’ decoration something like this:

```auto
hostNames = ["HostNameThisAppliesTo","AnotherHostNameThisAppliesTo"]
if system.net.getHostName() in hostNames:
	# Open and setup top left desktop.
	windows = ["Main Windows/Main Window", "Navigation"]
	desktop = system.gui.openDesktop(width=1920,height=1080,x=0,y=0,windows=windows)
	desktop.dispose()
	desktop.setUndecorated(True)
	desktop.setVisible(True)
	# Add additional desktops with desired windows, size, and location...

```

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 5, 2020, 12:36pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/9 "2020-08-05T12:36:42Z")

</div>

I can definitely give this a shot. Would I also need to perform this scripting on the original JFrame opened by opening the vision client in addition to these “extra” desktops I am opening?

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [August 5, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/10 "2020-08-05T13:44:58Z")

</div>

That’s right; you’ll want to strip the title bar and window borders from your original window too. You’ll probably need something closer to the first code I posted above for that, referencing the window you open in your client startup script:

```auto
from javax.swing import JFrame

hostNames = ["HostNameThisAppliesTo","AnotherHostNameThisAppliesTo"]
if system.net.getHostName() in hostNames:
	# Setup initial desktop.
	desktop = system.nav.openWindow("PathToWindow")
	while not isinstance(desktop, JFrame):
		desktop = desktop.getParent()
	desktop.dispose()
	desktop.setUndecorated(True)
	desktop.setSize(1920,1080)
	desktop.setLocation(0,0)
	desktop.setVisible(True)
	# Open and setup top right desktop.
	windows = ["Main Windows/Main Window", "Navigation"]
	desktop = system.gui.openDesktop(width=1920,height=1080,x=1920,y=0,windows=windows)
	desktop.dispose()
	desktop.setUndecorated(True)
	desktop.setVisible(True)
	# Add additional desktops with desired windows, size, and location...

```

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [August 8, 2020, 2:17am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/11 "2020-08-08T02:17:15Z")

</div>

@witman this worked a treat! Many thanks!!!

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [August 10, 2020, 6:51am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/12 "2020-08-10T06:51:01Z")

</div>

I know the solution is already given. But we’ve also had a case where we had to support 4K screens, and they expected more content on the 4K screen than on the regular screens.

Our solution was to simply develop each screen as a template. For the small screens, use those templates directly into a window. And for the big screen, show 4 of those templates.

Even if the application is already developed, it’s usually not that hard to copy-paste all content from a window to a template.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 3, 2024, 9:43pm UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/13 "2024-07-03T21:43:41Z")

</div>

This worked really well. I tweaked it to my needs as we do some additional things like tracking last windows users were on so on restart of the application we open their previous windows, and put what you have in a separate script so I can call it to load any number of displays dynamically based on monitor/screen resolution.

---

<div class="post-metadata">

**Author:** ![cjm](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cjm](https://forum.inductiveautomation.com/u/cjm)\
**Post date:** [October 5, 2024, 12:21am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/14 "2024-10-05T00:21:45Z")

</div>

Hi Everyone,

I am having trouble getting this to work. I am getting the error: "Secondary desktop "0" already exists." This happens when attempting to open the 3 window.

Any ideas?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 5, 2024, 6:14am UTC](https://forum.inductiveautomation.com/t/run-4-ignition-desktops-on-4k-diplay/37387/15 "2024-10-05T06:14:48Z")

</div>

Running 4 desktops in one monitor is something I do. How are you creating your desktop handles? It should be something like this to prevent the already exists error:

```python
for index in xrange(4):
	handle = "Desktop {}".format(index)
	# Create and position desktop using the above handle

```
