PersistentWindows: Prevent your Windows from moving around when you switch monitors

Discussions of applications and operating systems and any problems, tips or suggestions. Win XP, 9x/2k, Linux, NT, photo editing, Virus/Spyware help
Post Reply
User avatar
FlyingPenguin
Flightless Bird
Posts: 32783
Joined: Wed Nov 22, 2000 11:13 am
Location: Central Florida
Contact:

PersistentWindows: Prevent your Windows from moving around when you switch monitors

Post by FlyingPenguin »

I have a main monitor on a KVM switch, so I can use it on the workstation and gaming PC. My gaming PC also has a secondary monitor. If I switch away from the gaming PC, sometimes Windows moves all the windows back to the second monitor (because it no longer senses the main monitor is connected), and then when the main display is switched back, all the windows get moved back to the main monitor in random locations, and I have to put them back where they all belong. Annoying.

This is more of an issue with DisplayPort, as most (but not all) HDMI KVMs will send a fake "I'm still connected" signal to the computer when you switch away the monitor (for technical reasons this is harder to implement in DP). This is also a common problem if you use the monitor's internal input switch to switch between computers.

Found a recommendation for a simple little background app called PersistentWindows that fixes this:

https://github.com/kangyu-california/PersistentWindows

No installer. Read the instructions. You have to put it in a folder (I strongly recommend the C root because I had issues putting in in the Program Files folder), and you have to execute a batch file to setup a task scheduler entry for it, and then you need to manually open the executable the first time (after that it auto launches on Windows start).

Nothing else you have to do. It just sits in the task bar notification area. It does have the additional feature of allowing you to save and restore snapshots of your windows locations manually, but in the background it just restores your Windows positions automatically if it sees a monitor is disconnected.
Christians warn us about the anti-christ for 2,000 years, and when he shows up, they buy a bible from him.

Image
User avatar
Executioner
Life Member
Posts: 10141
Joined: Wed Nov 22, 2000 11:34 am
Location: Woodland, CA USA

Re: PersistentWindows: Prevent your Windows from moving around when you switch monitors

Post by Executioner »

If this is an issue with the display port, do you think they will have a software or hardware patch to fix it?
User avatar
FlyingPenguin
Flightless Bird
Posts: 32783
Joined: Wed Nov 22, 2000 11:13 am
Location: Central Florida
Contact:

Re: PersistentWindows: Prevent your Windows from moving around when you switch monitors

Post by FlyingPenguin »

It's not an issue with DP itself, so no. HDMI and DP (even later versions of DVI) use a protocol called EDID to talk to the PC to tell it things like "I am a monitor of such and such resolution, supporting such and such refresh, and I am connected". Unlike the VGA era, when you could unplug the monitor, and Windows would just continue to assume that monitor was still connected, unplugging an HDMI or DP monitor tells the PC that no monitor is connected anymore. If you have a second monitor, then Windows moves all the open windows and desktop icons to that monitor.

So in order to avoid this, a KVM (or even a switched monitor input) with EDID basically needs to simulate a monitor and send the proper EDID data back to the PC.

DisplayPort KVMs are VERY expensive (like starting around $150) and adding EDID to it would add even more cost, and I am told it's a quite bit more complicated to emulate EDID in DP versus HDMI. So there are very few KVMs or monitors that support simulating EDID when the monitor is not connected to the PC.
Christians warn us about the anti-christ for 2,000 years, and when he shows up, they buy a bible from him.

Image
User avatar
Losbot
Almighty Member
Posts: 4992
Joined: Sun Jul 13, 2014 8:59 am
Location: South Florida

Re: PersistentWindows: Prevent your Windows from moving around when you switch monitors

Post by Losbot »

Good find!
------------------------------------------

Image
User avatar
FlyingPenguin
Flightless Bird
Posts: 32783
Joined: Wed Nov 22, 2000 11:13 am
Location: Central Florida
Contact:

Re: PersistentWindows: Prevent your Windows from moving around when you switch monitors

Post by FlyingPenguin »

I will mention that I had an issue with this and uninstalled it. It was causing a stutter in games when looking up quickly.
Christians warn us about the anti-christ for 2,000 years, and when he shows up, they buy a bible from him.

Image
Post Reply