How can I stop windows re-positioning after waking from sleep?

123

54

I put my multi-monitor system to sleep when it's not in use. After I wake it up, all windows are repositioned to a different screen. The closest pattern I can think of is that the windows there were on the main screen switch to a the second screen. It looks like it disconnects the main screen before it goes to sleep which in turn switches all the windows to the 2nd or 3rd screen.

Edit: Here's the video card I'm using --> SAPPHIRE FleX 100322FLEX Radeon HD 6450

Kingamoon

Posted 2012-07-25T15:15:19.233

Reputation: 1 435

3

I found the definitive solution to this: do as Stephen, (st99), says here in the ninth answer

– Soldeplata Saketos – 2018-05-03T08:48:56.210

same issue is on kubuntu, anybody have a solution for that? – Waqleh – 2018-09-03T10:58:31.883

Unable to add as an answer, but having read this answer and this answer, I found the solution to be a manipulation of HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration. With all additional monitors disconnected, delete all keys at this path and restart PC. Note new key added to this path (A). Reconnect monitors and note further new key added (B). Set up display settings as desired. New key will be added again (C). Each key represents a display config. Delete the undesired key (probably key B).

– Neo – 2019-09-15T20:54:10.813

I've had a couple PCs at work experiencing this issue. Both were Windows 10. First had Intel HD Graphics 530 and the new one as of a couple days ago has Intel UHD Graphics 630. I didn't have this issue at all with Intel driver 22.20.16.4771, then Windows automatically updated to 24.20.100.6344 and I started noticing the issue. Rollback fixed it. Two times after that, Windows automatically updated to 25.20.100.6446, the issue came back, I rolled back to resolve it. New PC has 26.20.100.7262 and has the same issue. I'm trying to find a solution since I can't simply roll back to 22.20.16.4771. – Pilot_51 – 2020-02-07T13:37:55.880

1You need to specify the graphics adapters you're using, this is probably their fault. – Shinrai – 2012-07-25T15:27:34.473

Answers

34

The issue is most likely with the graphics driver. Whenever a single monitor is disconnected from a multimonitor setup in Windows, Windows will attempt to move everything from that screen onto the remaining screen(s). Usually, this will not occur when suspending/hibernating/shutting down the computer. Thus, it is probably because of the graphics driver doing one of the following:

  • 'Disconnecting' the monitors when you put the computer to sleep, so when Windows awakens, it must re-determine where to place everything.
  • Recognizing the monitors in a different order each time you bring the computer out of sleep, forcing Windows to rearrange your application windows.

Check to see if there is an update to your graphics driver by going to the chipset manufacturer's website.

Tanaki

Posted 2012-07-25T15:15:19.233

Reputation: 1 052

1FYI: My drivers are from Intel, so I presumed they were signed and distributed with Windows Updates, but they were not. – Leo – 2015-10-18T11:49:23.413

1Similar problem here. I have a Dell laptop with nVidia graphics adapter. Installing a newer driver from nVidia instead of the Dell driver fixed the problem. – Chris Jones – 2015-12-17T23:18:38.987

1similar Problem here. latest OEM Intel HD 4600 drivers. may be I should check Drivers from PC Vendor (HP)? – Falco Alexander – 2016-05-29T11:33:48.170

2Same problem with a 7i5bnk NUC - got latest intel drivers – niico – 2017-06-30T16:11:26.527

51

This is an old question, but if anyone arrives here with the same issue, I suggest trying the solution posted here:

http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-movesresizes-windows-on-monitor-power/1653aafb-848b-464a-8c69-1a68fbd106aa

I'm running Windows 8.1 with two 2560x1440 displays on DisplayPort. When waking from sleep, all my windows had been pushed to one display, and some of them resized. This fixes the issue for me; now all my window positions and sizes are preserved. Here is the relevant link content:

I have found a work-around. Using Sysinternals ProcessMonitor I found that Windows was accessing the following Registry path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration

My system had three entries:

  • DELF003YY7707BR0MUL_30_07D7_6A^9A3774EB79DEE3E3E38496CC7DF4D936
  • QHD32000001_31_07D6_D5^63E1ABDD175E7871DCAEB710418A0F75
  • SIMULATED_8086_2A42_00000000_00020000_1010100^CDE365D1B3F0942F0CF38BFB8E127AB4

Under each is a tree called 00. Two of the keys are:

  • PrimSurfSize.cx
  • PrimSurfSize.cy

Under 00 was another branch also called 00. Two of the keys are:

  • ActiveSize.cx
  • ActiveSize.cy

In the first two configs (i.e. DELF00... & QHD3...), the above keys were 1440x900, so they were not involved.

The third (SIMULATED...) were set to 1024x768.

I changed these to 1600x900 and the problem was solved.

Further I changed resolution (via control panel) to 1920x1080, the moving/resize issue returned, but the lower right corner was set to 1600x900, ie the SIMULATED... settings.

So for some reason one of the configs does not get set correctly.

I don't know why there are three configs, I have only ever used one monitor.

John Freeman

Posted 2012-07-25T15:15:19.233

Reputation: 696

This sort of works for me. I have a 4K monitor with 175% scaling and setting these makes it behave as though the simulated monitor is without scaling (windows are resized to a maximum of 100/175 of the screen size). – Ouroborus – 2016-01-12T15:27:28.790

21Simply delete the whole HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration, it works as well and it's faster. – FarO – 2016-10-25T21:55:42.410

My laptop doesn't have a SIMULATED key. I'm new to Windows 10 and I'm wondering if it's been removed? If not, is there a way to get it into my system? – rythos42 – 2016-12-05T06:53:31.930

3Deleting the entry does not work for me (Windows 10). As soon as I turned of the monitor, the 'SIMULATED' entry is created again. Original solution works (ie. modify each occurrence of 1024,768 with actual resolution). – FractalSpace – 2017-02-10T16:22:51.837

2

Here's another related post I found on Microsoft Answers for Windows 10. https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/windows-10-multiple-display-windows-are-moved-and/2b9d5a18-45cc-4c50-b16e-fd95dbf27ff3

– Chiramisu – 2017-03-14T22:39:03.807

1Deleting the whole configuration as @OlafM suggested works perfectly. In my case, windows hat about 30 entries. After rebooting, only one was re-recreated, containing only the monitors I have actually plugged int. – maja – 2017-06-09T20:54:25.803

1I was nervous about deleting everything in the Configuration folder but I made an export first and deleting everything fixed the issue, after resume I had to set the monitor order and it no appears fixed. – drooh – 2018-02-13T19:03:12.660

