Update for macOS 10.13 (#13)
This commit is contained in:
parent
4f01702f81
commit
cb49ea94a0
@ -22,9 +22,9 @@ int mfb_open(const char* name, int width, int height)
|
|||||||
|
|
||||||
[NSApplication sharedApplication];
|
[NSApplication sharedApplication];
|
||||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||||
|
|
||||||
unsigned int styles = NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask;
|
NSWindowStyleMask styles = NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskTitled;
|
||||||
|
|
||||||
NSRect rectangle = NSMakeRect(0, 0, width, height);
|
NSRect rectangle = NSMakeRect(0, 0, width, height);
|
||||||
window_ = [[OSXWindow alloc] initWithContentRect:rectangle styleMask:styles backing:NSBackingStoreBuffered defer:NO];
|
window_ = [[OSXWindow alloc] initWithContentRect:rectangle styleMask:styles backing:NSBackingStoreBuffered defer:NO];
|
||||||
|
|
||||||
@ -62,13 +62,13 @@ static int updateEvents()
|
|||||||
{
|
{
|
||||||
int state = 0;
|
int state = 0;
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||||
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
|
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||||
if (event)
|
if (event)
|
||||||
{
|
{
|
||||||
switch ([event type])
|
switch ([event type])
|
||||||
{
|
{
|
||||||
case NSKeyDown:
|
case NSEventTypeKeyDown:
|
||||||
case NSKeyUp:
|
case NSEventTypeKeyUp:
|
||||||
{
|
{
|
||||||
state = -1;
|
state = -1;
|
||||||
break;
|
break;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
- (id)initWithContentRect:(NSRect)contentRect
|
- (id)initWithContentRect:(NSRect)contentRect
|
||||||
styleMask:(NSUInteger)windowStyle
|
styleMask:(NSWindowStyleMask)windowStyle
|
||||||
backing:(NSBackingStoreType)bufferingType
|
backing:(NSBackingStoreType)bufferingType
|
||||||
defer:(BOOL)deferCreation
|
defer:(BOOL)deferCreation
|
||||||
{
|
{
|
||||||
@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
+ (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSUInteger)windowStyle
|
+ (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSWindowStyleMask)windowStyle
|
||||||
{
|
{
|
||||||
(void)windowStyle;
|
(void)windowStyle;
|
||||||
return NSInsetRect(windowContentRect, 0, 0);
|
return NSInsetRect(windowContentRect, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user