Wayland: Fix glfwPostEmptyEvent leaking a proxy

The client-side proxy of the callback from each call to wl_display_sync
was never destroyed.

Fixes #2836
This commit is contained in:
Camilla Löwy
2026-03-11 19:52:04 +01:00
parent 50b0a135a5
commit bb8048122a
3 changed files with 15 additions and 1 deletions
+13 -1
View File
@@ -199,6 +199,16 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image)
return buffer;
}
static void callbackHandleDone(void* userData, struct wl_callback* callback, uint32_t data)
{
wl_callback_destroy(callback);
}
static const struct wl_callback_listener noopCallbackListener =
{
callbackHandleDone
};
static void createFallbackEdge(_GLFWwindow* window,
_GLFWfallbackEdgeWayland* edge,
struct wl_surface* parent,
@@ -2930,7 +2940,9 @@ void _glfwWaitEventsTimeoutWayland(double timeout)
void _glfwPostEmptyEventWayland(void)
{
wl_display_sync(_glfw.wl.display);
struct wl_callback* callback = wl_display_sync(_glfw.wl.display);
wl_callback_add_listener(callback, &noopCallbackListener, NULL);
flushDisplay();
}