PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Fancyzones not placing windows on correct zone when waking monitors

Open rohanrichards opened this issue 3 years ago • 21 comments

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

rohanrichards avatar Apr 06 '22 07:04 rohanrichards

Just popping my head back in here to say unfortunately the latest update (0.57.2) did not fix this issue

rohanrichards avatar Apr 16 '22 07:04 rohanrichards

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.

SeraphimaZykova avatar Apr 29 '22 15:04 SeraphimaZykova

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

rohanrichards avatar May 04 '22 08:05 rohanrichards

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.

PowerToysReport_2022-05-23-09-20-23.zip

astrassburg avatar May 23 '22 13:05 astrassburg

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

rohanrichards avatar Jun 08 '22 00:06 rohanrichards

Does it happen with all windows or with some, e.g. File Explorer? /needinfo

SeraphimaZykova avatar Jun 08 '22 16:06 SeraphimaZykova

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.

msftbot[bot] avatar Jun 13 '22 20:06 msftbot[bot]

This is happening with msedge.exe for me. Same with notepad.exe

cobey avatar Jun 13 '22 21:06 cobey

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

rohanrichards avatar Jun 19 '22 01:06 rohanrichards

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.

rohanrichards avatar Jul 24 '22 22:07 rohanrichards

Please, provide a /bugreport from the latest release.

SeraphimaZykova avatar Jul 27 '22 15:07 SeraphimaZykova

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!
Report Bug

msftbot[bot] avatar Jul 27 '22 15:07 msftbot[bot]

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.

PowerToysReport_2022-07-27-11-09-25.zip

Andypro1 avatar Jul 27 '22 15:07 Andypro1

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.

PowerToysReport_2022-07-28-09-32-11.zip

rohanrichards avatar Jul 27 '22 23:07 rohanrichards

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

rohanrichards avatar Jul 28 '22 07:07 rohanrichards

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

SeraphimaZykova avatar Aug 01 '22 06:08 SeraphimaZykova

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)

rohanrichards avatar Aug 03 '22 23:08 rohanrichards

Still did it, I've added another bug report PowerToysReport_2022-08-04-13-53-15.zip

rohanrichards avatar Aug 04 '22 03:08 rohanrichards

To clarify, do you turn off monitor by pressing power button or disconnect it completely? /needinfo

SeraphimaZykova avatar Aug 04 '22 09:08 SeraphimaZykova

Neither, the monitor is put to sleep from inactivity.

rohanrichards avatar Aug 05 '22 04:08 rohanrichards

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.

farnoy avatar Dec 08 '22 09:12 farnoy