kangyu-california / PersistentWindows

fork of http://www.ninjacrab.com/persistent-windows/ with windows 10 update

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The entire program seems broken now

DrCyanide opened this issue · comments

I updated a few days ago (not sure where to find the old version number, but the icon was the beige one in the README. Now on version 5.53.8857.40610), and none of Persistent Windows functions have worked right on either of my computers since then.

  • It's no longer automatically capturing window positions.
  • I can click "Capture Snapshot" and give it a number, but "Restore Snapshot" stays greyed out.
  • I can click "Capture windows to disk", and a command prompt comes up, but clicking "Restore windows from disk" does nothing.

I'm completely baffled at how EVERY function of the app broke on both computers. I'd understand if the automatic restore broke due to a command line args change, but the manual operations?

I'm on Windows 10 22H2 on both computers.

Not sure how to reproduce, you may want to do a fresh install of 5.53, create auto-start task following the instruction on readme, then reboot your PC and let me know how it works.

Reinstalling went from "kinda working" back to "not working" within a day. It seemed like it got progressively worse with each toggle back-and-forth (between having the external monitors and not).

  • After a fresh reboot, "Restore snapshot" was enabled after "Capture snapshot".
  • Toggling again the windows were in the proper place - working!
  • Toggling again and one or two of the windows were in the wrong place, and when I tried to "Capture snapshot" to have a manual fallback it didn't enable "Restore snapshot" like it had before.
  • Toggling again and it's back to nothing working right, no windows going back to the external monitors, no "Restore snapshot", etc.

The laptop has about 16 windows active.
I don't know if this is relevant info or not, but when I toggle back to the laptop for a moment the desktop shortcuts appear on the external monitors, before being moved back to the laptop screen.
On my desktop, even if I keep everything on one monitor (like I have when writing this) toggling back and forth will shuffle the order of the windows.

commented

Can confirm, seems to randomly degrade after a few cycles of my center monitor disconnecting due to modern power saving "features". Firefox tends to gravitate towards my left monitor and things like VS Code, EVGA PrecisionX, and explorer instances tend to move towards the right monitor. I don't really understand the pattern. Powershell windows somehow always stay put.

I'm trying to test it, but I'm not positive if the patch is running or the old version. It's possible there's some user error going on.

image
The icon for what's in the taskbar (right) is different than the icon for the .exe (left)
I've exited the program when it's like this and restarted it from the exe. It sometimes stays the colors of the exe, but other times it reverts back to the red variation after some time. At present, my laptop has the red variation, and is no longer moving windows. My desktop has the exe version, and is mostly working correctly (Some chrome windows are put in a different z-index order, but they seem to be in the correct position).

On my laptop I got a very odd bug with one of my Chrome windows, where it rendered a black bar on the side (about 240px wide) which acted like the entire window was shifted - hovering my mouse in the upper right corner of the black area highlights the close "X", and the tabs are similarly offset. I can't say for certain this is related to the patch, but it is an odd behavior that I thought should be noted just in case.
Possible Persistent Windows bug

The sticky red icon might be caused by the following,

  1. PW is hanging when restoring an unresponsive app window. The solution is documented in the last section of readme as known issues.
  2. Windows API fails to reset PW icon back to normal. The fix is click the PW icon using middle mouse button.

No idea why chrome window shifted out of screen though.

commented

Please try PersistentWindows5.53_patch1.zip

The patched version appears to have stopped working after 4-5 cycles of the screens going off.

@novacrazy
steps to diagnose "stop working“ issue,

  1. anti-virus software may kill PW, this happened to one of my desktops yesterday.
  2. PW is stuck waiting for return of MoveWindow() API on unresponsive window, you could tell this by checking the color of PW icon, if it is red, refer to the "Known issues" section of readme
  3. PW crashed
  4. other situations
    For 3 and 4, please follow the last section of readme, get the diagnose message dump from event viewer and post it here.

I can confirm it's not working on my laptop running the patched version. The icon is the normal color (not the red variant).

I don't see any indication that a security program has stopped it.
I don't see any unresponsive windows.
I can click Create Snapshot and get the popup window (so I don't think it's unresponsive), but Restore Snapshot stays grayed out

Attached the event log for the last 7 days (had to zip because of Github file type requirements)
PersistentWindows Log - 7 days.zip

PersistentWindows: System.Security.SecurityException: Requested registry access is not allowed. at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at PersistentWindows.Common.PersistentWindowProcessor.CleanupDisplayRegKeyCore(String key) in I:\proj\PersistentWindows\Ninjacrab.PersistentWindows.Solution\Common\PersistentWindowProcessor.cs:line 229 at PersistentWindows.Common.PersistentWindowProcessor.CleanupDisplayRegKey(String key) in I:\proj\PersistentWindows\Ninjacrab.PersistentWindows.Solution\Common\PersistentWindowProcessor.cs:line 203 The Zone of the assembly that failed was: MyComputer

PW is experiencing exception when trying to do cleanups in the registry to remove legacy 1024x768 vga monitor fallbacks.
Repeated exceptions eventually cause PW to malfunction.
You may need to run PW w/ admin privilege as recommended by readme

Found a new category of alarming events such as
PersistentWindows: Reject unexpected scale factor change for ● Untitled-1 - My Default VSCode Profile - Visual Studio Code

It means the window position (reported by Windows OS) changed abruptly, as if screen scale factor (such as 125%,150% DPI etc) has changed suddenly.

The reason of this kind of event is unknown yet.
My recommendation is to run PW in customized DPI setting. refer to release note of 5.53 for instructions.

It means the window position (reported by Windows OS) changed abruptly, as if screen scale factor (such as 125%,150% DPI etc) has changed suddenly.

The reason of this kind of event is unknown yet.

Oh, I bet I know what's causing that. My laptop monitor has a different resolution (and scale) than the external monitor that I keep VSCode on. When I disconnect the external monitor Windows has to snap VSCode back to the laptop, and thus change the resolution. Going back and forth between the two is the reason I use Persistent Windows.

Still, it's a little odd that it's only recently broken, when I've been using this workflow (and Persistent Windows) for about a year

The workaround is to change the property of the high DPI setting of PersistentWindows.exe to "Application", as detailed in the release note of 5.54