macOS: Implement background blurring

Uses a private API that allows us to control the amount of blurring.
While using a private API is obviously not ideal, it is used by both
iTerm.app and Apple's own Terminal.app, so hopefully it should stick
around. Fixes #6135
This commit is contained in:
Kovid Goyal
2023-06-27 08:48:16 +05:30
parent 326b81a970
commit 7a1bdb4ff1
15 changed files with 89 additions and 1 deletions

5
glfw/window.c vendored
View File

@@ -334,6 +334,8 @@ void glfwDefaultWindowHints(void)
_glfw.hints.window.ns.retina = true;
// use the default colorspace assigned by the system
_glfw.hints.window.ns.color_space = 0;
// no blur
_glfw.hints.window.ns.blur_radius = 0;
}
GLFWAPI void glfwWindowHint(int hint, int value)
@@ -417,6 +419,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
case GLFW_COCOA_COLOR_SPACE:
_glfw.hints.window.ns.color_space = value;
return;
case GLFW_COCOA_BLUR_RADIUS:
_glfw.hints.window.ns.blur_radius = value;
return;
case GLFW_COCOA_GRAPHICS_SWITCHING:
_glfw.hints.context.nsgl.offline = value ? true : false;
return;