Want to earn a free DisplayFusion Pro license? We're looking for DisplayFusion translators!
<< Discussions<< NewsReply
Automatically Saving and Restoring Window Positions on Dock/Undock

Undocking and re-docking a laptop to external monitors can be frustrating at times, due to the fact that when you undock, Windows moves all open applications to the laptop monitor. When re-docking, the applications don't automatically move back to the external monitor(s). With the latest DisplayFusion 8.0 Beta, you can solve this issue by automatically saving and restoring the window positions using DisplayFusion's new "Triggers" feature. The steps below explain how to configure the Trigger rules in order to achieve this. The two Trigger rules below will make DisplayFusion save the window positions every 2 minutes when docked, and restore the window positions when re-docking.

  1. If you haven't already, make sure to update to the latest DisplayFusion 8.0 Beta.
  2. First, save your docked layout as a new Monitor Profile.
  3. On the Settings > Triggers tab, click "Add."
  4. From the "Trigger Event" drop-down, choose "Timer Interval."
  5. Set the "Interval" to 120 seconds.
  6. Enable the "Monitor Profile" checkbox, and choose the Monitor Profile that you created in Step 1.
  7. Below the Actions Pane, click "Add," then "Run Function." Choose the "Save Window Positions" function from the list, then click OK.
  8. Click OK to save the Trigger rule.
    Save Window Positions Trigger

  9. Click "Add" again to open up another new Trigger rule.
  10. From the "Trigger Event" drop-down, choose "Monitor Profile Changed."
  11. Enable the "Monitor Profile" checkbox, and choose the Monitor Profile that you created in Step 1.
  12. Below the Actions pane, click "Add," then "Wait." Enter 5000 in the Wait Time dialog, then click OK.
  13. Below the Actions pane, click "Add," then "Run Function." Choose the "Restore Window Positions from Last Save" function from the list, then click OK.
  14. Click OK to save the Trigger rule.
    Restore Window Positions Trigger

To test this setup, dock your laptop and open some windows on the external monitor(s). Wait more than 2 minutes so that the "Save Window Positions" Trigger has a chance to run, then undock, and re-dock. About 5 seconds after re-docking, DisplayFusion should automatically restore the window positions.

Apr 11, 2016 (modified Apr 13, 2016)  • #1
Avatar from Gravatar.com
tpolz
13 discussion posts
Thank you so much for posting this. I've been wanting to do this for a few years (since the day I downloaded displayfusion). Works like a charm.

So, I thought it was working like a charm. Turns out that the time interval trigger is ignoring the monitor profile condition. DisplayFusion saves my window positions regardless if I'm docked or not. I started a discussion over here: https://www.displayfusion.com/Discussions/View/trigger-time-interval-ignores-monitor-profile-condition/?ID=d2bcc7b0-f025-4674-ab81-4147d433545d

Beta 6 has been released, and it does indeed seem to be working like a charm now.
Apr 11, 2016 (modified May 5, 2016)  • #2
Avatar from Gravatar.com
papadi
44 discussion posts
I don't understand how you can say this. This solution is a hack. First of all, now I get a notification every time the window state is saved! Also, if the window positions are lost if last save was done during these 2' intervals. And if I have multiple window profiles then it gets more complicated and unreliable.

I think it would be easier if, instead of restoring windows to their last position, to restore their initial positions by re-applying the window creation rules.
May 19, 2016  • #3
Avatar from Gravatar.com
tpolz
13 discussion posts
Papadi, I agree that if you have more than one monitor profile you want to save, this is not a good solution. However, you can disable the pop up balloons in advanced settings > General > Don't Show Tray Icon Notification Balloons. I've actually had the balloons disabled for years, so didn't even notice this was happening.
May 19, 2016  • #4
Avatar from Gravatar.com
papadi
44 discussion posts
That's a good tip. Still this is a hack though. I was expecting a better solution.
May 19, 2016  • #5
Avatar from Gravatar.com
tpolz
13 discussion posts
Yes, I would ideally like displayfusion to remember where every window was on every monitor profile, even after the window is closed or the computer restarts. I would love for every window to pop up based on the last known location for that profile. I'm just happy for this baby step (hack).
May 19, 2016  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@papadi: Thanks for the feedback. The other request for re-running the rules is still open on our list, so we'll follow-up when we've been able to do that.

Thanks!
May 19, 2016  • #7
Avatar from Gravatar.com
Douglas Bailey
1 discussion post
Quote:
Yes, I would ideally like displayfusion to remember where every window was on every monitor profile, even after the window is closed or the computer restarts. I would love for every window to pop up based on the last known location for that profile.


