WM_{ERASEBKGND/PAINT} <-> ScrollWindowEx race

Dimitrie O. Paun dpaun at rogers.com
Mon Sep 30 20:52:52 CDT 2002


Hi folks,

Some time ago I reported a drawing problem that appeared often
in the Common Control Spy. The reason it happens there, is that
that application has a listbox which lists messages, and notification
received/sent by the control. Well, this listbox scrolls
automatically (quite fast at that) as there are quite a few
messages/notifications sent, and if you obstruct it partially 
with a dialog box that you drag around, you can easily replicate 
the bug.

What happens is that a part of the dialog's caption is scrolled up,
and not erased. I've attached a snapshot of the problem -- please
take a look at it.

I was thinking about it, and I think I know what the problem is:
  1. you drag the dialog box down
  2. this invalidates a portion of the listbox (this invalidated
     portion contains part of the old caption of the dialog)
  3. for whatever reason, the listbox gets new items, and is
     scrolled (using ScrollWindowEx), *before* it gets a
     WM_ERASEBKGND/WM_PAINT message.
  4. ScrollWindowEx scrolls the content of the window *including*
     the invalidated area which contains the portion of the caption.
 *5. ScollWindowEx fails to extend the "scroll" update the portion
     of the update region (wndPtr->hrgnUpdate).

As you can see, the bug happens at step5. That is, if we scroll a
rectangle that intersects the update region, we have to "scroll"
the update window as well (in the portion that it intersects).

For example, say we have a simple update region: [0,50,100,100],
and we scroll the rectangle [0,0,100,60] by 30 units up,
we have to end up with an update region of [0,20,100,100].
I don't think that we do, right now.

Can anyone familiar with the code (dlls/x11drv/scroll.c) take
a look, and see what's going on?

-- 
Dimi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scroll-bug.jpg
Type: image/jpeg
Size: 13425 bytes
Desc: Bug snapshot
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20020930/168889e5/scroll-bug.jpg


More information about the wine-devel mailing list