Wednesday, December 3, 2014

Windows changing size & position after monitor sleep

I recently updated my old 24" Dell monitor to a 32" Acer B326HUL, love it! But I found that when the monitor went to sleep, the windows got resized to a smaller res, as well as all the desktop icons got rearranged. Digging around on the internet found that Windows somehow remembered 1920x1200 as the res, and resizes all windows to fit that when coming out of sleep.

So the fix is registry magic!
In this register tree:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\

there is at least an entry per monitor; I had a DELxxxxxxxxxx and an ACRxxxxxxxxxx one, and under the 00 node, there are two parameters to check out there:
PrimSurfSize.cxPrimSurfSize.cy and Stride.

These should match your current monitor.

A little below you should see these entries:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\SIMULATED_xxxxxxxx

inside, you will also find under the 00 node, and those parameters pointing to the old sizes. Use the values from above, and also change under the remaining 00 node the ActiveSize.cx & ActiveSize.cy entries to match. Log off or restart and voila!



References:
https://social.technet.microsoft.com/Forums/en-US/4d8f3aef-8c04-481b-a69a-ec0fbf3669c2/turning-off-display-resizes-open-windows?forum=w7itproperf
http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-movesresizes-windows-on-monitor-power/1653aafb-848b-464a-8c69-1a68fbd106aa?page=2

13 comments:

Chip Malee said...

I believe this is the video version.
https://youtu.be/bh-qFXOWoyo

Grim Bonkers said...

Did the exact thing. Problem not solved. When I turn of the monitor and turn it back on, all windows get squeezed in the upper left corner and are very small.

(windows 7, monitor conencted with DisplayPort)

Basic said...

Note that by default the values are entered in HEX not DECIMAL. Make sure you select decimal before typing any numbers.

Thaty said, I don't have a SIMULATED_ node at all. I do have a MSNILNOEDID_ which doesn't seem to relate to any valid display but changing the settings under there doesn't seem to have any noticeable effect.

ChangeTheFuture said...

Unfortunately not. There’s no SIMULATED key inside “Configuration” for me.

Windows 10.

Chris said...

Thanks for this as the problem has been driving me up the wall... I'm on Win 10, NEC EA275UHD 3840x2160 monitor, Nvidia Quadro K5000 with displayport... I found the SIMULATED registry entries and changed all 3 of them...

Crispian Longlife said...

I have windows 10 and was having this problem on my 3440 x 1440 (native) Asus ultra wide screen monitor (Display Port connection) and 27" DELL 2407 monitor 1920 x 1200 (native) DVI connection. Using NVIDIA GeForce GTX 980 Ti graphics card.
I have no simulated registry entries. I decided not to try to fiddle with the registry even though some entries were not set to the above resolutions. I have about 6-7 entries under the configuration directory. After reading through several comments. I saw the scaling comment.
In my NVIDIA Control panel I disable scaling for both monitors. So far this worked!
The windows remained in place once the computer woke from sleep mode. YAY!

lifesgood said...

Disabling scaling in the NVIDIA Control panel worked for me. Thank you Crispian Longlife!

I have a Samsung UHD4K 3840 x 2160 40 inch TV connected with HDMI as my primary monitor and a old 1680 x 1050 monitor on DVI as a secondary with a NVIDIA GeForce GTX 970 graphics card.

silt sunrise said...

I didn't have the simulated entries, but one of the 4 I did have, showed a lower res than my monitor uses. I changed those values and wahla, they stuck. No more shrinking windows after sleeping!

Ian Grainger said...

How do I apply this if I have multiple monitors? The numbers I see in there match my old monitor connection, but also my current laptop monitor...

Is there no way to reset this? I don't suppose deleting them will cause Windows to recreate them with correct values, for e.g.? Or even better a nice way to get Windows to forget this monitor's properties so it can re-learn them correctly!

R Caloca said...

If I got frustrated enough, maybe I would just delete the full Configuration folder :)
In theory you can backup those registry keys/tree, so it shouldn't be that bad... But that's just in one of those throw the PC against the wall moments!

Ian Grainger said...

OK - so no idea how to deal with multiple monitors? I've given up and gone for it - changed all 3 to match my larger external monitor. Will just see if it works! :-S

Ian Grainger said...

OK - so no idea how to deal with multiple monitors? I've given up and gone for it - changed all 3 to match my larger external monitor. Will just see if it works! :-S

R Caloca said...

Nope, hasn't been at issue at work (where I have dual monitors); at home I only have one :|