summaryrefslogtreecommitdiff
path: root/vdagent
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2010-10-05 16:02:52 +0200
committerArnon Gilboa <agilboa@redhat.com>2010-10-05 16:02:52 +0200
commit1d095da5d8b0c662d5f4b9b58b851d2066acef01 (patch)
treebebfc32f4135daca8af3de1fe7ae64e00a9bacec /vdagent
parent9115c0397326c961bd2681878a56f12aad2a03dc (diff)
vdagent: receiving a clipboard request with an unsupported type is replied by data with a none type
Currently we send a VD_AGENT_CLIPBOARD_RELEASE when we receive a VD_AGENT_CLIPBOARD_REQUEST with a type which we do not support. This is not correct, as this means given up clipboard ownership while we may be able to answer requests with different types. The correct response is to nack the request by sending a VD_AGENT_CLIPBOARD (data) message with a type of VD_AGENT_CLIPBOARD_NONE.(citing hansg)
Diffstat (limited to 'vdagent')
-rw-r--r--vdagent/vdagent.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index bf48e17..f3f571b 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -803,7 +803,7 @@ bool VDAgent::on_clipboard_grab()
//FIXME: use all available types rather than just the first one
uint32_t grab_types[] = {type};
- return write_message(VD_AGENT_CLIPBOARD_GRAB, sizeof(grab_types), &grab_types);
+ return write_message(VD_AGENT_CLIPBOARD_GRAB, sizeof(grab_types), &grab_types);
}
// In delayed rendering, Windows requires us to SetClipboardData before we return from
@@ -986,7 +986,8 @@ void VDAgent::dispatch_message(VDAgentMessage* msg, uint32_t port)
case VD_AGENT_CLIPBOARD_REQUEST:
res = a->handle_clipboard_request((VDAgentClipboardRequest*)msg->data);
if (!res) {
- res = a->write_message(VD_AGENT_CLIPBOARD_RELEASE);
+ VDAgentClipboard clipboard = {VD_AGENT_CLIPBOARD_NONE};
+ res = a->write_message(VD_AGENT_CLIPBOARD, sizeof(clipboard), &clipboard);
}
break;
case VD_AGENT_CLIPBOARD_RELEASE: