[common] clipboard: enlarge transfer buffers

This commit is contained in:
Geoffrey McRae
2026-08-14 19:08:55 +10:00
parent 42cec4774b
commit 352c3c42b6
9 changed files with 46 additions and 28 deletions

View File

@@ -26,7 +26,7 @@
#include <stdint.h>
static constexpr uint32_t LG_CLIPBOARD_MAPPING_MAGIC = 0x4c474342U;
static constexpr uint32_t LG_CLIPBOARD_MAPPING_VERSION = 2U;
static constexpr uint32_t LG_CLIPBOARD_MAPPING_VERSION = 3U;
struct ClipboardRingSlot
{

View File

@@ -40,7 +40,7 @@ class CLGMPHost;
class CLGMPClipboardTransport final : public IClipboardSource
{
private:
static constexpr unsigned MEMORY_COUNT = 8;
static constexpr unsigned MEMORY_COUNT = KVMFR_CLIPBOARD_SLOT_COUNT;
static constexpr unsigned INTERNAL_TARGET_COUNT =
CLGMPClipboardFiles::MAX_ACQUISITIONS +
CLGMPClipboardFiles::MAX_REQUESTS + 3;

View File

@@ -457,7 +457,7 @@ namespace
std::vector<uint8_t> buffer;
try
{
buffer.resize(KVMFR_CLIPBOARD_DATA_BYTES);
buffer.resize(KVMFR_CLIPBOARD_REPRESENTATION_BYTES);
}
catch (const std::bad_alloc&)
{
@@ -1653,7 +1653,8 @@ void CClipboardManager::ProcessSendData(Work&& work)
return;
}
const size_t length = static_cast<size_t>((std::min<uint64_t>)(
KVMFR_CLIPBOARD_DATA_BYTES, total - work.record.offset));
KVMFR_CLIPBOARD_REPRESENTATION_BYTES,
total - work.record.offset));
std::vector<uint8_t> data;
if (length)
{