Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Restore the original size of windows when unsnapping" doesn't quite restore original size #17539

Closed
1 task done
NeoNavras opened this issue Apr 5, 2022 · 6 comments
Closed
1 task done
Assignees
Labels
FancyZones-Dragging&UI FancyZone dragging / interaction issue Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Product-FancyZones Refers to the FancyZones PowerToy Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@NeoNavras
Copy link

NeoNavras commented Apr 5, 2022

Microsoft PowerToys version

0.57.0

Running as admin

  • Yes

Area(s) with issue?

FancyZones

Steps to reproduce

  1. Enable "Restore the original size of windows when unsnapping"
  2. Have a display scaling other than 100% set (e.g. 125%) [added this step after edit]
  3. Repeatably Snap and Unsnap a Window

3440x1440 monitor with 3 (equal-width) column zones.

✔️ Expected Behavior

Restore original size on unsnap.

❌ Actual Behavior

With each unsnap the "Original Aspect Ratio" seems to be restored but the area of the window gets smaller.

Video evidence: https://youtu.be/ujQYvWHXqJ4

Other Software

No response

@NeoNavras NeoNavras added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Apr 5, 2022
@Jay-o-Way Jay-o-Way added FancyZones-Dragging&UI FancyZone dragging / interaction issue Product-FancyZones Refers to the FancyZones PowerToy Area-User Interface things that regard UX for PowerToys and removed Area-User Interface things that regard UX for PowerToys labels Apr 5, 2022
@Jay-o-Way
Copy link
Collaborator

What is your display scale setting? My first guess would be that the scaling of the display is not applied when unsnapping.
CC: @SeraphimaZykova

@NeoNavras
Copy link
Author

I have it set to 125%. When I set it to 100% the problem doesn't happen indeed. Not a great workaround, as everything becomes too small for my taste; but this narrowed down the cause.

@Jay-o-Way
Copy link
Collaborator

Jay-o-Way commented Apr 5, 2022

Yep, this is a bug with scaling. Can reproduce.
Seraphima: I'm guessing the bug is somewhere in file WindowUtils.cpp -> in method FancyZonesWindowUtils::SaveWindowSizeAndOrigin or RestoreWindowSize. Am I close? 😇

P.S. (extra) should the third parameter in L 382 & 384 memcpy(...) not be sizeof windowSizeData, since rawData is still empty?

@NeoNavras
Copy link
Author

Thanks for your source code digging :) Let's hope it can be resolved soon.

Another bug I suppose that is keeping me from using the "Restore the original size of windows when unsnapping" option (toggled with the bool restoreSize according to the source code) is the one from here #9464 In WindowMoveHandler.cpp I found the lines 240-242 which kind of read like they should solve that issue (resizing a snaped window unsnaps it, so it won't be restored to the pre-snaped-size once you drag it again), but apparently they don't, and I couldn't figure out what the lines actually do, or where else to intercept the logic in order to get the desired behaviour described in #9464

@SeraphimaZykova SeraphimaZykova self-assigned this Apr 6, 2022
@SeraphimaZykova SeraphimaZykova added Status-In progress This issue or work-item is under development Product-Awake Issues regarding the PowerToys Awake utility and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Product-Awake Issues regarding the PowerToys Awake utility labels Apr 6, 2022
@jaimecbernardo jaimecbernardo added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Hot Fix Items we will product an out-of-band release for and removed Status-In progress This issue or work-item is under development labels Apr 6, 2022
@NeoNavras
Copy link
Author

Hotfix Release 0.57.2 solved it :) Thanks for super fast resolution!

@jaimecbernardo
Copy link
Collaborator

Reopening until we do the next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FancyZones-Dragging&UI FancyZone dragging / interaction issue Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Product-FancyZones Refers to the FancyZones PowerToy Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

4 participants