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

Windows can restore out of bounds when restoring on recently upscaled displays #390

Open
Cuperino opened this issue Sep 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Cuperino
Copy link
Member

On Windows, storing layout with window positioned near corner on high resolution display, closing that window, increasing display scaling factor by a factor of 2 or more, and then restoring the layout results in window being positioned out of bounds, on the next display, when there's a display next to the initial display.

This issue is also applicable to restoring the position of individual windows, not just entire layouts. The issue is not applicable to Linux, tested Plasma and Gnome, each with X11 and Wayland. I didn't test MacOS.

Pre-requirements

  • Windows 10 or 11
  • Use 2 or more high resolution displays that can hold large scale values
  • Set the first of the two displays to 100% scaling
  • Set the second display bellow or to the right of the first display (for my screenshots, I went with setting one screen bellow the other)

To replicate

  1. Open qtwidgets_dockwidgets example
  2. Make mainwindow small and place to the top left of the first display. Make second window smaller and place very near to the next display
    kddw_W
  3. Save layout
  4. Close second window
    kddw_X
  5. Increase scale factor of first display
    kddw_Y
  6. Restore layout
    kddw_Z

Outcome

  • Scaling factor of individual windows is not remembered or taken into account when restoring its position
  • Window is restored out of bounds as a result
  • When there are adjacent displays the axis that went out of bounds are set to 0, and the window is placed on the adjacent display to the bottom, right, or bottom right of the initial display, depending on which axis went out of bounds

Expectation

  • Scaling factor of individual windows is remembered and taken into account when restoring its position
  • Window is placed on a position and with dimensions relative to its initial scale factor, similar to when the change of scale occurs while the window is still open
  • The window is restored within the same display where it was initially located
@Cuperino Cuperino added the bug Something isn't working label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant