110

I'm using latest Windows 10. I have dual monitors and am working on software development. I move Visual Studio to second monitor to work on it.

When I lock wndows and leave computer and go somewhere and come back after 20-30 min both laptop and second external monitor is black and I need to enter my password. When I unlock the computer Visual Studio 2017 moves to the primary (laptop) diplay.

Everytime I have to move Visual Studio again to second monitor. Is there a way to solve this problem?

2
  • My new monitor is bit slow to wake up from sleep and does exactly what you describe. Previous monitor was DVI-D -connected, new one is DisplayPort. If only I could instruct Windows to wait a bit longer. Nov 16 '20 at 18:58
  • Since I can't add an answer, I will write this comment. Make sure to have the same Response Time set to Normal on both monitors, change the Display Port version to 1.2 (if you have one and if possible) and go to Device Manager and click Update Driver on both monitors and let Windows find the driver for you on the internet. Also disconnect any other cables and let only the 2 cables you use. This solved my issue. Might help others, since it was so annoying.
    – Dan
    May 27 at 13:37
63

A similar case on Microsoft Community mentioned a workaround, have a try.

  1. Start Control Panel --> Device Manager
  2. Select View --> Show hidden devices
  3. Expand Computer --> Monitors*

When you expand the Monitors you will see your current monitor (highlighted) and all the disconnected monitors (greyed out). You may see monitors with "non-PNP" and "PNP" listed as well. I believe these are aliases to your current monitor (at a lower resolution) before Windows installed drivers for it.

I uninstalled ALL the greyed out monitors. Right-click on these monitors and select uninstall. Keep only the highlighted monitor you are currently using.

  1. Uninstall all greyed out monitors (even non-PNP and PNP monitors)
  2. Reboot your system.

After doing this my windows don't resize after my monitor goes to sleep. You can quickly test this by temporarily setting your monitor sleep time to 1 minute.
Settings --> System --> Power & Sleep --> Screen [1 minute]

Source: https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-10-multiple-display-windows-are-moved-and/2b9d5a18-45cc-4c50-b16e-fd95dbf27ff3

9
  • 36
    This workaround has no effect whatsoever on my system.
    – queezz
    Mar 22 '19 at 6:43
  • This worked perfectly for me. After upgrading graphics card the chrome window was on the main monitor after each wake-up from sleep. Now after uninstalling all grayed-out monitors its fine like it was before. Thanks
    – KYL3R
    Jun 1 '19 at 7:38
  • The flickering of the screens went away completly, so definitely a big improvement! The windows still move all to the same monitor though.
    – BluE
    Jul 10 '19 at 12:12
  • not working for me Oct 19 '19 at 5:31
  • 1
    In the end: I also had to do this superuser.com/a/1187076/19496 i.e. never turn off monitors.
    – user19496
    Jan 4 '20 at 8:14
8

TL;DR - if the windows are moving to a VGA connected monitor, it looks like there are three options, in order of "fixed" to "workaround":

  • Change the connection to that monitor to something other that VGA (changing to DisplayPort connection fixed it for me)
  • Make the VGA monitor the Primary Monitor.
  • Unplug the VGA monitor, then plug it back on each resume.

I had this problem - all the windows shifted to one monitor on resume from sleep / hibernate. The LCD monitor the windows shifted to was connected by VGA cable - my primary monitor is connected by DisplayPort, plus the laptop display.

Turning off the VGA monitor didn't force the windows to shift back to the primary monitor, but unplugging the VGA monitor did force the windows back.

I guess that the VGA connection does not report that the monitor is actually off, just that there is a monitor present, and Windows detects it before the DisplayPort connected monitor or even the internal laptop display, so moves the Windows to the VGA monitor.

Fortunately, the VGA connected monitor also has DisplayPort connection, so I changed the monitor to DisplayPort, and the problem was resolved.

7
  • I can´t believe it was so simple to solve this. Had an HDMI cable forgotten into a drawer for almost 1 year of dragging 3+ screens back to the second monitor after unlocking the screen. Thnak you very much, sir.
    – Mudo
    Jan 22 '19 at 16:18
  • 9
    Now having this problem with to identical monitors connected to two DisplayPorts.
    – queezz
    Mar 22 '19 at 6:46
  • 1
    I too am now suddenly having this issue after switching from 2 old hdmi to new 2 displayport monitors! May 4 '19 at 0:02
  • For me the monitor that is connected through DVI is the dominant one, compared to two others, which use DisplayPort.
    – BluE
    Jul 10 '19 at 12:14
  • I have on each on VGA and HDMI. Making VGA primary did work initially for me but, the issue suddenly came back for no apparent reason after about 2 weeks - doomed! Going back to Win7 :D
    – zumek
    Apr 14 '20 at 10:35
8

It was stated that:

"The technical term for the problem is "Rapid Hot Plug Detect," but with the latest Windows Insider build 21287 or above, Microsoft has worked to mitigate the issue. With this release, when you wake up from a sleep, all your windows should appear where you previously left them.

You'll need to join Microsoft's Insider program to get the new feature, which will work by default if you're connected to at least one external monitor with a laptop, or two monitors on a desktop setup. It should also work across brands, hardware specs and connector types. If you're not willing to join the beta program to test it right now, Microsoft is expected to ship the final version by October, 2021."

(reference to original article)

It works for me after waking up from sleep! However, it does not work after waking up from hibernate. Hopefully, Microsoft is planning fixing this as well for the upcoming update.

1
  • So this is the fix that they talked about in the Windows 11 presentation, that is supposed to keep windows on the same display. I hope this will work.
    – Henk Poley
    Sep 29 at 7:09
6

The currently accepted answer by Origami does not work for me.

But this workaround helps, although far from a complete solution.

Prerequisites:

  • system must be locked before going to sleep (lock it by the key combination WINDOWS-L and let it then go to sleep or make sure it locks by itself before sleeping - maybe with screensaver settings, I always lock manually, so did not test this; just letting the PC go to sleep (unlocked) will not work, even if it asks for the password when waking up)

Workaround:

  • when the monitors are sleeping, move the mouse
  • wait until the monitors turn on
  • the monitors might blink once or twice, just give them good 5 or 10 seconds, so they are 100% on and detected by Windows
  • press a key, mouse button or ctrl-alt-delete, depending on Windows configuration, so that the login screen appears, asking for password
  • enter password and unlock the PC

Result:

  • windows are where they were left

Sometimes only some windows stay at their position and some get moved to the main display even if you do the described workaround. I guess there is nothing more to do than wait for Microsoft to fix this.

5

I ran into a similar issue and the answers that were provided here did not resolve the issue. After a few searches, I found a GitHub app that did resolve it. Take a look at PersistentWindows. So far it has worked well for me.

(Note: I have no affiliation to PersistentWindows.)

1
2

This worked for me: https://sites.google.com/site/ebobster/stuff/displayportblanking

Bottom line: Go into your NVIDIA control panel (or whatever software you have) and change the EDID source from "monitor" to "file." You do this by exporting the settings for each file, then import them again. Now your monitor doesn't determine the setup, the file does.

In this screenshot, where you see "File", it used to say "Monitor."

enter image description here

4
  • Windows 10 GeForce RTX 2080 I don't have View System Topology, I think this is only on older cards. I found this nvidia.com/en-us/geforce/forums/discover/239683/… May 6 '20 at 3:44
  • GTX 960 running nVidia CP 8.1.959.0. There is no Workstation option in the tree. I checked all available options. Nothing for EDID Source.
    – OXiGEN
    Jan 5 at 23:33
  • 1
    This only applies to Nvidia professional workstation graphics cards. The Workstation section is not available when using consumer gaming cards.
    – anders-hou
    Jan 6 at 21:36
  • 1
    This works fine for me on my laptop w/ external displays. The only clarification to make is to hit "Export EDID" for each file then go to the middle tab (Load) and load the file and check the box for the monitor it applies to. I named my exports "monitor1.txt" and "monitor2.txt" for easier tracking. Thanks for the solution!
    – Nick
    Aug 9 at 17:42
0

Update: It only worked a couple of times after restart. After screen turns off due to powersaving on lockscreen, and unlock, seemed like it didn't work due to switching monitors displaying the main lockscreen (so presuming it also switched the screen setups).

Edit the Windows Registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TMM\UseIViewHelper to 0. Also despite the source saying it only works on mobile computers, it worked on desktop for me. This worked for me, source: https://endurtech.com/second-monitor-on-windows-10-resets-after-sleep/

For this fix, we’ll need to update the Windows Registry (be sure to backup first). Click on “Start” then type “regedit” and press the enter key on your keyboard. Within the Registry, copy and paste the follow path into the address bar at the top of the Registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\

We should now be on the “Microsoft” folder. Expand this folder and look for a sub-folder named “TMM“.

If the TMM folder exists, double click on it and look for an entry labeled “UseIViewHelper“. Set value to 0. If UseIViewHelper does not exist, right click on the TMM folder and create a new DWORD (32-bit Value) with the name “UseIViewHelper“. Set the Value data to 0 with a Hexadecimal base. If the TMM folder does not exist under the Microsoft folder we need to create it. To create this folder/key go to the parent “Microsoft” folder and right click on it. From the context menu select “New” then “Key” and insert “TMM” without the quotes. Right click on the newly created TMM sub-folder and create a new DWORD (32-bit Value) with the name “UseIViewHelper“. Set its value to 0 with a Hexadecimal base.

-1

I had a similar issue, but only on wake-up after hibernate. Sometimes after connecting to second monitor in "extended desktop" configuration, I could only interact with windows on the first display (laptop). Rebooting of course was fixing the issue, but the point of hibernate is not being forced to start work from scratch every time I wake up the system.

Today I've finally found that "dwm.exe" process (Desktop Windows Manager) was duplicated for some reason. And apparently some configuration was not restored properly for my user session. After restarting the right process as Administrator, all went back to normal.

What I did was to:

  1. open command prompt as administrator (open Start, type "cmd.exe", right-click and select "Run as Administrator")
  2. run "taskmgr.exe" in this command prompt window (with elevated privileges)
  3. switch to the "Details" tab
  4. search for "dwm.exe" process(es) and use "End Task" button or from context menu
  5. necessary DWM process should restart itself for your user session, while the "wrong" processes should just end without notice

Warning: I immediately noticed that Chrome browser did not respond well to the restart of dwm.exe process; all Chrome windows were black. Firefox did not have such issue. Luckily, just trying to open a new Chrome window by pressing Ctrl+N shortcut helped with this.

1
  • Interesting thing to note here is that some time after I posted my workaround above in aforementioned thread on Microsoft Community, some update to Windows 10 fixed my issue completely. Hooray! :) I mean, the dwm.exe process is sometimes restarted automatically after connecting back the monitor, and I didn't need my own "solution" for a long time. Jan 16 '20 at 8:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.