mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Win32: Improve clipboard contention issue
This is primarily a workaround for a GLFW application reading and/or writing to the clipboard in rapid succession and catching up with the Windows Clipboard History, which also has to contend for the lock.
This commit is contained in:
@@ -5814,6 +5814,11 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @remark @win32 The clipboard on Windows has a single global lock for reading and
|
||||
* writing. GLFW tries to acquire it a few times, which is almost always enough. If it
|
||||
* cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
|
||||
* It is safe to try this multiple times.
|
||||
*
|
||||
* @pointer_lifetime The specified string is copied before this function
|
||||
* returns.
|
||||
*
|
||||
@@ -5842,6 +5847,11 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
|
||||
* GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @remark @win32 The clipboard on Windows has a single global lock for reading and
|
||||
* writing. GLFW tries to acquire it a few times, which is almost always enough. If it
|
||||
* cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
|
||||
* It is safe to try this multiple times.
|
||||
*
|
||||
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
|
||||
* should not free it yourself. It is valid until the next call to @ref
|
||||
* glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
|
||||
|
||||
Reference in New Issue
Block a user