ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Post New Requests Here

Desperate app request - restore window positions after wake from sleep scrambles

<< < (4/13) > >>

Just a quick first report:

Miraculously, using WinPosSaver to save window positions, and then moving them, changing min/max states  around, and then using WinPosSaver to restore them.. Worked flawlessly.  :huh:

I did not expect that at all.. I expected lots of problems with different windows not restoring their maximized state, and other oddities..

So yeah, great success so far..  Now it's a matter of getting it to automatically save before the monitor problem, and automatically restore after.

Have you checked the log.txt? Does all power events register?

If not, I can make a pure "wait for keypress/mousemove after idle for 30 minutes", and just watch the number of monitors connected.

There's a two second time gap to save things before the system shuts down, so it should be possible, but some part of the code can't get it's information during this time, and crashes.

By just saving the hWnds after x minutes of idle and restoring them when there's activity + a delay, it should work.

Ok so here are the results from waking up this morning:

The log does seem to have triggered an event when the monitors woke up:
20170726070222 - PBT_POWERSETTINGCHANGE - Monitor: Off <-- in the middle of the night
20170726111030 - PBT_POWERSETTINGCHANGE - Monitor: On <-- last event and when the monitors woke up

Observed behavior was as follows: When the monitors woke up this morning, window positions got moved around as they normally do.. WinPosSaver did not seem to do anything.

One thing I need some clarification on is as follows:
When I first tried WinPosSaver, I was testing the manual save and load functions.. But I see now that it's saving window positions to file on a timer.. So I guess I really should not expect to be able to save and load manually and have that work..  Perhaps for testing purposes it would be nice if the MANUAL save and load functions used a separate data file from the automatic system.  That would make it easier to test issues..

I'm ready to test the next version when you are ready..

ps. Manually putting the monitors into sleep mode does not seem to be a viable way of testing this issue, because if I manually send them to sleep (via nircmd for example), they wake up fine.  It's only after they've really been off for a couple of hours that they exhibit this wake problem..

So it detects the monitor off and on correctly? Maybe a delay before moving the windows around is needed? Or wait for all the monitors to reattach?

 :) IdleWinPosSaver is a much simpler solution. Change the idle= line to your monitor idle time. After idling, it waits for a key or mouse action, then it waits for all monitors to reattach, and then it moves the windows.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version