Only warn about failure to primary select once

This commit is contained in:
Kovid Goyal 2018-10-31 09:09:46 +05:30
parent e5d9182606
commit 7db6318806
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

8
glfw/wl_window.c vendored
View File

@ -1969,8 +1969,12 @@ const char* _glfwPlatformGetClipboardString(void)
void _glfwPlatformSetPrimarySelectionString(const char* string)
{
if (!_glfw.wl.primarySelectionDevice) {
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Cannot copy no primary selection device available");
static GLFWbool warned_about_primary_selection_device = GLFW_FALSE;
if (!warned_about_primary_selection_device) {
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Cannot copy no primary selection device available");
warned_about_primary_selection_device = GLFW_TRUE;
}
return;
}
if (_glfw.wl.primarySelectionString == string) return;