Mercurial > dwindows
changeset 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 | d81d2ea806c6 |
files | mac/dw.m |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Fri Nov 15 03:31:17 2019 +0000 +++ b/mac/dw.m Fri Nov 15 04:26:18 2019 +0000 @@ -1121,6 +1121,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 @@ -1128,7 +1129,11 @@ { [cachedDrawingRep drawInRect:self.bounds]; [_DWDirtyDrawables removeObject:self]; - [self setNeedsDisplay:YES]; + /* Work around a bug in Mojave 10.14 by delaying the setNeedsDisplay */ + if(DWOSMinor != 14) + [self setNeedsDisplay:YES]; + else + [self performSelector:@selector(delayedNeedsDisplay) withObject:nil afterDelay:0]; } #endif } @@ -4175,11 +4180,7 @@ /* Display the dialog. If the OK button was pressed, * process the files. */ -#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)) - if([saveDlg runModal] == NSModalResponseOK) -#else - if([saveDlg runModal] == NSFileHandlingPanelOKButton) -#endif + if([saveDlg runModal] == DWModalResponseOK) { /* Get an array containing the full filenames of all * files and directories selected.