From bbeb08ba083c9fc0dea93af8f9ffecdf3e791318 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Feb 2019 14:41:06 +0530 Subject: [PATCH] Change docs for resize kludge on Cocoa --- kitty/glfw.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kitty/glfw.c b/kitty/glfw.c index e27fc2457..262eed208 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -136,17 +136,17 @@ framebuffer_size_callback(GLFWwindow *w, int width, int height) { window->has_pending_resizes = true; global_state.has_pending_resizes = true; window->last_resize_event_at = monotonic(); #ifdef __APPLE__ - // Cocoa starts a sub-loop inside wait events which means main_loop - // stays stuck and no rendering happens. This causes the window to be - // blank. This is particularly bad for semi-transparent windows since - // they are rendered as invisible, so for that case we manually render. - if (global_state.callback_os_window->is_semi_transparent) { - make_os_window_context_current(global_state.callback_os_window); - blank_os_window(global_state.callback_os_window); - swap_window_buffers(global_state.callback_os_window); + // On cocoa request_tick_callback() does not work while the window + // is being resized, because that happens in a sub-loop. With semi-transparent + // windows that is a problem as the scaled background gets blended into + // the final background, so we explicitly blank the window here. + if (window->is_semi_transparent) { + make_os_window_context_current(window); + blank_os_window(window); + swap_window_buffers(window); } #endif - request_tick_callback(); + request_tick_callback(); } else log_error("Ignoring resize request for tiny size: %dx%d", width, height); global_state.callback_os_window = NULL; }