GLFW: Add support for window occluded notifications on macOS
Based on: https://github.com/glfw/glfw/pull/1123
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user