<< Discussions<< NewsReply
Automatically Save and Restore Window Positions on Sleep/Resume

Some types of HDMI monitors, and pretty much any DisplayPort monitor will be "disconnected" from the computer when powered off or entering sleep mode. This causes Windows to do a full display re-detection on sleep and resume, which has the nasty side effect of making all open application windows shuffle around. When returning to your computer, all of your carefully placed windows are now in random spots! DisplayFusion can help with this scenario by saving the window positions before the system sleeps, and restoring them when it wakes up. The steps below describe how to configure DisplayFusion to do this.

  1. Update to the latest DisplayFusion 8.0 Beta version
  2. On the Settings > Triggers tab, enable the "Enable Triggers" checkbox
  3. Click the Add button and setup a Trigger with the following settings:
    • Event: System Idle
    • Idle Timeout (sec): Set this to 1 minute less than the time configured for your monitors/system to sleep (i.e. if monitors are set to sleep after 10 minutes, set this to 540 seconds)
    • Action: Run Function > Save Window Positions
      Save Window Positions Trigger
  4. Click OK to save the Trigger rule.
  5. Click the Add button again, and setup a Trigger with the following settings:
    • Event: Desktop Unlocked
    • Action: Wait > 5000
    • Action: Run Function > Restore Window Positions from Last Save
      Restore Window Positions Trigger
  6. Click OK to save the Trigger rule.
  7. Click OK again to apply the DisplayFusion Settings.

Note: If your system is not set to lock on sleep or screen saver, the window positions won't be automatically restored when resuming from sleep or screen saver. You can still manually load the positions by assigning a key combination to the "Restore Window Positions from Last Save" function on the Settings > Functions tab.

As always, if you run into any issues, or have any questions or concerns, please don't hesitate to ask!

Jan 29, 2016 (modified Aug 5, 2016)  • #1
Tony89
This is not working for me. When the screens wake up, all the windows which were in the secondary monitor move to the primary one.

The two triggers are enabled. My screens go to sleep after 10 minutes. I have tried idle timeouts of 540 and 60.

Is there a way to enable and view logging? Also a column like 'Last Run' indicating the last time the trigger ran would be helpful.

Also dragging a trigger doesn't work. I can't reorder triggers.
Aug 2, 2016  • #2
Tony89
I turned on detailed logging. I see the taskbar notification when it saves the windows positions. However when the screens wake up, the windows have moved to the primary monitor. I can see the app icons in the secondary monitor for a split second then they go away. However this is a Windows behavior as I notice this without DisplayFusion being installed.

What to search for in the log file about Windows locations restorations? I see some entries which look like they are about windows moving.
Aug 2, 2016 (modified Aug 2, 2016)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@Tony89: Could you send us a backup of your DisplayFusion Settings through our contact form? We'll be glad to look into this for you. Thanks!
Aug 3, 2016  • #4
Penfist's profile on WallpaperFusion.com
I have the same issue as Tony89. I sent my backup through the contact form.
Aug 6, 2016  • #5
Itchrelief
Hi. This solution usually works for me if
1)Windows goes to sleep and locks by itself
2)I manually lock the desktop and unlock it before Windows sets my primary monitor to sleep

However, if I manually lock the desktop, then Windows goes to sleep, upon waking the positions are generally messed up.

This may have to do with my primary monitor (connected via DVI to AMD 290 video card) many times having to re-initialize after wake or power-off of monitor. Secondary monitor is connected via DVI to Intel onboard graphics (i7 4790K, not overclocked, Gigabyte Z97X Gaming-7 motherboard).

I am wondering if maybe Windows is setting my monitor to sleep earlier when the desktop is manually locked, before Displayfusion saves positions, and thus is saving an invalid set of positions where everything has been moved to my secondary monitor. The positions are thus either invalid or ignored when trying to restore after I have re-enabled my primary monitor.

I wonder if there is a way to have Displayfusion conditionally save window positions either on desktop lock or after the idle period, whichever happens first. I already have a second trigger to save positions on desktop lock, but this seems to get overwritten later on.

Thanks!
Aug 9, 2016  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
It isn't currently possible to have a combination of events for the same trigger like that. If you disable the Timer trigger and just use the Desktop Locked trigger, does that work correctly?
Aug 11, 2016  • #7
Collin Chaffin's profile on WallpaperFusion.com
Hey Keith! Been a while since I've been on but had a question about this function.

