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

Massive white flicker when using native painting (GDI) on Windows, in all windows of the Qt application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.8.5, 5.4.0
    • GUI: Painting
    • None
    • Windows 7 and XP
      Qt4 and Qt5

    Description

      Using WA_PaintOnScreen and reimplementing paintEngine() to return 0 is the documented way to do "native painting" on Windows (e.g. GDI or DirectX).

      This disables double-buffering obviously, no problem there.

      However, as soon as native painting is enabled in a window, all windows of the Qt applications (including "normal ones") show the same behavior:
      when moving another window (e.g. cmd.exe) on top of the Qt windows, they first get cleared with a white background color, and only then repaint on top of that.
      It's already a bug IMHO that this happens in the native-painting window, but it's even more strange that it happens on the standard QWidget window.
      As soon as I close the native-painting window, the QWidget window behaves normally again - no white flicker.
      Where does this white color come from? I couldn't find it in Qt's code, but at the same time, it can't just be Windows doing this for all exposed areas, since it doesn't happen when Qt's double buffering is in action [and no toplevels use native painting].

      Here's a testcase. To make the problem more visible, I added a Sleep(500) in the paintEvent of both windows. This emulates a real application where the painting code is non-trivial, otherwise there's no time to see much.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              dfaure_kdab David Faure
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes