diff --git a/docs/changelog.rst b/docs/changelog.rst index 6da059bd4..d7bb970e6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -81,6 +81,8 @@ Detailed list of changes - :ac:`goto_tab`: Allow numbers less than ``-1`` to go to the Nth previously active tab +- Wayland: Fix for upcoming explicit sync changes in Wayland compositors breaking kitty (:iss:`7767`) + 0.36.1 [2024-08-24] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 0b1566d0f..92301f484 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -1320,30 +1320,8 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, window->swaps_disallowed = true; if (!createSurface(window, wndconfig)) return false; - - if (ctxconfig->client != GLFW_NO_API) - { - if (ctxconfig->source == GLFW_EGL_CONTEXT_API || - ctxconfig->source == GLFW_NATIVE_CONTEXT_API) - { - if (!_glfwInitEGL()) - return false; - if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) - return false; - } - else if (ctxconfig->source == GLFW_OSMESA_CONTEXT_API) - { - if (!_glfwInitOSMesa()) - return false; - if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig)) - return false; - } - } - - if (wndconfig->title) - window->wl.title = _glfw_strdup(wndconfig->title); - if (wndconfig->maximized) - window->wl.maximize_on_first_show = true; + if (wndconfig->title) window->wl.title = _glfw_strdup(wndconfig->title); + if (wndconfig->maximized) window->wl.maximize_on_first_show = true; if (wndconfig->visible) { @@ -1367,6 +1345,24 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, window->wl.monitorsCount = 0; window->wl.monitorsSize = 1; if (window->wl.visible) loop_till_window_fully_created(window); + if (ctxconfig->client != GLFW_NO_API) + { + if (ctxconfig->source == GLFW_EGL_CONTEXT_API || + ctxconfig->source == GLFW_NATIVE_CONTEXT_API) + { + if (!_glfwInitEGL()) + return false; + if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) + return false; + } + else if (ctxconfig->source == GLFW_OSMESA_CONTEXT_API) + { + if (!_glfwInitOSMesa()) + return false; + if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig)) + return false; + } + } return true; }