Multimonitor display settings reset after one display is turned off

Setup:
I have two monitors connected to my GPU, one using Displayport, and one using a HDMI to DVI cable. The displayport one is my main monitor.

I am using Ubuntu 19.04 with Nvidia driver 418 on a GTX1070 in XFCE.

$   lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 19.04 Release:    19.04 Codename:   disco  $   uname -a Linux abulafia 5.0.0-25-generic #26-Ubuntu SMP Thu Aug 1 12:04:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux  $   nvidia-settings -v nvidia-settings:  version 418.56 

Problem description:
Turning off my main (Displayport) monitor with the physical button on it will cause Ubuntu to use my secondary display as the only display. But turning my main display back on, it won’t reconfigure my layout correctly, especially it will select to mirror display and overlay them. This results in me having to reconfigure it manually. It can’t detect me physically turning off my secondary display, and will still output to it when it is turned off, so the problem doesn’t happen in reverse.

Before turning off primary display
After turning primary display back on

What I tried:
Checking the Configure new display when connected box in the display settings, which results in me being asked about how to configure the displays when turning the main one back on. This kind off restores my settings but I still have to reconfigure it because it creates a “gap” between the monitors: Showing gap in display settings.

I also tried configuring the displays in nvidia-settings, which didn’t change anything. I can’t try saving my settings to xorg.conf because I hit this bug.

Expected results:
I want my display/window setup to stay even when turning off the display and not be asked which setup I want. Basically Ubuntu should ignore me physically turning off the display and continue to output to it.
I use the same display setup with a Debian PC with Intel integrated graphics (main monitor connected with HDMI) where my layout stays the same when turning off the monitors, so I know it is possible.

Are there any guidelines or best practices for the design of multi-monitor systems?

By multi-monitor I mean systems which arrive out of the box with several physical monitors, each with predefined functionality. These are usually industrial systems running their own software.

This type of systems raises interesting questions, such as – do we duplicate important stuff on all the screens? Do we gray out all screens to display a modal dialog on one of them? Do we create a hierarchy of screen “importance” or are they equal? Etc.

There is some research on this from the ergonomics perspective but I’m looking for more of a UX-oriented work.