App window placement with multiple monitors

Avatar
10

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.

Comments (10)

10 responses to “App window placement with multiple monitors”

  1. Avatar

    6852

    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.

    • Avatar

      5184

      In reply to ecumenical:

      My scenario is essentially yours--lock the machine for a meeting, come back in 15 to an hour, and bam, it is all screwed up.  Doesn't happen every time.  I've tried both two (SP4 and one HD display) and three display (SP4 and two HD displays) configs.

      I think it is related to the specific hardware, in this case, the Surface dock.  Although, I do, on rare occasion, see it with my primary dev machine at home, which has two monitors.  I suppose I should try eliminating the Surface dock to see if that's the culprit.  I've had other issues with the dock, so I'm not all that confident in it.

      • Avatar

        6852

        In reply to jwpear:

        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.

        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.

  2. Avatar

    843

    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.
    Experimenting with setting others as primary yields the same results.

  3. Avatar

    Pet jghgjh

    Easily we can learn the way to get the sims freeplay cheats online as we are into this phase of gaming online.

  4. Avatar

    MrRedSun

    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 could be the dock doing some power saving trickery.

  5. Avatar

    SWCetacean

    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.

  6. Avatar

    wright_is

    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.

    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...

    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.

    Why this was dug up out of the archives is a more interesting question...

  7. Avatar

    robinwilson16

    Yes same issue as others and have been putting up with it for years now, probably like the original poster!

    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.

    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.

    Also most of the time after resume notifications appear huge with only the corner visible on the screen.

    Hopefully they will fix it one day!

    I have formatted various times and it always has the same issue.

  8. Avatar

    kingbuzzo

    I have the same intermittent issue with HP EliteBook, HP dorking station and Viewsonic external monitors.


    You are not alone in this world...

Leave a Reply