Change docs for resize kludge on Cocoa

This commit is contained in:
Kovid Goyal 2019-02-28 14:41:06 +05:30
parent 66dbdf4b40
commit bbeb08ba08
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -136,14 +136,14 @@ 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();