From 28640295f19ad5fc17c37bf4572299d5df9765ac Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 30 May 2021 11:37:15 +1000 Subject: [PATCH] [client] spice: update to support sending clipboard type list --- client/include/app.h | 3 ++- client/src/app.c | 22 +++++++++++++++++----- repos/PureSpice | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/client/include/app.h b/client/include/app.h index b99db81d..798fd491 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -78,7 +78,8 @@ void app_glSwapBuffers(void); #endif void app_clipboardRelease(void); -void app_clipboardNotify(const LG_ClipboardData type, size_t size); +void app_clipboardNotifyTypes(const LG_ClipboardData types[], int count); +void app_clipboardNotifySize(const LG_ClipboardData type, size_t size); void app_clipboardData(const LG_ClipboardData type, uint8_t * data, size_t size); void app_clipboardRequest(const LG_ClipboardReplyFn replyFn, void * opaque); diff --git a/client/src/app.c b/client/src/app.c index 031c488d..3c42fe0a 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -126,7 +126,22 @@ void app_clipboardRelease(void) spice_clipboard_release(); } -void app_clipboardNotify(const LG_ClipboardData type, size_t size) +void app_clipboardNotifyTypes(const LG_ClipboardData types[], int count) +{ + if (count == 0) + { + spice_clipboard_release(); + return; + } + + SpiceDataType conv[count]; + for(int i = 0; i < count; ++i) + conv[i] = cb_lgTypeToSpiceType(types[i]); + + spice_clipboard_grab(conv, count); +} + +void app_clipboardNotifySize(const LG_ClipboardData type, size_t size) { if (!g_params.clipboardToVM) return; @@ -141,10 +156,7 @@ void app_clipboardNotify(const LG_ClipboardData type, size_t size) g_state.cbChunked = size > 0; g_state.cbXfer = size; - spice_clipboard_grab(g_state.cbType); - - if (size) - spice_clipboard_data_start(g_state.cbType, size); + spice_clipboard_data_start(g_state.cbType, size); } void app_clipboardData(const LG_ClipboardData type, uint8_t * data, size_t size) diff --git a/repos/PureSpice b/repos/PureSpice index 64b58f36..bd712980 160000 --- a/repos/PureSpice +++ b/repos/PureSpice @@ -1 +1 @@ -Subproject commit 64b58f3631dcac5175e624da78589befc99d5d28 +Subproject commit bd712980f88d7d923c6d3641da5ce5385722c608