diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9bfcdf86..31361b86 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -57,6 +57,7 @@ video tutorials. - Jason Daly - danhambleton - Jarrod Davis + - Aaron Day - decce - Olivier Delannoy - Paul R. Deppe diff --git a/README.md b/README.md index 0723e835..1a0f3649 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Mouse wheel scroll distance was incorrect on some compositors - [Wayland] Bugfix: `glfwSwapBuffers` would halt with nonzero swap interval when window was suspended (#1350,#2582,#2640,#2719,#2723,#2800,#2827) + - [Wayland] Bugfix: `glfwPostEmptyEvent` would leak a callback proxy (#2836) - [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631) - [X11] Bugfix: Occasional crash when an idle display awakes (#2766) - [X11] Bugfix: Prevent BadWindow when creating small windows with a content scale diff --git a/src/wl_window.c b/src/wl_window.c index 931d5672..ce448075 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -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(); }