Windows switch monitor after resuming from sleep

Bug #1927948 reported by Alexander List
108
This bug affects 20 people
Affects Status Importance Assigned to Milestone
GNOME Shell
New
Unknown
Mutter
New
Unknown
gnome-shell (Ubuntu)
Confirmed
Medium
Unassigned
mutter (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

What I expect:

Window layout/positioning is identical after resume from sleep.

What I observe:

After resume from sleep, windows appear on a different monitor than before.

I found this possibly relevant GNOME bug:

https://gitlab.gnome.org/GNOME/mutter/-/issues/1419

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: mutter 3.38.4-1ubuntu2
ProcVersionSignature: Ubuntu 5.11.0-16.17-generic 5.11.12
Uname: Linux 5.11.0-16-generic x86_64
ApportVersion: 2.20.11-0ubuntu65
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Mon May 10 13:40:28 2021
InstallationDate: Installed on 2019-12-02 (524 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
SourcePackage: mutter
UpgradeStatus: Upgraded to hirsute on 2021-05-05 (4 days ago)

Revision history for this message
Alexander List (alexlist) wrote :
Revision history for this message
Alexander List (alexlist) wrote :

I have a Dell XPS 13 7390 2-in-1 with two external monitors.

The first external monitor is connected via USB-C/Thunderbolt, the second one via DP from the first external monitor.

tags: added: multimonitor
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mutter (Ubuntu):
status: New → Confirmed
Revision history for this message
anastasios0513 (anastasios0513) wrote :

First time posting on this forum; apologize in advance if I am not doing this right.

I have the same problem. I have three monitors (1 4k, 2 1080p [1 16:10 and 1 16:9]). 1080p 16:10 monitor is set as primary display, but is Monitor 2 in the physical connections.

Stuff on primary monitor (16:10) stays put; stuff on the 4k monitor and the secondary 16:9 monitor move around.

$ sudo lshw -class display
  *-display
       description: VGA compatible controller
       product: Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: e7
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=amdgpu latency=0
       resources: irq:209 memory:a0000000-afffffff memory:b0000000-b01fffff ioport:5000(size=256) memory:b0900000-b093ffff memory:c0000-dffff

Attachment:

1. output of dbus-send --session --print-reply --dest=org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig.GetCurrentState

2. output of ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Greg Fawcett (foxylad) wrote :

This is happening to me too. Fresh install of Debian 11, primary DP landscape, secondary HDMI portrait. Two effects:

1. A window on the right of the primary screen moves to the left of the primary screen. Another window on the left of the primary screen does not move. The moving window also resizes, although this contains Terminal and may be resizing to default row/column settings.

2. A maximised window on the secondary screen is moved down so there is a one-line gap at the top, despite still being maximised. Un-max/max removes the gap.

It seems to happen when screen is blanked. I have disabled screen locking so don't know if it happens when screen locked too.

Revision history for this message
Nicholas Klopfer-Webber (ottago) wrote :

Its a shame a new issue was created for this. The problem has been around for over 7 years and by creating a new ticket it looses just how many people this affects.

https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1295267

In my case, I have 3 monitors connected to a Dell Latitude laptop. One of the monitors seems to take longer to wake up than the others. As stated by others, this delay causes some windows to move from one to another. Chrome's windows are stable, but they implemented everything them selves so we can exclude them. Gnome terminals, Remmina windows, KeePassX all move around.
It is related to the slow monitor issue because Gnome terminals often get resized which indicates they have been migrated to another windows and squished to fit the smaller resolution.

Maybe a fix would be to allow a delay to be set between waking up the screen and when they appear so we don't trigger the shuffling of windows. However really the issue is they are not being restored back to their original position after monitor plug events.

Revision history for this message
Timur Tabi (timur-tabi) wrote :

Would it be possible to "lock" the monitor configuration so that even if Ubuntu does not detect all of the monitors, it doesn't care?

I understand that one laptops and some other systems, changes in the monitors are common. But I have a desktop PC with two monitors attached, and that does not change.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think the best place for continuing this discussion is with the developers at either:

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2092
https://gitlab.gnome.org/GNOME/mutter/-/issues/1419

Changed in gnome-shell (Ubuntu):
status: Confirmed → Won't Fix
Changed in mutter (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

See also bug 1778983.

tags: added: jammy
removed: hirsute
Changed in gnome-shell (Ubuntu):
status: Won't Fix → Confirmed
Changed in mutter (Ubuntu):
status: Won't Fix → Confirmed
Changed in gnome-shell (Ubuntu):
importance: Undecided → Medium
Changed in mutter (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Mark Edmunds (markedmunds1907) wrote :
Download full text (3.3 KiB)

I believe I too am affected by this problem.

I have three monitors attached to my system all on the same GTX950 (GM206) adapter and after waking up from sleep the active windows move around and most annoyingly the system often struggles to 'find' all three monitors again - even though it shoes them in the display settings dialog.

Sometimes it will only see two. Sometimes finds them all but mirrors two. Meaning I have to turn monitors on and off until they play ball which can take some time for the system to recognise them all again.

The system works fine if I reboot it but on sleep it goes wrong.

Doing a xrandr shows this:

xrandr
Screen 0: minimum 8 x 8, current 7680 x 2160, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 596mm x 335mm
   3840x2160 30.00*+ 29.97 25.00 23.98
   2560x1600 59.97
   2560x1440 59.95
   1920x1080 60.00 59.94 50.00 29.97 23.98 60.00 50.04
   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 72.81 59.94 59.93
DP-0 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 596mm x 335mm
   3840x2160 29.98*+
   2560x1600 59.97
   2560x1440 59.95
   1920x1080 60.00 59.94 50.00
   1680x1050 59.95
   1440x900 59.89
   1440x576 50.00
   1440x480 59.94
   1280x1024 60.02
   1280x960 60.00
   1280x800 59.81
   1280x720 60.00 59.94 50.00
   1024x768 60.00
   800x600 60.32 56.25
   720x576 50.00
   720x480 59.94
   640x480 59.94
   640x350 70.10
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 connected (normal left inverted right x axis y axis)
   3840x2160 60.00 + 30.00
   2560x1600 59.97
   2560x1440 59.95
   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 72.81 59.94 59.93
DP-5 disconnected (normal left inverted right x axis y axis)

So the system can see all monitors and I can select all three under the Screen Display settings but setting them up and applying the changes doesn't result in them all turning off as expected until you've done it numerous...

Read more...

Revision history for this message
Mark Edmunds (markedmunds1907) wrote :

Just to add on to my last comment... something is really broken for my configuration - after ten minutes of trying to get all three monitors to wake up and play ball with the screen display settings windows and it only ever enabling two out of the three (sometimes 1 & 3, sometimes 1 & 2 and somethings 2 & 3), I gave up and rebooted.... and now it's fine.

Think will just have to disable the monitors from sleeping when the screen is locked...

Happy to investigate if given direction on what to look at on my system.

Changed in gnome-shell:
status: Unknown → New
Changed in mutter:
status: Unknown → New
Changed in mutter:
status: New → Fix Released
Changed in mutter:
status: Fix Released → Unknown
Changed in mutter:
status: Unknown → New
Revision history for this message
John Erling Blad (jeblad) wrote :

This happen on my setup, and it never goes to sleep a.k.a. suspend is off. It only does a screen lock. Thus I believe it is wrong to assign this to the sleep functionality.

I have two screens, one low-res Eizo Nanau corp. FlexScan S2202W 22" 1680×1050 connected over DVI-D and one Samsung Electric Comp. U28E590D 28" 3840×2160 connected over HDMI. The Eizo screen is pretty old, but has better image quality. This machine is a ASUS ROG STRIX B650E-F with an old NVIDIA GeForce GTX 960 graphics card. Both screens are connected to the 960. Its kind of counter intuitive to use such an old graphics card on that motherboard.

The Eizo screen is pretty fast while unlocking the machine, the Samsung one is lagging behind. Some apps will then move to the Eizo screen, most notably gnome apps, but not consistently. Doing a test right now the file browser moved, Firefox did, and Warp. Neither Secrets nor Chronium move on this occasion. Repeating this, but without screens turning on, nothing moved. Repeating once more with screens turning off, only the backup app Pica moved.

I've been wondering whether this has to do with how many apps that manage to reinitialize before the Samsung monitor turns on, and whether the screens are sequentially initialized or it is done in parallel. Some says it doesn't matter whether the screens are similar, which makes me wonder if they are initialized sequentially.

If necessary I can do some further tests.

# Systeminformasjon
---

## Rapport
- **Dato generert:** 2024-07-14 15:28:58

## Maskinvare:
- **Maskintype:** ASUS ROG STRIX B650E-F GAMING WIFI
- **Minne:** 16,0 GiB
- **Prosessor:** AMD Ryzen™ 7 7700X × 16
- **Grafikk:** NVIDIA GeForce GTX 960
- **Grafikk 1:** NVIDIA GeForce GTX 960
- **Lagringsplass:** 6,0 TB

## Programvare:
- **Fastvareversjon:** 0613
- **Operativsystem:** Ubuntu 24.04 LTS
- **Utgave:** (null)
- **Type:** 64-bit
- **GNOME-versjon:** 46
- **Visningssystem:** X11
- **Kjerne:** Linux 6.8.0-38-generic

Revision history for this message
John Erling Blad (jeblad) wrote :

john@chimera:~$ xrandr
Screen 0: minimum 8 x 8, current 5520 x 2160, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 3840x2160+1680+0 (normal left inverted right x axis y axis) 608mm x 345mm
   3840x2160 60.00*+ 59.94 50.00 29.97 25.00 23.98
   2560x1440 59.95
   1920x1080 60.00 59.94 50.00 29.97 23.98
   1680x1050 59.95
   1600x900 60.00
   1440x900 59.89
   1280x1024 75.02 60.02
   1280x800 59.81
   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 72.81 59.94
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected 1680x1050+0+552 (normal left inverted right x axis y axis) 474mm x 297mm
   1680x1050 59.88*+
   1280x1024 60.02
   1280x960 60.00
   1024x768 60.00
   800x600 60.32
   640x480 59.94
HDMI-A-1-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1-0 disconnected (normal left inverted right x axis y axis)
None-2-1 connected (normal left inverted right x axis y axis)
   3840x2160 60.00 +

Revision history for this message
John Erling Blad (jeblad) wrote :

john@chimera:~$ sudo lshw -class display
  *-display
       description: VGA compatible controller
       product: GM206 [GeForce GTX 960]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=nvidia latency=0 mode=3840x2160 visual=truecolor xres=3840 yres=2160
       resources: iomemory:fc0-fbf iomemory:fc0-fbf irq:125 memory:fb000000-fbffffff memory:fcc0000000-fccfffffff memory:fcd0000000-fcd1ffffff ioport:f000(size=128) memory:fc000000-fc07ffff
  *-display
       description: VGA compatible controller
       product: Raphael
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:0d:00.0
       version: c3
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix vga_controller bus_master cap_list
       configuration: driver=amdgpu latency=0
       resources: iomemory:fc0-fbf iomemory:fc0-fbf irq:99 memory:fce0000000-fcefffffff memory:fcf0000000-fcf01fffff ioport:e000(size=256) memory:fc500000-fc57ffff
  *-graphics
       product: simpledrmdrmfb
       physical id: 2
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=3840,2160

Revision history for this message
John Erling Blad (jeblad) wrote :

Can also add that sometimes the windows are moved off-screen, or partly off-screen. The Eizo screen is placed on the left, and vertically in the middle compared to the Samsung screen. The windows are usually moved upwards, seemingly to the top compared to the Samsung screen.

Revision history for this message
Vineet Gupta (vineetgarc) wrote :

Looks like there are too many issues - old ones getting closed and new getting created.

From the two threads linked earlier

1. The issue is with USB-C delay, using HDMI cable is a reliable workaround (finally after over year of agony).

2. @irox mentioned a software workaroundfor cinnamon/mint ? but I can't find corresponding setting for Ubuntu 24.04 + GNOME + Wayland.

$ sudo vi /etc/xdg/autostart/cinnamon-settings-daemon-xrandr.desktop
and change:
Exec=csd-xrandr
to:
Exec=csd-xrandr --exit-time 5

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.