I think I found a reason why this happens.
I left xrandr running in a loop, logging everything and then I forced both 
displays into standby with xset.

After checking the logs this is what I noticed:

DP-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 
597mm x 336mm
DVI-D-0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 
510mm x 290mm
DP-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 
597mm x 336mm
DVI-D-0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 
510mm x 290mm
DP-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y 
axis) 510mm x 290mm
DP-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 
597mm x 336mm
DVI-D-0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 
510mm x 290mm
DP-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 
597mm x 336mm
DVI-D-0 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 
510mm x 290mm

When displays go to low power mode my 4K screen is briefly turned off
and then back on. When 4K screen is turned off, the 1080p becomes
primary and and all the windows are moved to it, when screen is
connected back and windows are restored everything is put in the wrong
place.

This seems like a wrong implementation of DPMS with the screen
manufacturer, not much can be done about this, but WM could go around
this.

(strangely enough, same thing happens if I just turn off my HiDPI
screen, I don't know how I didn't remember this before)

Which brings up a separate problem - handling of windows when one screen
is turned off.

WM should remember position of windows when one screen is disconnected.
Windows should be then placed on the _visible_ area on the remaining
screen. When previous screen is connected again if windows were not
moved, they should go back to their original positions.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1295267

Title:
  Windows change Monitor/Desktop after screen lock

To manage notifications about this bug go to:
https://bugs.launchpad.net/unity/+bug/1295267/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to