浏览代码

Wayland: Remove error reporting of external bugs

Not sure that GLFW should be reporting that another client has made an
invalid receive request.
Camilla Löwy 3 年之前
父节点
当前提交
8d216054ad
共有 1 个文件被更改,包括 3 次插入15 次删除
  1. 3 15
      src/wl_window.c

+ 3 - 15
src/wl_window.c

@@ -1591,10 +1591,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;
     }
@@ -1608,14 +1608,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)
@@ -1645,11 +1637,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;
 }