diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 143a8e4e2..c83d8c8b5 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -568,16 +568,6 @@ static GLFWapplicationshouldhandlereopenfun handle_reopen_callback = NULL; [super dealloc]; } --(void)setLayer:(CALayer*)layer -{ - [super setLayer:layer]; - if (window->context.client != GLFW_NO_API) { - // this is needed for initial rendering on mojave, see - // https://github.com/kovidgoyal/kitty/issues/887 - [window->context.nsgl.object update]; - } -} - - (_GLFWwindow*)glfwWindow { return window; } @@ -602,6 +592,14 @@ static GLFWapplicationshouldhandlereopenfun handle_reopen_callback = NULL; return YES; } +- (void)updateLayer +{ + if (window->context.client != GLFW_NO_API) + [window->context.nsgl.object update]; + + _glfwInputWindowDamage(window); +} + - (id)makeBackingLayer { if (window->ns.layer)