hunkydoryrepair / MonitorKeeper

Return windows to their rightful place when changing monitors.
MIT License
238 stars 13 forks source link

Handle multiple reconnects in succession. #11

Open ZeekDaGeek opened 2 years ago

ZeekDaGeek commented 2 years ago

Allow me to describe the scenario first.

Here's what the device disconnect/connect sequence sounds like to better show the point: https://zeekdageek.tv/d/reconnectsounds.mp3

After the first disconnect it appears as if MonitorKeeper will move everything back into place. During the seconds disconnect 50% of the time it seems like it will save all of the window positions onto one monitor and on the second reconnect it will keep everything on one monitor.

Would it be possible to make it so MonitorKeeper doesn't make any saves for a certain amount of time after a reconnect, or maybe if two reconnects happen quickly it tries to go back one extra save?

hunkydoryrepair commented 2 years ago

Makes sense, I think. The monitor must be disconnecting before monitor keeper has a chance to reposition the windows, so it saves the "bad" positions when it disconnects. Worth looking at for sure.