Move Win32 clipboard code to helper window

This commit is contained in:
Camilla Berglund 2015-11-21 21:54:42 +01:00
parent 4cd493dd9a
commit 5c98a44603

View File

@ -1341,7 +1341,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
memcpy(GlobalLock(stringHandle), wideString, wideSize); memcpy(GlobalLock(stringHandle), wideString, wideSize);
GlobalUnlock(stringHandle); GlobalUnlock(stringHandle);
if (!OpenClipboard(window->win32.handle)) if (!OpenClipboard(_glfw.win32.helperWindow))
{ {
GlobalFree(stringHandle); GlobalFree(stringHandle);
free(wideString); free(wideString);
@ -1361,7 +1361,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
{ {
HANDLE stringHandle; HANDLE stringHandle;
if (!OpenClipboard(window->win32.handle)) if (!OpenClipboard(_glfw.win32.helperWindow))
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard"); _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard");
return NULL; return NULL;