Mercurial > dwindows
diff mac/dw.m @ 1967:22c96cd42eb8
Mac: Another attempt at fixing the drawRect issue, the last fix resulted in
more needsDisplay exceptions in other applications. This fix is not
perfect, but it results in correct display and no exceptions. However in
the test app, the one render does not always update until you stop moving
the scroll bar. Will leave this implementation until a better fix is found.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 31 Jul 2019 22:22:58 +0000 |
parents | 6315f668f5f6 |
children | a806773066f6 |
line wrap: on
line diff
--- a/mac/dw.m Tue Jul 30 07:53:57 2019 +0000 +++ b/mac/dw.m Wed Jul 31 22:22:58 2019 +0000 @@ -1093,6 +1093,7 @@ -(void)otherMouseDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); } -(void)otherMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } +-(void)delayedNeedsDisplay { [self setNeedsDisplay:YES]; } -(void)drawRect:(NSRect)rect { _event_handler(self, nil, 7); #ifdef BUILDING_FOR_MOJAVE @@ -1100,7 +1101,7 @@ { [cachedDrawingRep drawInRect:self.bounds]; [_DWDirtyDrawables removeObject:self]; - self.needsDisplay = YES; + [self performSelector:@selector(delayedNeedsDisplay) withObject:nil afterDelay:0]; } #endif }