Update for macOS 10.13 (#13)

This commit is contained in:
Robert Swain 2018-08-26 08:47:18 +02:00 committed by Daniel Collin
parent 4f01702f81
commit cb49ea94a0
2 changed files with 9 additions and 9 deletions

View File

@ -22,9 +22,9 @@ int mfb_open(const char* name, int width, int height)
[NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
unsigned int styles = NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask;
NSWindowStyleMask styles = NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskTitled;
NSRect rectangle = NSMakeRect(0, 0, width, height);
window_ = [[OSXWindow alloc] initWithContentRect:rectangle styleMask:styles backing:NSBackingStoreBuffered defer:NO];
@ -62,13 +62,13 @@ static int updateEvents()
{
int state = 0;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
if (event)
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
if (event)
{
switch ([event type])
{
case NSKeyDown:
case NSKeyUp:
case NSEventTypeKeyDown:
case NSEventTypeKeyUp:
{
state = -1;
break;

View File

@ -6,7 +6,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)windowStyle
styleMask:(NSWindowStyleMask)windowStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)deferCreation
{
@ -137,7 +137,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSUInteger)windowStyle
+ (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSWindowStyleMask)windowStyle
{
(void)windowStyle;
return NSInsetRect(windowContentRect, 0, 0);