summaryrefslogtreecommitdiffstats
path: root/client/red_client.cpp
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-10-01 20:01:47 +0200
committerHans de Goede <hdegoede@redhat.com>2010-10-01 20:01:47 +0200
commita2d645ffe3fa23e8c57950987c93c0fe8822238b (patch)
tree76621a76bdc10c4dd86c91300c98870859ada29a /client/red_client.cpp
parentc6e9c52a2a588fa11f516e96f3ba5fea3cd67274 (diff)
downloadspice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.tar.gz
spice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.tar.xz
spice-a2d645ffe3fa23e8c57950987c93c0fe8822238b.zip
Change VD_AGENT_CLIPBOARD_GRAB to an array of types
A clipboard owner can indicate that it can supply the data the clipboard owns in multiple formats, so make the data passed with a VD_AGENT_CLIPBOARD_GRAB message an array of types rather then a single type.
Diffstat (limited to 'client/red_client.cpp')
-rw-r--r--client/red_client.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/red_client.cpp b/client/red_client.cpp
index 562b8269..e3519006 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -83,9 +83,8 @@ uint32_t default_agent_caps[] = {
void ClipboardGrabEvent::response(AbstractProcessLoop& events_loop)
{
- VDAgentClipboardGrab grab = {_type};
static_cast<RedClient*>(events_loop.get_owner())->send_agent_clipboard_message(
- VD_AGENT_CLIPBOARD_GRAB, sizeof(grab), &grab);
+ VD_AGENT_CLIPBOARD_GRAB, _type_count * sizeof(uint32_t), _types);
}
void ClipboardRequestEvent::response(AbstractProcessLoop& events_loop)
@@ -834,13 +833,13 @@ void RedClient::send_agent_clipboard_message(uint32_t message_type, uint32_t siz
post_message(message);
}
-void RedClient::on_clipboard_grab(uint32_t type)
+void RedClient::on_clipboard_grab(uint32_t *types, uint32_t type_count)
{
if (!_agent_caps || !VD_AGENT_HAS_CAPABILITY(_agent_caps, _agent_caps_size,
VD_AGENT_CAP_CLIPBOARD_BY_DEMAND)) {
return;
}
- AutoRef<ClipboardGrabEvent> event(new ClipboardGrabEvent(type));
+ AutoRef<ClipboardGrabEvent> event(new ClipboardGrabEvent(types, type_count));
get_process_loop().push_event(*event);
}
@@ -1091,7 +1090,8 @@ void RedClient::dispatch_agent_message(VDAgentMessage* msg, void* data)
break;
}
case VD_AGENT_CLIPBOARD_GRAB:
- Platform::set_clipboard_owner(((VDAgentClipboardGrab*)data)->type);
+ Platform::set_clipboard_owner((uint32_t *)data,
+ msg->size / sizeof(uint32_t));
break;
case VD_AGENT_CLIPBOARD_REQUEST:
if (!Platform::request_clipboard_notification(((VDAgentClipboardRequest*)data)->type)) {