Seconded; this is how I hoped DisplayFusion would work when I first tried it.
Jun 16, 2016  • #8
Avatar from Gravatar.com
TTE
15 discussion posts
I third this request.

Back in the WinXP days, there was a lovely little application that let you reposition application buttons on the taskbar and remember their location---for every time you ran the application. You could also set window location, monitor location, and window size for every time you used that application. This functionality can't be terribly difficult to implement.

I use 3 monitor profiles: Laptop only, Work (laptop display and external 1920x1080 monitor), Home (laptop display and external 1680x1050 monitor).

An example of what I'm looking for: Every time I open my email program, I want it far left of the leftmost display (my laptop display is always on my left). And I want the taskbar button far left as well, on the proper display's taskbar. And I want that to happen for every monitor profile.

I'm sure people would also like to customize which display they want applications to open or appear on depending on monitor profiles, too. I find the existing functionality unreliable. And the trigger scripts do not seem to work for me.

Please, please implement this seemingly somewhat basic and essential functionality.

Thank you, and thank you for the recent improvements to DisplayFusion. I find it essential to managing my computer working environment.
Jul 4, 2016  • #9
Avatar from Gravatar.com
papadi
44 discussion posts
Are there any news about this topic? This hack never worked on my machine. I don't know why.
Window positions are saved every two minutes (I see the corresponding notification). But for some reason the trigger that is supposed to restore the positions never runs, even though I see that the monitor profile is restored and appears as selected after docking. I added some 'Show Notification' steps to my trigger for debugging purposes and they don't show up either.
Aug 4, 2016  • #10
Avatar from Gravatar.com
tpolz
13 discussion posts
Papadi, I had trouble with my initial trigger as well. I don't know what caused it (maybe I had the wrong profile selected or disabled the trigger on accident). I deleted the trigger and started over. The second time everything worked. If you already tried starting over, sorry, I have no other suggestions.
Aug 4, 2016  • #11
Avatar from Gravatar.com
brianbasden
7 discussion posts
Not working for me either, and it's really a pain to reposition 10-20 windows every time I redock my laptop...
Aug 4, 2016  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@papadi and @Brian: If you can backup your settings (Settings > Options > Export) and send them to us (https://www.displayfusion.com/Support/#contact), we can check them out to see if anything might be amiss.

Thanks!
Aug 5, 2016  • #13
Avatar from Gravatar.com
mergleh
1 discussion post
For those having trouble with this, I could not get it to work until I created a monitor profile when the laptop was not docked. The "undocked" profile is not in any trigger or anything, I just created it and saved and after I docked it worked.
Sep 1, 2016  • #14
Avatar from Gravatar.com
mhawk
4 discussion posts
Is there a way to disable the notification appearing every two minutes now??
Oct 27, 2016  • #15
Avatar from Gravatar.com
tpolz
13 discussion posts
Yes, but it disables all popups, not just that single popup. Settings > Advanced Settings > "Don't Show Tray Icon Notification Balloons" > double click.
Oct 27, 2016  • #16
Avatar from Gravatar.com
mhawk
4 discussion posts
Thanks @tpolz!
Another thing is that restoration of the layout takes quite long... it processes roughly one window per second - so it's necessary to not to touch the pc for a while until it finishes layout restoration process.
Could it be optimized in some way? e.g. don't touch the windows which are already in correct place (same position, screen and size as in the saved layout) and restore all the others simultaneously, not one after another?
Oct 27, 2016  • #17
Avatar from Gravatar.com
tpolz
13 discussion posts
It doesn't take that long for me. It only takes a second or two to restore all windows to the correct location. Maybe it's just a difference in our hardware? Hopefully, the developers can help you out.
Oct 27, 2016  • #18
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@mhawk: Mine only takes a couple of seconds as well. How many windows do you have open?
Oct 28, 2016  • #19
Avatar from Gravatar.com
mhawk
4 discussion posts
It's quite usual for me to have ~20-30 windows open. But the issue is I'm seeing that even apps which are at the same exact place (screen) and size (maximized) as they have been saved with, they are getting focus one after another, maximizing again.
Maybe it's because after I dock the laptop, one of the external screens becomes the "main" one. Then the OS moves all apps to the main screen, and then DF kicks in to restore the layout. I think DF should just ignore the windows which are already positioned correctly, not focusing them / forcing resize.

I suppose that some more debug info from my side could be useful, I may also try to record a video showing the issue.
Nov 1, 2016  • #20
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
That actually clarifies it a bit more. DisplayFusion does leave windows that are already in the right place alone, except if they're maximized or minimized. We used to leave those alone as well, but what we found was that Windows bugs out the maximized/minimized windows sometimes, so leaving them alone would actually end up leaving them in a messed up state, where they're still reported as maximized but aren't actually the correct size. To get around that, we made DisplayFusion restore, then re-maximize or re-minimize the maximized/minimized windows. That way they will definitely be in the correct position after restoring on all systems.

Hope that makes sense!
Nov 1, 2016  • #21
Avatar from Gravatar.com
dragon788
1 discussion post
Quote:
Quote:
Yes, I would ideally like displayfusion to remember where every window was on every monitor profile, even after the window is closed or the computer restarts. I would love for every window to pop up based on the last known location for that profile.


Seconded; this is how I hoped DisplayFusion would work when I first tried it.


@Douglas @tpolz If you try the "Window Layout Backup" application does it work as you are hoping? One thing I've noticed is that this application is aware of how many monitors were connected when it saved the layout and it indicates the number of monitors on the saved session so you know which state you are going back to. I'm hoping to move to the native DisplayFusion functionality, but I'd definitely like the ability to simply save periodically (I think it does 5 minutes) and restore to any point in time, but default to the most recent save that matches my current "profile" ie: 'docked at 9:17am' a session is captured due to the timer, then I 'undock at 9:20am' for a meeting and a few snapshots are saved while I'm in the meeting, but when I get back to my desk at 10:04am I want it to restore to the 'docked at 9:17am') state, while leaving the windows that I opened while in my meeting alone if they weren't ones I had open prior to undocking. If I did have them open prior to undocking but I manipulated them I would expect their positions to be restored to the docked state.
Dec 16, 2016  • #22
Avatar from Gravatar.com
Marc Elser
2 discussion posts
This is not working reliably. I even increased the delay before restoring the window positions but it's maybe working 40% of the time. Quite often I see windows beeing focused and re-arranged but sometimes they keep being on the laptop screen (not the external monitors after dock). It also happened to me multiple times that windows did not restore to correct size. Don't know if this has to do with laptop screen beeing 4K and the two external monitors beeing Full HD or now but however this feature (see also all the other comments) needs vast improvement. The integrated DisplayFusion functions for saving/restoring windows are so badly broken it's really horrible and I disabled it again, not to mention the balloon tipps you have to disable (which can not be disabled per script, so you have to disable all of them). All in all the event managment is also so poorly developed. It's a wonder that the taskbars work quite good. For me atm it's more or less the only reason to keep displayfusion isntalled.
May 2, 2017  • #23
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@Marc: Can you try this, so we can figure out if the issue is with the Save/Restore functions, or with the Triggers?
  • Disable the Triggers and Apply the settings
  • Assign key combinations to the Save/Restore functions and apply the Settings
  • Next time you leave the computer, manually run the Save function
  • When you return, manually run the Restore function
  • Did it restore all of the windows correctly?
May 3, 2017  • #24
Avatar from Gravatar.com
WeyldFalcon
2 discussion posts
I would also love to see a function in DisplayFusion that would simply allow you to continuously save until it detects 1 monitor then wait until it detects the same number of monitors as the monitor profile has and then load it.
Sep 13, 2017  • #25
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@WeyldFalcon: That's what the steps in this guide should do. Are you running into trouble with it?
Sep 15, 2017  • #26
Avatar from Gravatar.com
WeyldFalcon
2 discussion posts
restarted computer and it started working, must have been an issue with something else, I will provide updates if it stops working at some point again.
Sep 15, 2017  • #27
Avatar from Gravatar.com
TheSteward
14 discussion posts
I've emailed about this with support, but to add to the discussion I think part of the problem is triggers and part of it is monitor profile detection. DisplayFusion seems to have trouble detecting my monitor profile when I dock unless I save the profile (even when I load the profile manually it will apply the settings but doesn't show that that profile is active). After saving the profile though the triggers still don't save or load the window positions.

Per one of the old suggestions above I mapped a key combo to saving and loading window positions, it worked fine when I did both of them.
Sep 15, 2017  • #28
Avatar from Gravatar.com
TheSteward
14 discussion posts
I'm running 9.0 Beta 3 by the way. I've checked for updates and looked on Steam, was a little surprised to see that there hasn't been an update announced on Steam for almost a year with all of the changes in Windows 10.
Sep 15, 2017  • #29
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
We only post the stable versions to Steam, but you can enable beta update checks right in the DisplayFusion Settings and still get them, even with the Steam version. We're hoping to get 9.0 Beta 4 out this week, and it may help with the issue you're running into, as we're making some changes to how the Monitor Profiles are saved/loaded.
Sep 18, 2017  • #30
Avatar from Gravatar.com
Travis52
2 discussion posts
I am having some similar issues with Windows 10. I have tried setting the triggers bound to a specific profile to save on a timer, and restore on profile change, and also on startup -- however it never worked.

