Wayland: Implement clipboard paste

This commit is contained in:
Emmanuel Gil Peyrot
2018-10-10 19:21:26 +02:00
committed by linkmauve
parent 3c4b9a7eef
commit 8b54e28c4e
3 changed files with 92 additions and 4 deletions
+11
View File
@@ -1196,6 +1196,14 @@ int _glfwPlatformInit(void)
wl_data_device_manager_get_data_device(_glfw.wl.dataDeviceManager,
_glfw.wl.seat);
wl_data_device_add_listener(_glfw.wl.dataDevice, &dataDeviceListener, NULL);
_glfw.wl.clipboardString = malloc(4096);
if (!_glfw.wl.clipboardString)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Unable to allocate clipboard memory");
return GLFW_FALSE;
}
_glfw.wl.clipboardSize = 4096;
}
return GLFW_TRUE;
@@ -1285,6 +1293,9 @@ void _glfwPlatformTerminate(void)
close(_glfw.wl.timerfd);
if (_glfw.wl.cursorTimerfd >= 0)
close(_glfw.wl.cursorTimerfd);
if (_glfw.wl.clipboardString)
free(_glfw.wl.clipboardString);
}
const char* _glfwPlatformGetVersionString(void)