Hey,
I've run into a problem with the clipping that is involved with
nsRenderingContextOS2::CopyOffscreenBits. There is a difference between
os/2 and Windows such that it will be possible in the OS/2 mozilla that
when drawing the cursor in nsCaret::DrawCaret that we'll use the same DC
during the ::InvertRect that we used during the CopyOffscreenBits.
Specifically, if I tab in a TEXTAREA such that scroll bars appear and
then I hit the home key, there will be a call to CopyOffscreenBits to
scoll the scrollbar back to the left side of the scroll area. Then
there will be a call to start the cursor blinking again. The problem is
that where we are drawing the cursor is outside the clip region that was
put in the DC during CopyOffscreenBits. That will cause the cursor not
to draw. Basically since it is outside the clip region, it won't draw
but in DrawCaret we'll still toggle the mDrawn flag. So now the caret
thinks that he has drawn, but in reality it isn't on the screen. Then
the next time we come through DrawCaret we'll do the InvertRect and draw
the cursor on the screen but also toggle mDrawn to 0. What I want to
know is whether there is any need for the clip region to exist in the DC
after the BitBlt is done from the offscreen DC to the target DC. Would
it be safe to remove the clipping region in the target DC before
returning from CopyOffscreenBits? I know that this might not be the
right thing for mozilla, but I just want to put this change in the OS2
code as a stop gap until we update our gfx code.
Please let me know if you see any harm in it. I am afraid of the
nsViewManager2::Refresh listeners. Maybe they assume the clipping is
set?