I then assigned keybindings to save and restore. When I'm logged in, I can save and restore no issue. However, when I save the layout, then move windows around and sign out -- then sign back in and try to restore, it doesn't do anything.

With the automatic trigger, I was able to add a notification saying the windows were restored when it was executed, so I know it was running.

I added about a 20s delay after startup to restore to ensure all the applications were open.

Any thoughts on this? How are the positions saved? Is it not loading them reliably when logging back in, or in some sort of ephemeral storage?
Sep 19, 2017  • #31
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
The positions are saved based on their window handles, which change when the window is closed and re-opened, or the computer is restarted. We did it this way because it's the only 100% unique identifier for a window. However, we're planning to add a related feature that with any luck will be able to store window positions permanently. We'll be sure to post an update here when we've implemented that.

Thanks!
Sep 20, 2017  • #32
Avatar from Gravatar.com
Travis52
2 discussion posts
Okay, understood. Could perhaps suffice for my use case to get the new handle when it's executed, purely by saving the caption string. As I'm booting fresh, and letting applications run at startup. My specific case is with an Alienware 15 R3 laptop and the Alienware Graphics Amplifier -- which requires a restart when connecting and disconnecting.
Sep 20, 2017  • #33
Avatar from Gravatar.com
Marc Elser
2 discussion posts
Sorry about the rude language but how the hell do I unsubscribe from this discussion. I'm really just not interested anymore. But neither in the e-mails about new posts in this discussion nor in my profile or in my Discussions there's an "unwatch" function or something.

Who programmed this shitty cms? So please tell me how to unsubscribe or I will block all emails from binaryfortress no matter if I have purchased a license or not, but this is insane.
Sep 20, 2017 (modified Sep 20, 2017)  • #34
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@Travis: We'd be doing something along those lines with the new planned feature, yep :)

@Marc: Sorry about that! In the Account settings there's an option to disable Discussions notifications. I'll turn it off for your account right after this reply.
Sep 21, 2017  • #35
Avatar from Gravatar.com
descapa
1 discussion post
Thanks for this discussion I just bought this product trying to get this working but it doesn't work as mentioned in this post.
Similar to post #21 I have issues where if any windows are minimized (or hidden into the tray) it doesn't work. When I redock all of my displayed windows go to the proper place but all of the others are resized & wonky.

I am going from a laptop to a monitor all via USB-C. When I dock I only have a single display and I keep my laptop closed.

Anyhow I am seeing the same thing as #21 where it isn't working right. I am on 9.0 beta4 and I am running on the Windows 10 Insider builds of the Windows Fall Creators Update.

Would love to get this working or I might have to look into a refund. Thank you so much!

EDIT: I noticed it doesn't work for maximized windows as well. My setup is I have a docked 34" monitor and I want windows and things positioned to the right. When I undock I want things maximized and other windows on the right. It isn't working as I expect :-/
Oct 2, 2017 (modified Oct 2, 2017)  • #36
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
The problem with minimized windows, is that we can't get their position/size because Windows reports them as being at a location and size that doesn't exist, so the only thing we can save is that it was minimized :(

Regarding the maximized windows, it should be saving their state without issues. Are you meaning that it's not saving the two different states that you want them to be in, depending on whether docked or undocked? The current Save/Restore functions only keep one position for each window.
Oct 5, 2017  • #37
Avatar from Gravatar.com
OverDriven
1 discussion post
How do I trigger these actions *manually*?
- save window positions
- restore window positions

I don't want to use timer hacks.
18 days ago  • #38
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@OverDriven: On the Settings > Functions tab, you can assign key combinations to them
18 days ago  • #39
Was this helpful?  Login to Vote(5)  Login to Vote(1)
<< Discussions<< NewsReply
Visit DisplayFusion on FacebookVisit DisplayFusion on TwitterVisit DisplayFusion on Google+Visit DisplayFusion on LinkedInSearch for DisplayFusion on RedditFollow DisplayFusion on RSSVisit DisplayFusion on Instagram
Copyright © 2007-2017 Binary Fortress Software • News • Discussions • FAQ • Support • Privacy • ToS