App window placement with multiple monitors

What’s the secret to getting apps, or Windows on behalf of the apps, to remember their monitor placement in a multi-monitor setup using Windows 10?

I have two external monitors hooked up to my Surface Pro 4 at the office using a Surface dock.  The external monitors are 24″ HD displays (so non-High DPI).  I use them plus the Surface display. 

At least once a day, I return to my desk, unlock the device, and find that the app windows have all switched to a random display and resized themselves.  Everything is fine at other times.  It is absolutely infuriating and interrupts my dev flow. 

I’m not concerned about where they are when I start the apps.  I just want the running apps to remain on the monitor I placed them on across a lock/unlock.  That doesn’t seem like too much to ask.

I feel like this is a Windows bug, not a problem with the apps themselves.  It seems like Windows is, at some point, briefly losing knowledge of multiple monitors being attached.  Maybe the Surface is actually going into a sleep state and that’s what is confusing Windows.

I haven’t written any Win32 desktop apps in 10 years–I’m pretty much web app exclusive these days–so I don’t know if detecting and remembering which monitor an app is running on is something expected of an app dev.  Seems like Windows should manage that, especially across a lock and unlock.  I could see expecting the dev to do that across restarts of the app.

Found a few things on the web, but most are hacks or apply to W8.  Appreciate any help.

Conversation 10 comments

  • 6852

    18 January, 2017 - 3:09 pm

    <p>Huh. That’s weird and definitely a problem. Just as an anecdotal data point, I can tell you I plug an external monitor into my laptop every single day, lock it or let it go to sleep over lunch or meetings nearly every day, and have never seen this happen. Windows always stay right where I put them. The laptop even knows that the external display is the primary monitor and moves my main taskbar, login page etc. over to that screen each morning when I plug it in.</p>

    • 5184

      Premium Member
      19 January, 2017 - 9:29 am

      <blockquote><em><a href="#37535">In reply to </a><a href="../../../../users/ecumenical">ecumenical</a><a href="#37535">:</a></em></blockquote>
      <p>My scenario is essentially yours–lock the machine for a meeting, come back in 15&nbsp;to an hour, and bam, it is all screwed up.&nbsp; Doesn’t happen every time.&nbsp; I’ve tried both two (SP4 and one HD display) and three display (SP4 and two HD&nbsp;displays)&nbsp;configs.</p>
      <p>I think it is related to the specific hardware, in this case, the Surface dock.&nbsp; Although, I do, on rare occasion,&nbsp;see it with my primary dev machine at home, which has two monitors.&nbsp; I suppose I should try eliminating the Surface dock to see if that’s the culprit.&nbsp; I’ve had other issues with the dock, so I’m not all that confident in it.</p>

      • 6852

        19 January, 2017 - 10:36 am

        <blockquote><em><a href="#37664">In reply to </a><a href="../../../../users/jwpear">jwpear</a><a href="#37664">:</a></em></blockquote>
        <p>Yeah, might be worth looking into the dock as a source of trouble. Mine is just a direct HDMI cable to my laptop’s port.</p>
        <p>Things can also get messed up in Windows if the resolution changes – I don’t know why that would be happening, but your description reminds me of what happens on my multi-monitor system at home when I launch a game in a non-native resolution. I close the game, and even though the resolution automatically reverts to normal the window locations and sizes are all screwed up.</p>

  • 843

    19 January, 2017 - 8:50 am

    <p>Same here, although I use 3 screens on my work computer and every time it turns off the screens (every 30 mins.) I have to reposition open windows from the central screen as it is defined as the primary.<br />Experimenting with setting others as primary yields the same results.</p>

  • Pet jghgjh

    22 February, 2017 - 8:05 am

    <p>Easily we can learn the way to get <a href="http://freeplaycheats.com/&quot; target="_blank">the sims freeplay cheats</a> online as we are into this phase of gaming online.</p>

  • MrRedSun

    Premium Member
    25 July, 2019 - 8:45 pm

    <p>You should check in your monitors' settings to see if they're turning off their DisplayPort (usually it's a power saving mode). I think that makes Windows unable to detect them, so it shifts all those windows to the displays that it thinks are still connected. If it's not your monitors, it <em>could</em> be the dock doing some power saving trickery.</p>

  • SWCetacean

    Premium Member
    25 July, 2019 - 8:56 pm

    <p>I'm also going to say that it's a hardware issue with either the dock you're using, or the Surface, or the monitors. I have a Thinkpad X1 Carbon 5th gen connected to a Lenovo Thunderbolt 3 dock with 2 monitors attached: one via HDMI and the other via a USB-C-to-HDMI converter cable. I've never seen what you experienced. I can lock my computer, leave the office for the night, and come back the next morning and every single window is exactly where I left it. And do this every day for weeks at a time.</p>

  • wright_is

    Premium Member
    26 July, 2019 - 4:15 am

    <p>I think it is a docking issue. I had the same problem with my Surface Pro 3 and the original Surface Dock. When I came back, it would have shoved everything on the primary display or the internal display. But not every time.</p><p>It seems that there is something about sleep/waking of the monitors that causes the problem, maybe the dock or a monitor registers too slowly, when the user comes back and the monitors are brought back out of stand-by, it only sees one monitor in the time allowed, shoves everything on that display and then the other one comes back…</p><p>On my Lenovos, with traditional dock, USB-C dock and Thunderbolt Dock, I've never experienced this problem. Same for the Dells we have here.</p><p>Why this was dug up out of the archives is a more interesting question…</p>

  • robinwilson16

    26 July, 2019 - 6:57 am

    <p>Yes same issue as others and have been putting up with it for years now, probably like the original poster!</p><p>Surface Pro 4 with Surface Dock always seems to randomly shove things onto different screens as soon as the PC goes to sleep so if I go to make a coffee or answer a call, when I come back I need to put everything back where it was.</p><p>It isn't even necessarily the primary monitor; what was maximised is now not and things can even switch places with each other between screens like it was just designed to be annoying.</p><p>Also most of the time after resume notifications appear huge with only the corner visible on the screen.</p><p>Hopefully they will fix it one day!</p><p>I have formatted various times and it always has the same issue.</p>

  • kingbuzzo

    26 July, 2019 - 2:54 pm

    <p>I have the same intermittent issue with HP EliteBook, HP dorking station and Viewsonic external monitors.</p><p><br></p><p>You are not alone in this world…</p>

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC