From eac18b9324d008f8d30ccfec6e28307e0f4f8ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 3 Mar 2022 21:46:50 +0100 Subject: [PATCH] Wayland: Fix glfwPostEmptyEvent not always working The display sync requests in glfwPostEmptyEvent could just accumulate as the display was never flushed on secondary threads. This adds a proper flush after each sync request. Fixes #1520 Closes #1521 (cherry picked from commit a32cbf6d4febde6343167f19529b8bde8966670d) --- README.md | 1 + src/wl_window.c | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index f0c1ac02..22d97bde 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Full screen window creation did not ignore `GLFW_VISIBLE` - [Wayland] Bugfix: Some keys were reported as wrong key or `GLFW_KEY_UNKNOWN` - [Wayland] Bugfix: Text input did not repeat along with key repeat + - [Wayland] Bugfix: `glfwPostEmptyEvent` sometimes had no effect (#1520,#1521) - [GLX] Bugfix: Context creation failed if GLX 1.4 was not exported by GLX library diff --git a/src/wl_window.c b/src/wl_window.c index 2e3c6843..2b8614dd 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1393,6 +1393,7 @@ void _glfwPlatformWaitEventsTimeout(double timeout) void _glfwPlatformPostEmptyEvent(void) { wl_display_sync(_glfw.wl.display); + flushDisplay(); } void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos)