mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 21:30:57 +00:00
Merge b03ee5bc1b
into 8f0fd7ecf5
This commit is contained in:
commit
8e1c0ae345
@ -651,6 +651,17 @@ static int translateKey(unsigned int key)
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (float)titleBarHeight
|
||||||
|
{
|
||||||
|
NSRect frame = NSMakeRect (0, 0, 100, 100);
|
||||||
|
|
||||||
|
NSRect contentRect;
|
||||||
|
contentRect = [NSWindow contentRectForFrameRect: frame
|
||||||
|
styleMask: NSTitledWindowMask];
|
||||||
|
|
||||||
|
return (frame.size.height - contentRect.size.height);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@ -911,6 +922,10 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
||||||
[window->ns.object setContentView:window->ns.view];
|
[window->ns.object setContentView:window->ns.view];
|
||||||
|
|
||||||
|
// OS X puts an application into "App Nap" if it's window size drops below 4-pixels.
|
||||||
|
NSUInteger minWindowHeight = 4;
|
||||||
|
[window->ns.object setMinSize:NSMakeSize(0, [window->ns.object titleBarHeight] + minWindowHeight)];
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
|
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
|
||||||
[window->ns.object setRestorable:NO];
|
[window->ns.object setRestorable:NO];
|
||||||
|
Loading…
Reference in New Issue
Block a user