# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1564611778 0 # Node ID 22c96cd42eb8fc6a1e4cba8a01b0844f7776d0fa # Parent d510e9bb61c242a6569fd832fdc95bd8d5b4a257 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. diff -r d510e9bb61c2 -r 22c96cd42eb8 mac/dw.m --- 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 }