From 748f1a90b97bc6a6416186c077048cdef801d75c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Mar 2019 18:15:27 +0530 Subject: [PATCH] Move swap interval setting to just before swap buffers --- kitty/glfw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/glfw.c b/kitty/glfw.c index 5b8db01d8..8c8ef51a8 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -545,9 +545,6 @@ create_os_window(PyObject UNUSED *self, PyObject *args) { GLFWwindow *temp_window = glfwCreateWindow(640, 480, "temp", NULL, common_context); if (temp_window == NULL) { fatal("Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers."); } -#ifndef __APPLE__ - if (is_first_window) glfwSwapInterval(OPT(sync_to_monitor) && !global_state.is_wayland ? 1 : 0); -#endif float xscale, yscale; double xdpi, ydpi; get_window_content_scale(temp_window, &xscale, &yscale, &xdpi, &ydpi); @@ -573,6 +570,9 @@ create_os_window(PyObject UNUSED *self, PyObject *args) { // blank the window once so that there is no initial flash of color // changing, in case the background color is not black blank_canvas(is_semi_transparent ? OPT(background_opacity) : 1.0f); +#ifndef __APPLE__ + if (is_first_window) glfwSwapInterval(OPT(sync_to_monitor) && !global_state.is_wayland ? 1 : 0); +#endif glfwSwapBuffers(glfw_window); if (!global_state.is_wayland) { PyObject *pret = PyObject_CallFunction(pre_show_callback, "N", native_window_handle(glfw_window));