When exposing a window ensure that the rectangle is drawn to (if necessary)

before flushing the buffer.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23603 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-09-24 12:45:21 +00:00
parent 19870a4c7a
commit 3b65b34a1b

View file

@ -3371,12 +3371,31 @@ resetCursorRectsForView(NSView *theView)
{ {
case NSBackingStoreBuffered: case NSBackingStoreBuffered:
case NSBackingStoreRetained: case NSBackingStoreRetained:
/* The window is buffered/retained, so we expect the /*
* backend to have a copy of the region contents and * The backend may have the region buffered ...
* be able to draw it. * so we add it to the rectangle to be flushed
* and set the flag to say that a flush is required.
*/ */
[GSServerForWindow(self) flushwindowrect: region _rectNeedingFlush
: _windowNum]; = NSUnionRect(_rectNeedingFlush, region);
_f.needs_flush = YES;
if (_rFlags.needs_display)
{
/* Some or all of the window has not been drawn,
* so we must at least make sure that the exposed
* region gets drawn before its backing store is
* flushed ... otherwise we might actually flush
* bogus data from an out of date buffer.
* Maybe we should call
* [_wv displayIfNeededInRect: region]
* but why not do all drawing at this point so
* that if we get another expose event immediately
* (eg. something is dragged over the window and
* we get a series of expose events) we can just
* flush without having to draw again.
*/
[_wv displayIfNeeded];
}
break; break;
default: default: