From 9e852ec39e504e2280afc4db893a5731f3abfb72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 24 Mar 2022 20:45:00 +0100 Subject: [PATCH] Wayland: Remove error reporting of external bugs Not sure that GLFW should be reporting that another client has made an invalid receive request. (cherry picked from commit 8d216054ad89ecd1030fe066a42d80a9d2765216) --- src/wl_window.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 3ac00fbd..da7b271e 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1725,10 +1725,10 @@ static void dataSourceHandleSend(void* userData, const char* mimeType, int fd) { - if (_glfw.wl.selectionSource != source) + // Ignore it if this is an outdated or invalid request + if (_glfw.wl.selectionSource != source || + strcmp(mimeType, "text/plain;charset=utf-8") != 0) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Unknown clipboard data source"); close(fd); return; } @@ -1742,14 +1742,6 @@ static void dataSourceHandleSend(void* userData, return; } - if (strcmp(mimeType, "text/plain;charset=utf-8") != 0) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Wrong MIME type asked from clipboard"); - close(fd); - return; - } - size_t length = strlen(string); while (length > 0) @@ -1779,11 +1771,7 @@ static void dataSourceHandleCancelled(void* userData, wl_data_source_destroy(source); if (_glfw.wl.selectionSource != source) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Unknown clipboard data source"); return; - } _glfw.wl.selectionSource = NULL; }