Change docs for resize kludge on Cocoa
This commit is contained in:
parent
66dbdf4b40
commit
bbeb08ba08
18
kitty/glfw.c
18
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->has_pending_resizes = true; global_state.has_pending_resizes = true;
|
||||||
window->last_resize_event_at = monotonic();
|
window->last_resize_event_at = monotonic();
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// Cocoa starts a sub-loop inside wait events which means main_loop
|
// On cocoa request_tick_callback() does not work while the window
|
||||||
// stays stuck and no rendering happens. This causes the window to be
|
// is being resized, because that happens in a sub-loop. With semi-transparent
|
||||||
// blank. This is particularly bad for semi-transparent windows since
|
// windows that is a problem as the scaled background gets blended into
|
||||||
// they are rendered as invisible, so for that case we manually render.
|
// the final background, so we explicitly blank the window here.
|
||||||
if (global_state.callback_os_window->is_semi_transparent) {
|
if (window->is_semi_transparent) {
|
||||||
make_os_window_context_current(global_state.callback_os_window);
|
make_os_window_context_current(window);
|
||||||
blank_os_window(global_state.callback_os_window);
|
blank_os_window(window);
|
||||||
swap_window_buffers(global_state.callback_os_window);
|
swap_window_buffers(window);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
request_tick_callback();
|
request_tick_callback();
|
||||||
} else log_error("Ignoring resize request for tiny size: %dx%d", width, height);
|
} else log_error("Ignoring resize request for tiny size: %dx%d", width, height);
|
||||||
global_state.callback_os_window = NULL;
|
global_state.callback_os_window = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user