This worked for me on my 7i5bnk nuc (I definitely have latest graphics drivers - the newest driver didn't fix the issue). – niico – 2018-02-16T13:51:51.117

1This fixed it for me. I had a good dozen entries under Configuration. One of them had my primary monitor at 640x480, probably due to a failed monitor type detection at some point. Apparently it was always using that as the default and thus screwing up the size and position of everything. I deleted just that one configuration and so far afterwards everything has been fine. By the way, I have a Surface Book 2 with Surface Dock, and I used to shut down at home, then start back up at the office. Now I undock and power up/down separately, and that has eased the monitor problems too. – Kyralessa – 2018-06-20T12:14:59.420

1Alas, I spoke too soon. The problem returned not long after. Oddly, though, showing hidden devices in the Device Manager revealed a 640x480 monitor which I've just uninstalled. Maybe that'll fix the problem...but I have a terrible feeling that monitor will come back. – Kyralessa – 2018-07-16T15:00:45.007

I have no SIMULATED Configuration entry and modifying/deleting entries+rebooting had no effect. – rustyx – 2019-08-21T09:07:12.680

No need for all this modifying of entries at this path. Just delete all keys and then follow the steps in my comment here.

– Neo – 2019-09-15T20:55:46.967

Deleting the Configuration key seems to have done the trick. Hopefully it sticks. I haven't rebooted since deleting it about 4 days ago. – Pilot_51 – 2020-02-11T13:10:35.337

I spoke too soon. Got back from lunch and my primary and secondary monitors switched places. Windows thought my left (primary) monitor was actually my right (secondary) monitor. All my windows were moved to the new primary monitor (physically right, virtually left). If this happens anywhere near as frequently as the issue I was trying to fix, this is worse. – Pilot_51 – 2020-02-11T19:29:06.533

I first deleted all the configuration values but this didn't work for me. So I rebooted and saw a single folder (GSM5A...) in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration. I then locked the screen and waited until the display turned off. After waking the computer, another folder (NOEDID_...) was created. I then copied ALL the values from GSM5A.. to NOEDID_.. and put the display to sleep again. This time, it woke and my windows all seemed to have maintained their size and positions. – rein – 2020-02-20T00:06:42.020

15

If your computer has Intel HD Graphics you have to set Extend Display options (and resolution settings) from the Intel Graphics Control Panel. If you do it from the Windows Display settings it will reset after you wake it from sleep mode.

Here's a screenshot.

enter image description here

bytestorm

Posted 2012-07-25T15:15:19.233

Reputation: 271

It didn't change anything for me. Or do I have to completely wipe the windows settings before doing it with the Intel software? – Christophe Drevet-Droguet – 2017-09-28T13:40:07.467

1It worked for me after I reset the settings and then applied from the Intel graphics. – Tidhar Klein Orbach – 2017-11-07T11:38:06.017

I merely switched some option and then reverted it back. It enabled the "apply" bouton and saved the config from the driver. Works great after manual lock. I wll see what happens after a long period – Aldian – 2018-07-11T09:56:16.567

This worked for me on Windows 10 and saved my sanity. – shoelzer – 2018-10-18T15:01:09.573

9

I think I found a workaround for this issue by combining the ideas from these posts.

(my PC is Windows 10 TH2, Intel HD4600 with HDMI port, Changhong 4k monitor)

Here is the procedure.

  1. Delete all extra registry entries under ...GraphicDrivers\Configuration and GraphicDrivers\Connectivity, leaving only the entry corresponding to my monitor (MST00301...)

  2. Before putting monitor to sleep, just type "WIN" + "D" combo key to minimize all desktop windows.

  3. After turning on monitor, type "WIN" + "D" again to restore all windows.

Kang

Posted 2012-07-25T15:15:19.233

Reputation: 91

1

I think Win+D is not needed. After deleting all the entries and restarting the pc the external monitor is added again to the registration. After that it seems to work as expected. Maybe windows was confused of to many different configurations. In my case I had 12 entries and now there are only 2: https://www.maxrev.de/windows-position-von-apps-im-multi-monitor-betrieb-nach-aufwachen-t366585.htm#pic462673

– mgutt – 2016-04-05T15:22:52.740

This worked for me, but only after correcting the new SIMULATED_ ... key. After the restart, I had two new entries under Configuration and Connectivity. The SIMULATED_ 00 entry had 1024, 768 and 4096 for cx, cy and stride values, which are wrong. I copied just those values from the other key, which appeared to be correct for my monitor, and rebooted. I have a single 40" 4K monitor, a Wasabi Mango UHD400 and problem is now fixed. – pixelgrease – 2016-09-10T15:21:39.073

For me, the Win+D trick works, even without altering the registry, which did not work. Note that the Desktop does not have to be minimized: the Desktop icons that are outside the 1024x768 box will not be moved after turning the monitor off and on again. Also, maximized windows do not suffer the resize/move problem. – Roland – 2018-02-22T13:29:20.537

5

Not all NVidia cards support the ability to fake the EDID, and it isn't just Sleep that causes this problem. If a monitor is turned off or disconnects briefly, it can wreak havoc on a carefully configured screen layout. As none of the solutions here worked out for me, I wrote a utility to restore the window positions when the number of monitors change. It is available with source code here.

Garr Godfrey

Posted 2012-07-25T15:15:19.233

Reputation: 394

1I've tested @GarrGodfrey 's program and it worked like a charm. – Kita – 2018-12-01T16:27:56.007

This also seems to work well for me, nothing else seemed to work, I'm on a Legion y540. – math0ne – 2020-01-15T20:03:04.930

2

In my case, with three 1920x1080 monitors arranged horizontally, it seems to have been fixed by going to the registry key mentioned in other answers (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration), finding the key starting with SIMULATED, then changing all the values of 1920 under that key to 5760 (1920 times three, for the three monitors).

I'm guessing the SIMULATED key is used for when the PC goes to sleep, but Windows still needs to maintain a desktop in the process of going to/resuming from sleep, even when the actual monitor(s) may not report themselves yet.

wmassingham

Posted 2012-07-25T15:15:19.233

Reputation: 578

This is what helped me the most. Your second paragraph especially seems to be correct. Though I still have windows move to other monitors when the screen is off. – Andrew – 2017-12-07T02:11:58.643

2

Usually this will be caused by the graphics driver not properly supporting sleep modes and therefore disabling the ability to detect a connected display when the computer goes to sleep.

Update your graphics drivers from the manufacturer to resolve the issue.

If the issue is still not resolved after updating the drivers, it may be due to an unusually reported display ID (EDID). You can usually force the detection of a monitor within the graphics driver control panel.

However if this is unavailable, you can use the Windows Resolution window to detect devices while the monitor is disconnected, then select the display which will report “Another Display Not Connected”, then under Multiple Displays, you can drop down and select “Try to connect anyway” which will broadcast a signal to the monitor over the port type you have selected (the signal will not be interactive), then connect the display which should interpret the signals sent to it properly.

The forced resolution will override detection of the screen and should persist through sleep.

WinOutreach2

Posted 2012-07-25T15:15:19.233

Reputation: 41

Do you know a way to enable this setting if the monitor is still connected? I wonder if that will fix my windows slightly moving after wake. – Ahmed – 2019-11-01T03:55:44.383

I tried turning off a monitor (while the VGA cable is still connected) and it disappears from the multiple display configuration in Windows 10. Even after clicking Detect it doesn't give me any way to "Try to connect anyway"... any ideas? – Ahmed – 2019-11-01T04:45:27.143

2

Same problem here with Windows 8.1 and Macbook Air 2013 (Intel HD Graphics 5000). I try everything. Finally I went to Intel updated with the latest drivers for my graphic card and the problem continues. Then I went to the graphics property, with my second display turn on in Multiple Display I choose 'Disconnect this display', then after the second display disconnected I select extend my desktop and the problem dissapear. Hope this works for you.

Andrew

Posted 2012-07-25T15:15:19.233

Reputation: 21

I also have a Macbook Air 2013 with latest drivers and that didn't solve my problem. Do you any ideas how can I solve it? – Andrew – 2014-07-08T14:20:57.210

1

For me, the fix was https://superuser.com/a/908156/238666 . Summary: Windows fails to read the EDID info from the monitor at wakeup, and in the Nvidia control panel you can save the EDID info to a file and set the pc to read it from that file, under the the Task: Workstation, View System Topology, EDID Source.

In my limited view, the root problem could be the Nvidia card, but also Windows, DisplayPort, or the monitor (Lenovo X1 4K)

Roland

Posted 2012-07-25T15:15:19.233

Reputation: 299

0

I solved with this little application:
https://github.com/hunkydoryrepair/MonitorKeeper/releases

Just run it, and it will be maintain windows in same posizion.
Thank you very much @hunkydoryrepair.

riofly

Posted 2012-07-25T15:15:19.233

Reputation: 209

0

Win Redock has worked best for my use case - which was restoring window positions after a display-change. Redock is automatic - saves and restores windows without any intervention. Its open source too.

So if your issue is that your laptop has a display hiccup when it wakes up, this might help you.

B T

Posted 2012-07-25T15:15:19.233

Reputation: 603

-1

Like it or not, but according to Dell's known problem with specific 4k monitors link: http://www.dell.com/support/Article/us/en/19/SLN295708/EN I had to switch from 59/60Hz to 30Hz on my 3 x Dell P2415Q 4K UHD on Intel 4600 connected with display's stock DP/mDP and it helped me - as Dell KB article says. It applies to UP3214Q and P2715Q too.

The issue didn't manifest on lower res QHD Dell U2515H + same video/PC

Registry keys removal and driver updates were not helping.

Upd 2018/08: And upgrading graphics card to NVIDIA Quadro P600 didn't fix the issue, so staying on 30Hz.

kuz8

Posted 2012-07-25T15:15:19.233

Reputation: 44

1Urgh, 30Hz is awful to use, so stuttery. – Simon East – 2017-03-19T23:51:45.017

@SimonEast, it's been a year since I posted this answer and use these 4K-s in 30Hz, being sensitive to fluorescent and LED flickering, and preferring DC 12V Halogen lighting where possible, I'd say 30Hz is OK on these 4K Dell monitors. Youtube action vids are relatively smooth, but I mostly use these screens for code, terminals, mails and chats - don't feel tired after 10-12 hours per day.. – kuz8 – 2017-03-21T02:13:03.557