How can this function be triggered by a similar power condition, in my case manual powering off external HDMI monitor connected to laptop does the following:

1. Power off monitor 1
2. Close laptop lid (does NOT sleep but set to "power off" monitor 0 (built in display) only)

Upon wakeup:

3. Open lid - laptop for a moment begins reconfig desktop thinking it is now in single monitor (builtin) mode as I reach to power on monitor 1.
4. Power on external HDMI monitor 1
5. Displayfusion after about 10 sec then becomes visible again on mon0 (builtin) acting as the secondary displayfusion taskbar monitor - this is ok
6. All window positions are now back to external monitor 1 (set as primary).

Desired action is (like this function) to basically as the end of step 4 above (external monitor power button) trigger the saved window restore and perhaps icon profile.

Given the above workflow, what would that trigger list look like and does it require any custom functions? I'm thinking nothing custom needed but perhaps I'm wrong but stuck on what even needs to trigger here.

Thanks!

Collin
Collin Chaffin's profile on WallpaperFusion.com
Oct 11, 2016  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@Collin: Using the docked/undocked guide should do the trick: https://www.displayfusion.com/Discussions/View/automatically-saving-and-restoring-window-positions-on-dockundock/?ID=5540c67a-5e2b-4f41-b88c-de4d9c2fa354.

Make sure to update to 8.1 Beta 2 (https://www.displayfusion.com/Download/Beta) before trying those steps though, there was a bug in 8.0 that prevents it from working fully :)
Oct 12, 2016 (modified Oct 12, 2016)  • #9
kaze59
Hello

Can you give me more information about this ?
"Note: If your system is not set to lock on sleep or screen saver, the window positions won't be automatically restored when resuming from sleep or screen saver."

How to do that ?

I set the screen saver to "none", the wait timer to 1 minute, and check the box that says "On resume display logon screen".

But windows positions are not restored, i still need to manually load the positions

thx
Dec 22, 2016  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@kaze59: Could you send us a backup of your settings (Settings > Options > Export) to support@displayfusion.com?

Thanks!
Dec 22, 2016  • #11
Itchrelief
Quote:
It isn't currently possible to have a combination of events for the same trigger like that. If you disable the Timer trigger and just use the Desktop Locked trigger, does that work correctly?


Sorry for the LONG delay in responding. I never had the patience to test this out systematically, as the behavior seems to me to differ slightly based on whether the system goes to sleep on its own or I just lock the desktop, or maybe even if I send it to sleep manually. Thus I've just been using the computer normally, and data points come very slowly.

It does seem to work better with only the Desktop Locked trigger to save positions. Having both active seems to muck things up.

I have it set up to restore positions both on Desktop Unlock and system wake. I am not sure which one is the one that is actually working, but I'm too lazy to thoroughly test and just keep both of them active.

Every now and then it doesn't work, but it's very infrequent, to the point I can't remember exactly was the last time it failed.
Jan 10, 2017  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
No worries! So is it working as expected most of the time now then?
Jan 12, 2017  • #13
Isthisadagger
Hey Keith,

just downloaded the trial, configured the triggers, set monitor sleep to 2 minutes and the trigger to 1 minute with a maximized testwindow on monitor 2 (2 monitor setup, windows 10 x64). Woke it up again and after logging in, the test window is shown minimized in the taskbar of monitor 2 for approximately the 5000ms set in the second trigger. After that it is moved minimized to monitor 1.

Regrettably i can not send you the configuration because for some reason after reinstalling DF my trial is expired and i can not create triggers ;-)
Feb 28, 2017  • #14
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
@Isthisadagger: Just sent you a new 30-day trial key
Mar 1, 2017  • #15
Isthisadagger
After reinstalling it just works. Upgraded to pro. Thank you Keith.
Mar 3, 2017  • #16
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Excellent, glad to hear it! Thank you for your purchase
Mar 3, 2017  • #17
Was this helpful?  Login to Vote(4)  Login to Vote
<< 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
©2017 Binary Fortress  •  News  •  Discussions  •  FAQ  •  Support  •  Privacy  •  ToS