mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
macOS: Render OS windows during windowDidResize for even smoother live resize rendering
This commit is contained in:
1
glfw/cocoa_platform.h
vendored
1
glfw/cocoa_platform.h
vendored
@@ -157,6 +157,7 @@ typedef struct _GLFWwindowNS
|
||||
GLFWcocoarenderframefun renderFrameCallback;
|
||||
// update cursor after switching desktops with Mission Control
|
||||
bool delayed_cursor_update_requested;
|
||||
GLFWcocoarenderframefun resizeCallback;
|
||||
} _GLFWwindowNS;
|
||||
|
||||
typedef struct _GLFWDisplayLinkNS
|
||||
|
||||
@@ -646,6 +646,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
window->ns.height = (int)contentRect.size.height;
|
||||
_glfwInputWindowSize(window, (int)contentRect.size.width, (int)contentRect.size.height);
|
||||
}
|
||||
if (window->ns.resizeCallback) window->ns.resizeCallback((GLFWwindow*)window);
|
||||
}
|
||||
|
||||
- (void)windowDidMove:(NSNotification *)notification
|
||||
@@ -2964,6 +2965,13 @@ GLFWAPI int glfwCocoaSetBackgroundBlur(GLFWwindow *w, int radius) {
|
||||
return orig;
|
||||
}
|
||||
|
||||
GLFWAPI GLFWcocoarenderframefun glfwCocoaSetWindowResizeCallback(GLFWwindow *w, GLFWcocoarenderframefun cb) {
|
||||
_GLFWwindow* window = (_GLFWwindow*)w;
|
||||
GLFWcocoarenderframefun current = window->ns.resizeCallback;
|
||||
window->ns.resizeCallback = cb;
|
||||
return current;
|
||||
}
|
||||
|
||||
GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool use_system_color, unsigned int system_color, int background_blur, unsigned int hide_window_decorations, bool show_text_in_titlebar, int color_space, float background_opacity, bool resizable) { @autoreleasepool {
|
||||
_GLFWwindow* window = (_GLFWwindow*)w;
|
||||
const bool is_transparent = ![window->ns.object isOpaque];
|
||||
|
||||
@@ -248,6 +248,7 @@ def generate_wrappers(glfw_header: str) -> None:
|
||||
GLFWapplicationwillfinishlaunchingfun glfwSetApplicationWillFinishLaunching(GLFWapplicationwillfinishlaunchingfun callback)
|
||||
uint32_t glfwGetCocoaKeyEquivalent(uint32_t glfw_key, int glfw_mods, int* cocoa_mods)
|
||||
void glfwCocoaRequestRenderFrame(GLFWwindow *w, GLFWcocoarenderframefun callback)
|
||||
GLFWcocoarenderframefun glfwCocoaSetWindowResizeCallback(GLFWwindow *w, GLFWcocoarenderframefun callback)
|
||||
int glfwCocoaSetBackgroundBlur(GLFWwindow *w, int blur_radius)
|
||||
bool glfwSetX11WindowBlurred(GLFWwindow *w, bool enable_blur)
|
||||
void* glfwGetX11Display(void)
|
||||
|
||||
Reference in New Issue
Block a user