microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.55k stars 6.51k forks source link

FancyZones moving apps to last zone on virtual desktop when it had no current zone. #23451

Open eliveikis opened 1 year ago

eliveikis commented 1 year ago

Microsoft PowerToys version

0.66.0 and earlier for last 6 months or so

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

FancyZones

Steps to reproduce

PowerToysReport_2023-01-19-13-17-42.zip

Repro Steps:

  1. Windows 10.
  2. Have at least 2 virtual desktops configured.
  3. Snap VSCode to a layout position for FancyZones.
  4. Place VSCode as full screen or simply placed arbitrarily on one of the desktops without holding the fancyZones layout placement shortcut.
  5. Switch to another virtual desktop.
  6. Switch back to the first virtual desktop.
  7. Observe that the VSCode window is now in the first selected FancyZone location, not the last state where it was left without a layout zone.

Notes:

  1. I have multiple monitors which reveals a bit more. If I have one monitor with "no layout" in my fancy zones editor, and I hold the fancyzones layout placement shortcut while putting VSCode into fullscreen (by dragging the title bar to the top of the screen), and then switch/return virtual desktops, it remembers the full screen placement on the no layout display. However: a. it doesn't remember if I simply place the window on that display without holding the layout key b. it also doesn't remember if I place it in non-fullscreen mode with the layout key*.
  2. This was working about a year ago and for the previous years. It broke sometime over the last many months and I was hoping it would be fixed. Very annoying for development workflow where I'm often switching desktops and I always want my VSCode in a the same place (full screen on one display).
  3. Seems to be app-specific. Slack does not reproduce this bug. Chrome does!!

✔️ Expected Behavior

Windows should always be in their previous position when switching virtual desktops.

❌ Actual Behavior

VSCode in often and in certain cases resets to previous fancyzone Zone instead of regular windows placement when switching virtual desktops. See Steps to Reproduce for details.

Other Software

Visual Studio code any version in the last year. I'm on latest currently. 1.74.3.

eliveikis commented 1 year ago

The bug appears to be more nuanced. After my steps yesterday to write the bug report, my chrome will now re-open to a zone on my right monitor, even if I move it to another zone and then close chrome. There appears to be some more subtle behavior that is restoring windows to the wrong zone beyond what is described in the initial bug report, however the given steps will reproduce the issue for me every time.

harryfiedify commented 1 year ago

I have this problem for VSCode, Mattermost, Zoom, Firefox windows.

harryfiedify commented 1 year ago

I was able to resolve this issue by renaming/deleting the file %localappdata%\Microsoft\PowerToys\FancyZones\app-zone-history.json. Perhaps some setting in there got corrupted?

eliveikis commented 1 year ago

I was able to resolve this issue by renaming/deleting the file %localappdata%\Microsoft\PowerToys\FancyZones\app-zone-history.json. Perhaps some setting in there got corrupted?

Maybe, although it appears that clearing that file clears the fanzy zones settings for the specific apps, so it would make sense that it would workaround this bug since I want to keep the app in full-screen, not in a fanzy zone. I assume that there would be a way to make the bug re-appear after placing the app in fanzy zones again and then trying to maintain fullscreen. It's probably a temp workaround.

shaipetel commented 1 year ago

I thought i was going nuts! This started happening only on VSCode, then sometimes randomly other apps but - on VSCode every time I switch desktop.

So happy someone else confirms it, hopefully there is a fix soon as it drives me crazy - I open 2 vscode windows and they keep collapsing on top of each other.