Dual monitor loses arangement when asking for monitor sleep

Tumbleweed 01/26/2024 (x86_64) on kernel 6.7.1-2-default
32G memory
KDE 5.114.0 Plasma 5.27.10 running on X11
Qt: 5.15.12

I have my system setup to only sleep the monitors after 15 minutes of inactivity. But every time they wake up they have lost their arrangement. display configuration in system Settings shows they are overlapped, one on top of the other. I then can rearrange them side by side and all is fine until they next go to standby and wake up when once again they are messed up. The monitors are identical ASUS VE278 monitors at 1920x108 res hooked to a Nvidia RTX 2060. I have a second 2060 also that is not cabled to anything, it’s for use in openCL apps. I have HDMI and DP connected to the card because a previous card only had 1 DP - is that why? BTW: I have done a fresh TW install since i installed this new RTX 2060

xrandr shows (I thought it might be helpful)

$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00  
   1680x1050     59.95  
   1440x900      59.89  
   1440x576      50.00  
   1440x480      59.94  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00  
   1680x1050     59.95  
   1440x900      59.89  
   1440x576      50.00  
   1440x480      59.94  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DVI-D-1-0 disconnected (normal left inverted right x axis y axis)
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

I think KDE settings → Startup and Shutdown → Background Services → KScreen 2 messes with displays on hotplugging and inactivity. I normally disable it. With it disabled I think what has been setup with nvidia-settings might stick better. You could try that and turn it back on if that doesn’t help.

I also use xrandr when X11 initialises - mainly to get the scaling I prefer, but it also deals with placement. I created /etc/X11/xinit/xinitrc.d/50-xrandr.sh which contains:

xrandr --output DP-4 --auto --output DP-0 --auto --scale 1.75x1.75 --right-of DP-4

Also DisplayPort differs in hotplug detectability from DVI and HDMI. If a display is connected by DisplayPort, turning it off might result in a detectable hotplug event which KScreen 2 will react to by moving windows to any remaining display.

The above is partly based on browsing/searching the ArchWiki.

What would mine contain?
Is this correct?
xrandr --output DP-1 --auto --output HDMI-0 --auto --scale 1.75x1.75 --right-of DP-1

If your only problem is the relative positions, all you need is:

xrandr --output HDMI-0 --right-of DP-1

If your panel lands on HDMI-0 (right side display), you can move it at the same time by specifying DP-1 as primary:

xrandr --output DP-1 --primary --output HDMI-0 --right-of DP-1

Does this take effect every time the monitors wake from sleep?

I don’t know any way to make it run automatically in an existing session, which is not to say there isn’t one. I just don’t know. Xrandr to put the second display back where it belongs is purely a workaround. You could assign it a hotkey. If you keep Konsole or an Xterm open, running it there would put it in your command history as few as two keystrokes (Up > Enter) away from repeating it. You could put it in an easy to type alias.

What’s happening is apparently a bug that’s specific to your hardware configuration. Kscreen2 should be maintaining the state you configure, sleep or no sleep.

It shouldn’t need to be restored unless something like kscreen changes the arrangement.

I just run xrandr at login, and as long as kscreen is disabled, the arrangement remains constant.