mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 00:29:27 +00:00
Misc macOS tweaks
This commit is contained in:
parent
fdc5bd33f0
commit
6f03b89283
|
@ -37,6 +37,8 @@ const NSString *kDrawTimerNotification = @"kDrawTimerNotification";
|
||||||
@property (nonatomic, retain) NSTimer *timer;
|
@property (nonatomic, retain) NSTimer *timer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@property (nonatomic) BOOL prepared;
|
||||||
|
|
||||||
- (void)initGL;
|
- (void)initGL;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -166,6 +168,8 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||||
|
|
||||||
// Register to be notified when the window closes so we can stop the displaylink
|
// Register to be notified when the window closes so we can stop the displaylink
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:[self window]];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:[self window]];
|
||||||
|
|
||||||
|
self.prepared = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowWillClose:(NSNotification*)notification
|
- (void)windowWillClose:(NSNotification*)notification
|
||||||
|
@ -316,6 +320,11 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||||
// Called during resize operations
|
// Called during resize operations
|
||||||
// Avoid flickering during resize by drawing
|
// Avoid flickering during resize by drawing
|
||||||
[[self openGLContext] makeCurrentContext];
|
[[self openGLContext] makeCurrentContext];
|
||||||
|
if (UNLIKELY(!self.prepared)) {
|
||||||
|
NSAlert *alert = [NSAlert alertWithError:[NSError errorWithDomain:@"NSOpenGLView is now deprecated and has a bug ... please restart this app. FIXME TODO : likely we're being forced to move to Metal because Ninjaz and Rockstarz said so :P" code:-1 userInfo:nil]];
|
||||||
|
[alert beginSheetModalForWindow:[self window] completionHandler:nil];
|
||||||
|
return;
|
||||||
|
}
|
||||||
[self drawView];
|
[self drawView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,9 @@
|
||||||
case NSInsertFunctionKey:
|
case NSInsertFunctionKey:
|
||||||
scode = SCODE_INS;
|
scode = SCODE_INS;
|
||||||
break;
|
break;
|
||||||
|
case NSDeleteCharacter:
|
||||||
|
scode = SCODE_L;
|
||||||
|
break;
|
||||||
case NSDeleteFunctionKey:
|
case NSDeleteFunctionKey:
|
||||||
scode = SCODE_DEL;
|
scode = SCODE_DEL;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user