GLFW: Add support for window occluded notifications on macOS

Based on: https://github.com/glfw/glfw/pull/1123
This commit is contained in:
Kovid Goyal
2019-02-18 09:34:26 +05:30
parent c8bb7aae40
commit dcb2d95f9a
9 changed files with 127 additions and 2 deletions

View File

@@ -425,6 +425,11 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
_glfwInputWindowPos(window, x, y);
}
- (void)windowDidChangeOcclusionState:(NSNotification *)notification
{
_glfwInputWindowOcclusion(window, !([window->ns.object occlusionState] & NSWindowOcclusionStateVisible));
}
- (void)windowDidMiniaturize:(NSNotification *)notification
{
if (window->monitor)
@@ -1671,6 +1676,11 @@ int _glfwPlatformWindowFocused(_GLFWwindow* window)
return [window->ns.object isKeyWindow];
}
int _glfwPlatformWindowOccluded(_GLFWwindow* window)
{
return !([window->ns.object occlusionState] & NSWindowOcclusionStateVisible);
}
int _glfwPlatformWindowIconified(_GLFWwindow* window)
{
return [window->ns.object isMiniaturized];