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

<< < (7/13) > >>

mouser:
And here's a version without any window flickering, by directly restoring the maximized (real) window locations as WELL as the normal restored window locations when it finds a maximized window.
No flickering restore-maximize process needed anymore.

[OLD FILE REMOVED SEE SUBSEQUENT POST]

skrommel:
Some serious logging there, mouser! :) I'm sitting at a laptop on my holiday, so I haven't been able to test multiple monitors properly, but I'm surprised that wrong max positions was the solution to your problem. And I can't test it, because I can't get your script to do anything on my computer...

mouser:
Your manual save and load functions should work well in my version.

Because this version NEVER saves window positions except when you trigger via tray menu or when monitors turn off (testing via nircmd), it should be easy to use the tray menu to save your layout via tray menu, then move around some windows, then load configuration from tray menu.

No need to mess with the automatic restore when monitors power on and off, just experiment with the ability to manually save and load layouts.

Hopefully that will work for you with my version?

mouser:
Some serious logging there, mouser!
--- End quote ---

Hey I learned to code in the 1970s -- log statements are my main method of debugging :)

AHK is not a language I am comfortable with so I kept running into confusing issues where things were not behaving as I expected and I had to log info to see what was going on.

As an example, this line in your original code had me flummoxed for quite a while:


--- Code: Autohotkey ---If monitorStatus=Off

mouser:
New version with substantial bug fix attached.

I was not performing my hex->dec process id check and dupe window avoidance at load time only save time.
This meant some windows would not be "seen" by the script.

The reason for this code is that there were dupe entries in the list of processes/windows which was causing the script to process windows twice.  It happened with some ids being hexadecimal and being dupes with their decimal versions.  I don't understand why but normalizing everything to decimal ids, and then making sure they aren't duplicate id that was just previously written out solves the problem.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version