Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89646

Window move between mixed scale factor monitors on Windows doesn't work right

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.3
    • 5.15.2
    • GUI: High-DPI
    • Windows 10. At least two monitors at different scale factors.
    • Windows

      Programmatic moving of a window ( either with a setGeometry() or move() call ) between monitors of mixed scale factors does not work correctly.   As the window is moved between the monitors, it can jump around unpredictably until it is fully relocated to the other monitor.   This only happens when Qt::AA_EnableHighDpiScaling is set.

      This behavior does not happen if the window is moved using the windows title bar.

      Our application uses windows without title bars, so we have need to programmatically move it based on cursor location.  

      I've attached a sample Qt program that illustrates this behavior.  If you click and drag in the window, it will move the window starting from the upper left corner.   Try dragging this between two monitors at different scale factors (e.g. 100% and 150%) and observe the behavior.   Then try dragging the window using the title bar and observe the difference.

      Of note, there are lots and lots of "QWindowsWindow::setGeometry: Unable to set geometry...." messages as the erratic window behavior is happening, not sure if that's related or not.

      Here's a link to a video illustrating this behavior:   https://photos.app.goo.gl/MWo7hxjYo36hUZ8WA

        1. Don't run dpi scale when in setGeometry.diff
          0.9 kB
          Viktor Arvidsson
        2. MoveWindowBug.zip
          3 kB
          Jeremy Cook
        3. QTBUG-89646.cpp
          3 kB
          Viktor Arvidsson
        4. QTBUG-89646.patch
          3 kB
          Viktor Arvidsson
        5. windows-flickering.mp4
          8.61 MB
          lukasz.kosiorowski
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            jeremyhp Jeremy Cook
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes