71

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?

| |
49

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

Start Control Panel --> Device Manager Select View --> Show hidden devices 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.
Uninstall all greyed out monitors (even non-PNP and PNP monitors) 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]

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

| |
  • 20
    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 – HelloWindowsPhone Oct 19 '19 at 5:31
  • Confirmed as working 2020-01-02. I did "Uninstall device" to all grey icons except "Location: on Microsoft Basic Display Driver". – user19496 Jan 2 at 10:49
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.

| |
  • 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
  • 4
    Now having this problem with to identical monitors connected to two DisplayPorts. – queezz Mar 22 '19 at 6:46
  • I too am now suddenly having this issue after switching from 2 old hdmi to new 2 displayport monitors! – John Gardner 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 at 10:35
1

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

| |
1

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.

| |
0

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

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.

| |
  • 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. – wiktor.wandachowicz Jan 16 at 8:41

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