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

Windows sometimes not redrawing until mouse moved or keyboard pressed on win32

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • Some future release
    • 4.6.1
    • Core: Event loop
    • None
    • Win XP, reports from users on Vista too
    • 413a40f5c641b6908f73aadcdea3572516c7bd3c

    Description

      There seems to have been a regression in 4.6.1 (compared to the latest 4.5.x I was using before) where Windows are not repainted until the user moves the mouse or triggers some other event. The problem is erratic and I can't reproduce it every time, but it occurs with some frequency.

      One example of where it occurs is with stacked widgets - when the user presses a key that causes my application to transition to a different widget on the stack, that widget is rendered as squished up in the middle. As soon as the user moves the mouse, the widget expands to fit its contents.

      Another example is where images were sometimes not appearing in a QWebView widget until the mouse is moved. I looked into my code and found out I was doing

      w.setHtml("")
      w.setHtml(htmlPageWithImages)

      Calling setHtml twice in succession seems to be buggy on 4.6 (it worked fine on 4.4 and 4.5). When the images did appear, they tended to appear after the page was loaded, as if they were remote images (even though they are local ones). On previous versions the page would not be displayed until the images had been loaded internally, so there is only one screen update. This means it takes a little longer to display the page, but for local images it's preferable to the flicker of rendering the page then updating it with images.

      Anyway, removing the first setHtml call seems to make WebKit revert to pre-4.6 behaviour, and only render the page once the images have already been loaded. This also seems to avoid the redraw bug, perhaps because the key that triggered the page update is still being pressed down.

      Attached is a shot of a widget that has yet to expand to its contents. It redraws correctly when the mouse is moved.

      Attachments

        Issue Links

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

          Activity

            People

              bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
              dae Damien Elmes
              Votes:
              8 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes