KDDockWidgets icon indicating copy to clipboard operation
KDDockWidgets copied to clipboard

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

Open Cuperino opened this issue 9 months ago • 0 comments

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 avatar Sep 13 '23 00:09 Cuperino