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

[Windows] Flickering with high DPI scaling with native Windows window

    XMLWordPrintable

Details

    • Windows

    Description

      A fix done earlier solved flickering issue with Windows window: https://codereview.qt-project.org/c/qt/qtbase/+/512532 This solved the problem when normal scaling (100%) is used. If DPI scaling is different than 100% then the flickering is still there.

      The attached example can be used to reproduce the problem. The issue can be seen when moving the window around with e.g. 125% scaling.

      Would it be a valid fix to compare the window size using toNativeSizeConstrained() like shown below, as that seems to fix the issue?

      diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
      index 5a33ed4bc37..eeb48c2f061 100644
      --- a/src/plugins/platforms/windows/qwindowswindow.cpp
      +++ b/src/plugins/platforms/windows/qwindowswindow.cpp
      @@ -2763,7 +2763,7 @@ bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *
           // Check the suggestedGeometry against the current one to only discard during
           // resize, and not a plain move. We also look for SWP_NOSIZE since that, too,
           // implies an identical size, and comparing QRects wouldn't work with null cx/cy
      -    if (!(windowPos->flags & SWP_NOSIZE) && suggestedGeometry.size() != qWindow->geometry().size())
      +    if (!(windowPos->flags & SWP_NOSIZE) && suggestedGeometry.size() != toNativeSizeConstrained(qWindow->geometry().size(), qWindow->screen()))
               windowPos->flags |= SWP_NOCOPYBITS;
       
           if ((windowPos->flags & SWP_NOZORDER) == 0) { 

      Attachments

        Issue Links

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

          Activity

            People

              owolff Oliver Wolff
              tiheikka Titta Heikkala
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes