Transparency with dialogs (and repaint)

I cannot seem to figure out how to get around an apparent bug with the
way that things get repainted after being re-exposed/re-painted.

My basic problem is that I have dialog windows that have transparent
corners (to give it a rounded look - customer wants this rounded look).
The dialogs use a PtLabel as the background. The dialog and background
label are set to fill transparent. The corners are 20x20 pixels.

So, I have one main application 640x480. Lets say for example, I have one
dialog window opened on top of it, and another dialog on top of the
first dialog. When the 2nd dialog is dismissed, the corners
of the first that are transparent are not repainted properly. I see the
remnant of the 2nd dialog that previously occupied that position on screen.

If I, just for experimentation, place a pterm over the application and
move it away, all the corners do not repaint.

The painting order that seems to be happening is this:

  • dialog 2 (all)
  • dialog 1 (parts not covered by dialog 2)
  • main app (everything else)

The problem is that when the dialogs paint to refresh the screen, the corners
do not show the desired content of the dialog/screen underneath. The stuff
underneat is not yet painted, so the corner stays the color of the thing that
was on top.

Any suggestions? I tried to damage the corners of the dialogs, but that didn’t
seem to help.

Ideas welcome.

Thanks in advance,