Flushing fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13990 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-06-28 08:05:49 +00:00
parent e34fae1835
commit bcf07f45a6
2 changed files with 35 additions and 13 deletions

View file

@ -1,3 +1,10 @@
2002-06-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSWindow.m: ([-flushWindow]) don't flush context for
non-retained windows unless flushing is enabled. Actually I'm
not sure about this ... according to the documentation this
method should never flush non-retained windows anyway.
Thu Jun 27 11:49:57 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSTextField.m ([-textDidEndEditing:]): Set _text_object

View file

@ -1771,22 +1771,35 @@ static NSNotificationCenter *nc = nil;
}
}
/**
* Flush all drawing in the windows buffer to the screen unless the window
* is not buffered or flushing is not enabled.
*/
- (void) flushWindow
{
int i;
NSGraphicsContext* context = GSCurrentContext();
int i;
// do nothing if backing is not buffered
if (_backingType == NSBackingStoreNonretained)
/*
* If flushWindow is called while flush is disabled
* mark self as needing a flush, then return
*/
if (_disableFlushWindow)
{
[context flushGraphics];
_f.needs_flush = YES;
return;
}
if (_disableFlushWindow) // if flushWindow is called
{ // while flush is disabled
_f.needs_flush = YES; // mark self as needing a
return; // flush, then return
/*
* Just flush graphics if backing is not buffered.
* The documentation actually says that this is wrong ... the method
* should do nothing when the backingType is NSBackingStoreNonretained
*/
if (_backingType == NSBackingStoreNonretained)
{
NSGraphicsContext *context = GSCurrentContext();
[context flushGraphics];
return;
}
/* Check for special case of flushing while we are lock focused.
@ -1807,12 +1820,14 @@ static NSNotificationCenter *nc = nil;
while (i-- > 0)
{
_rectNeedingFlush = NSUnionRect(_rectNeedingFlush,
[[_rectsBeingDrawn objectAtIndex: i] rectValue]);
[[_rectsBeingDrawn objectAtIndex: i] rectValue]);
}
if (_windowNum)
[GSServerForWindow(self) flushwindowrect: _rectNeedingFlush
: _windowNum];
if (_windowNum > 0)
{
[GSServerForWindow(self) flushwindowrect: _rectNeedingFlush
: _windowNum];
}
_f.needs_flush = NO;
_rectNeedingFlush = NSZeroRect;
}