ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

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

<< < (5/13) > >>

mouser:
So it detects the monitor off and on correctly?
--- End quote ---
Yes it seems so..

Maybe a delay before moving the windows around is needed?
--- End quote ---
I think so.  The fact that nothing "seemed" to have happened after the monitor woke up makes me think that the script saved the "bad" positions.. possibly it tried to restore positions before the monitors were fully woken up and then the OS moved them around, and then the script memorized the bad positions..


I'm also thinking that if it reliably detects monitor  OFF and ON conditions, it might be possible to autosave positions ONLY at monitor OFF signal.

Let me experiment with your code and add some logging and see what I can see..

mouser:
Just saw IdleWinPosSaver.ahk, let me download and look at that too.

mouser:
Skrommel, here is my quickly hacked modification of WinPosSaver.
It does a lot more logging, and it does what i suggested above -- it only saves automatically when monitor turns off, and then restores after a delay once when monitor turns on.

Now, it seems to trigger the save and load correctly, but there is a problem:

I earlier reported that the manual save and load tests worked for me, but I see now that is not quite 100% true.  It seems that some windows are not restoring properly.

The most easily reproducible problem is that when i save a layout with a MAXIMIZED window, and then unmaximize and move the window from one monitor to another, when the layout is loaded, it does NOT move the window back to its saved monitor -- instead it maximizes it on the current monitor.

IN FACT, I believe this is a clue to what is going wrong with the Operating system monitor on/off screwup where windows get moved around.

I think the solution is that if a window is not maximimzed and it is being restored back to a maximized state, it needs to FIRST be moved unmaximized to the old monitor location, and only THEN maximized.. Just an idea..


Another clue and strangeness is that the OS keeps a separate record of the unmaximized position and size of a window, separately from the location of the maximized window, and it can be that when the weird moving of windows occurs during wake, that these locations are actually on DIFFERENT monitors(!).  This is something that is not normally possible when you are moving the windows as a user, but you can see it has happened because when you unmaxmize a window that this has happened to, the un-maximized version of the window jumps to another monitor(!). 

I know this may be confusing to follow..  Bottom line is that the save and restore is somehow not restoring the window state perfectly -- something about the maximized window location is not being restored correctly.


[OLD FILE REMOVED SEE SUBSEQUENT POST]

mouser:
I'm experimenting now with ideas..

mouser:
Ok so following up all everything I wrote, I am having some luck getting the save-load cycle to work even with OS crazy window moving, by explicitly UNMAXIMIZING every maximized window before restoring it.. This creates some god-awfully flying of windows what the state is restored, but it seems to be working.. Now to see if there is a way around explicitly doing that..

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version