mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-20 02:57:19 +03:00
Better fix for initial window render failure on mojave
This commit is contained in:
parent
d24977d164
commit
ae9d049011
@ -568,6 +568,16 @@ - (void)dealloc
|
||||
[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;
|
||||
}
|
||||
|
@ -99,12 +99,6 @@ + (GlobalMenuTarget *) shared_instance
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_update_nsgl_context(void* id) {
|
||||
NSOpenGLContext *ctx = id;
|
||||
[ctx update];
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_create_global_menu(void) {
|
||||
NSString* app_name = find_app_name();
|
||||
|
@ -14,7 +14,6 @@ extern bool cocoa_toggle_fullscreen(void *w, bool);
|
||||
extern void cocoa_create_global_menu(void);
|
||||
extern void cocoa_set_hide_from_tasks(void);
|
||||
extern void cocoa_set_titlebar_color(void *w, color_type color);
|
||||
extern void cocoa_update_nsgl_context(void* id);
|
||||
|
||||
|
||||
#if GLFW_KEY_LAST >= MAX_KEY_COUNT
|
||||
@ -816,13 +815,6 @@ is_mouse_hidden(OSWindow *w) {
|
||||
|
||||
void
|
||||
swap_window_buffers(OSWindow *w) {
|
||||
#ifdef __APPLE__
|
||||
if (w->nsgl_ctx_updated++ < 2) {
|
||||
// Needed on Mojave for initial window render, see
|
||||
// https://github.com/kovidgoyal/kitty/issues/887
|
||||
cocoa_update_nsgl_context(glfwGetNSGLContext(w->handle));
|
||||
}
|
||||
#endif
|
||||
glfwSwapBuffers(w->handle);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user