Fancyzones not placing windows on correct zone when waking monitors
Microsoft PowerToys version
0.57.0
Running as admin
- [X] Yes
Area(s) with issue?
FancyZones
Steps to reproduce
Using a multiple monitor set up, create 3 zones on each monitor. Place some windows in zones on the primary monitor. Let monitors go to sleep (not actual OS sleep, just turning off monitors), then wake them back up. My specific setup: 2x 24inch 1920x1080 monitors running on hdmi (this is important I think as they wake up first) in vertical rotation 1x 49inch 5120x1440 monitor running on displayport in horizontal rotation, set as primary monitor 3 zones on each monitor
It looked like this was actually addressed in the 0.57 release notes but I'm not having any luck with it. Attached the bug report output. PowerToysReport_2022-04-06-17-19-00.zip
✔️ Expected Behavior
When the monitors wake, all open windows should retain their previous zones and be on the correct monitor.
❌ Actual Behavior
Windows dance around and reside on the incorrect monitor.
Other Software
No response
Just popping my head back in here to say unfortunately the latest update (0.57.2) did not fix this issue
I see in the logs App zone history is empty for the processing window on a current virtual desktop. It means that most likely the current virtual desktop id doesn't match with saved, so apps aren't being applied to zones. I'll investigate the issue.
After the recent patch (specifically the note on new debugging tool for FanzyZones) I thought I'd pop back. As the issue does still persist and I've just very recently experienced it, hopefully a fresh report is helpful! PowerToysReport_2022-05-04-18-47-57.zip
It looks like there is some progress on this issue, but since I'm having the same behavior with a different monitor setup, I thought I would also post my report here in case it's helpful. Thanks.
While I can see this task was moved into "Done" for 0.59 I did not see it in the patch notes, and while switching my monitor from PBP to single view this issue still persists (this triggers the same flow as letting the monitor sleep and wake). I've attached a recent bug report PowerToysReport_2022-06-08-10-07-52.zip
Does it happen with all windows or with some, e.g. File Explorer? /needinfo
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.
This is happening with msedge.exe for me. Same with notepad.exe
Seems to be all windows. I can list a few specifically. Browsers (Firefox, Chrome), VSCode, Unity Editor, Slack, Discord. They all seem to be affected.
Sorry for the delay on replying, I don't get emails for notifications on github for some reason
This is still an issue in 0.60.1. I think it's mostly to do with DisplayPort disconnecting monitors that are asleep, and removing them as monitors in the OS. Ironically this is the reason I got PowerTools in the first place.
Please, provide a /bugreport from the latest release.
Hi there!
We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks! 
I've added a bug report from my system. Same issue that rohanrichards is reporting. In my case, I'm connecting an external 4k display to my laptop via HDMI. I suspect it may have something to do with the differing times the monitors initialize after wake up. Perhaps PowerToys needs to check more frequently for a monitor configuration change to trigger window relayouts.
My systems been online for a while so I'm not sure how bloated this report will be. However there should be two instances of Fancyzones failing to correctly restore window positions. Once on system startup, and once when I switch my monitor to PiP.
If I remember, the next time I wake my screens I'll come back with another report.
And here's a report from immediately after waking my monitors, Firefox had moved to the wrong screen PowerToysReport_2022-07-28-17-26-34.zip
Hi @rohanrichards, looked into your report. As I can see, after the "display change" event FZ searched the zone history of firefox and placed it in a zone. My assumption is that firefox was on one screen and moved to another to fit the zone after you woke your monitors. Is that true?
To check this, you can remove firefox from \AppData\Local\Microsoft\PowerToys\app-zone-history.json and check after that if it stays on the correct monitor.
/needinfo
This happens to almost every window, almost every time though? That said, I've removed firefox from that list, I'll restart powertoys and see how we go.
As well here's a description of what I think the flow of events is:
- Computer wakes and my main DisplayPort monitor is considered "disconnected" (this is a known issue with windows 10 and the main reason I have powertoys)
- PowerToys kicks in and tries to move my windows to the right monitors
- Something goes wrong and it moves them onto the wrong monitors (potentially it's also suffering from this bug where the displayport monitor isn't reconnected yet)
Still did it, I've added another bug report PowerToysReport_2022-08-04-13-53-15.zip
To clarify, do you turn off monitor by pressing power button or disconnect it completely? /needinfo
Neither, the monitor is put to sleep from inactivity.
This is happening to me very consistently. I use one display output at a time and when I power cycle the active display, some or all windows snapped in FancyZones get reset and resized to one tile in the top left corner. This only happens on the current virtual display, all the others are fine and preserve the old layout.
I think it's mostly to do with DisplayPort disconnecting monitors that are asleep, and removing them as monitors in the OS.
I use two HDMI outputs (but only one at a time) and the symptoms are the same. HDMI doesn't have the same standby integration with the OS and it doesn't wake the display automatically from a screensaver like DP can, but we have the same issue with FancyZones.