comparison mac/dw.m @ 2032:5ca399fb2d6f

Mac: Put back the delayed setNeedsDisplay workaround for Mojave only.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 15 Nov 2019 04:26:18 +0000
parents c4fc33d70a8e
children ea303d356419
comparison
equal deleted inserted replaced
2031:c4fc33d70a8e 2032:5ca399fb2d6f
1119 -(NSMenu *)menuForEvent:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); return nil; } 1119 -(NSMenu *)menuForEvent:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); return nil; }
1120 -(void)rightMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } 1120 -(void)rightMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); }
1121 -(void)otherMouseDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); } 1121 -(void)otherMouseDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 3); }
1122 -(void)otherMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); } 1122 -(void)otherMouseUp:(NSEvent *)theEvent { _event_handler(self, theEvent, 4); }
1123 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } 1123 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); }
1124 -(void)delayedNeedsDisplay { [self setNeedsDisplay:YES]; }
1124 -(void)drawRect:(NSRect)rect { 1125 -(void)drawRect:(NSRect)rect {
1125 _event_handler(self, nil, 7); 1126 _event_handler(self, nil, 7);
1126 #ifdef BUILDING_FOR_MOJAVE 1127 #ifdef BUILDING_FOR_MOJAVE
1127 if (cachedDrawingRep) 1128 if (cachedDrawingRep)
1128 { 1129 {
1129 [cachedDrawingRep drawInRect:self.bounds]; 1130 [cachedDrawingRep drawInRect:self.bounds];
1130 [_DWDirtyDrawables removeObject:self]; 1131 [_DWDirtyDrawables removeObject:self];
1131 [self setNeedsDisplay:YES]; 1132 /* Work around a bug in Mojave 10.14 by delaying the setNeedsDisplay */
1133 if(DWOSMinor != 14)
1134 [self setNeedsDisplay:YES];
1135 else
1136 [self performSelector:@selector(delayedNeedsDisplay) withObject:nil afterDelay:0];
1132 } 1137 }
1133 #endif 1138 #endif
1134 } 1139 }
1135 -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); } 1140 -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); }
1136 -(BOOL)isFlipped { return YES; } 1141 -(BOOL)isFlipped { return YES; }
4173 } 4178 }
4174 4179
4175 /* Display the dialog. If the OK button was pressed, 4180 /* Display the dialog. If the OK button was pressed,
4176 * process the files. 4181 * process the files.
4177 */ 4182 */
4178 #if defined(MAC_OS_X_VERSION_10_9) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) 4183 if([saveDlg runModal] == DWModalResponseOK)
4179 if([saveDlg runModal] == NSModalResponseOK)
4180 #else
4181 if([saveDlg runModal] == NSFileHandlingPanelOKButton)
4182 #endif
4183 { 4184 {
4184 /* Get an array containing the full filenames of all 4185 /* Get an array containing the full filenames of all
4185 * files and directories selected. 4186 * files and directories selected.
4186 */ 4187 */
4187 NSString* fileName = [[saveDlg URL] path]; 4188 NSString* fileName = [[saveDlg URL] path];