mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
GLFW: Add support for window occluded notifications on macOS
Based on: https://github.com/glfw/glfw/pull/1123
This commit is contained in:
21
glfw/window.c
vendored
21
glfw/window.c
vendored
@@ -88,6 +88,14 @@ _GLFWwindow* _glfwWindowForId(GLFWid id) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Notifies shared code that a window's occlusion state has changed
|
||||
//
|
||||
void _glfwInputWindowOcclusion(_GLFWwindow* window, GLFWbool occluded)
|
||||
{
|
||||
if (window->callbacks.occlusion)
|
||||
window->callbacks.occlusion((GLFWwindow*) window, occluded);
|
||||
}
|
||||
|
||||
// Notifies shared code that a window has moved
|
||||
// The position is specified in content area relative screen coordinates
|
||||
//
|
||||
@@ -867,6 +875,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
|
||||
return window->focusOnShow;
|
||||
case GLFW_TRANSPARENT_FRAMEBUFFER:
|
||||
return _glfwPlatformFramebufferTransparent(window);
|
||||
case GLFW_OCCLUDED:
|
||||
return _glfwPlatformWindowOccluded(window);
|
||||
case GLFW_RESIZABLE:
|
||||
return window->resizable;
|
||||
case GLFW_DECORATED:
|
||||
@@ -1068,6 +1078,17 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* handle,
|
||||
return cbfun;
|
||||
}
|
||||
|
||||
GLFWAPI GLFWwindowocclusionfun glfwSetWindowOcclusionCallback(GLFWwindow* handle,
|
||||
GLFWwindowocclusionfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
assert(window != NULL);
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
_GLFW_SWAP_POINTERS(window->callbacks.occlusion, cbfun);
|
||||
return cbfun;
|
||||
}
|
||||
|
||||
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* handle,
|
||||
GLFWwindowiconifyfun cbfun)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user