Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
1966:d510e9bb61c2 | 1967:22c96cd42eb8 |
---|---|
1091 -(NSMenu *)menuForEvent:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); return nil; } | 1091 -(NSMenu *)menuForEvent:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); return nil; } |
1092 -(void)rightMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } | 1092 -(void)rightMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } |
1093 -(void)otherMouseDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); } | 1093 -(void)otherMouseDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); } |
1094 -(void)otherMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } | 1094 -(void)otherMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } |
1095 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } | 1095 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } |
1096 -(void)delayedNeedsDisplay { [self setNeedsDisplay:YES]; } | |
1096 -(void)drawRect:(NSRect)rect { | 1097 -(void)drawRect:(NSRect)rect { |
1097 _event_handler(self, nil, 7); | 1098 _event_handler(self, nil, 7); |
1098 #ifdef BUILDING_FOR_MOJAVE | 1099 #ifdef BUILDING_FOR_MOJAVE |
1099 if (cachedDrawingRep) | 1100 if (cachedDrawingRep) |
1100 { | 1101 { |
1101 [cachedDrawingRep drawInRect:self.bounds]; | 1102 [cachedDrawingRep drawInRect:self.bounds]; |
1102 [_DWDirtyDrawables removeObject:self]; | 1103 [_DWDirtyDrawables removeObject:self]; |
1103 self.needsDisplay = YES; | 1104 [self performSelector:@selector(delayedNeedsDisplay) withObject:nil afterDelay:0]; |
1104 } | 1105 } |
1105 #endif | 1106 #endif |
1106 } | 1107 } |
1107 -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); } | 1108 -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); } |
1108 -(BOOL)isFlipped { return YES; } | 1109 -(BOOL)isFlipped { return YES; } |