mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
Wayland: Move creation of OpenGL context to end of window creation function
Apparently with explicit sync it is now not possible to attach a temporary buffer to a surface that also has an OpenGL context. So we first attach the temporary buffer, and only after we are done waiting for window creation do we attach the OpenGL context to the window surface. Fixes #7767 (maybe, not installing sway-git to check)
This commit is contained in:
parent
75f5908009
commit
0594033b31
2 changed files with 22 additions and 24 deletions
|
|
@ -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]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
44
glfw/wl_window.c
vendored
44
glfw/wl_window.c
vendored
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue