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

Weird QDialog behavior on multiple monitors with different DPI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.1
    • QPA: Windows
    • Windows 10 (version 1703)
      Qt 5.9.1 x64

    Description

      On Windows 10 with two monitors with different screen scaling (100% and 200%) dragging QDialog between monitors leads to various artifacts from messed layouts to inability to drag the dialog to the other screen at all.

      The issue is easily reproduced with built-in Qt apps like Qt Designer and built-in Qt dialogs like "About Qt". See the images attached:

       

      1. That's a screenshot of "About Qt" window taken immediately after it appears on 200% zoom monitor. It looks big, nice - all good.
      2. Here I dragged it to the 100% zoom monitor. You see the size is still the same (which is incorrect, it must be twice smaller) and the content floats inside.
      3. Here I dragged it back to 200% monitor and then again to the 100% one. You see it is now of the normal size and looks good for 100% monitor.
      4. Here I dragged it again to the 200% monitor and it becomes tall
      5. Once again I dragged it back to 100% monitor and it now looks like #2, but different

      Best of all, if I slowly drag it to the edge of the monitors it may start switching between big and small versions automatically completely by itself. I can even release the mouse and leave it that way quickly switching between two modes. Can't take a screenshot of this, it must be a video. I guess it can be easily reproduced on two monitors.

      Sometimes that automatic flipping prevents the window from being dragged to another monitor. You simply can't drag it if you move slowly. You have to drag it back and move it really fast, so it doesn't stuck in the middle.

      In my code I tried it both with and without MSWindowsFixedSizeDialogHint attribute. It works better with it, as otherwise the dialog shrinks when moved to a smaller monitor, but the content doesn't, which is much worse that having some empty space around.

      I tried to detect screen changing by the window and restore size there, but if the window is keep moved after that screen changing signal, its size is restored back to the wrong one.

      So far I see no workaround for the issue and consider it quite serious for multi-monitor users.

      Any help is much appreciated.

       

       

      Attachments

        1. 5 - 1x zoom - different layout.png
          5 - 1x zoom - different layout.png
          30 kB
        2. 4 - 2x zoom - tall.png
          4 - 2x zoom - tall.png
          60 kB
        3. 3 - 1x zoom - normal.png
          3 - 1x zoom - normal.png
          27 kB
        4. 2 - 1x zoom - big.png
          2 - 1x zoom - big.png
          30 kB
        5. 1 - 2x zoom.png
          1 - 2x zoom.png
          72 kB
        6. QTBUG-62113-5.15.7.mp4
          4.34 MB
        7. QTBUG-62113-5.15.7-1.mp4
          4.34 MB
        8. QTBUG-62113-6.3.0.mp4
          4.13 MB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              owolff Oliver Wolff
              appsforlife Vitaly Ovchinnikov
              Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes