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:
CaS 2002-06-28 08:05:49 +00:00
parent 4180dbf84f
commit 9df20632e8
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> Thu Jun 27 11:49:57 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSTextField.m ([-textDidEndEditing:]): Set _text_object * 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 - (void) flushWindow
{ {
int i; int i;
NSGraphicsContext* context = GSCurrentContext();
// 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; return;
} }
if (_disableFlushWindow) // if flushWindow is called /*
{ // while flush is disabled * Just flush graphics if backing is not buffered.
_f.needs_flush = YES; // mark self as needing a * The documentation actually says that this is wrong ... the method
return; // flush, then return * 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. /* Check for special case of flushing while we are lock focused.
@ -1807,12 +1820,14 @@ static NSNotificationCenter *nc = nil;
while (i-- > 0) while (i-- > 0)
{ {
_rectNeedingFlush = NSUnionRect(_rectNeedingFlush, _rectNeedingFlush = NSUnionRect(_rectNeedingFlush,
[[_rectsBeingDrawn objectAtIndex: i] rectValue]); [[_rectsBeingDrawn objectAtIndex: i] rectValue]);
} }
if (_windowNum) if (_windowNum > 0)
[GSServerForWindow(self) flushwindowrect: _rectNeedingFlush {
: _windowNum]; [GSServerForWindow(self) flushwindowrect: _rectNeedingFlush
: _windowNum];
}
_f.needs_flush = NO; _f.needs_flush = NO;
_rectNeedingFlush = NSZeroRect; _rectNeedingFlush = NSZeroRect;
} }