summaryrefslogtreecommitdiff
path: root/vdagent
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2013-03-18 13:21:14 +0200
committerArnon Gilboa <agilboa@redhat.com>2013-03-18 13:21:14 +0200
commite364fa7799933c2b31b5755b7f2e881a681c83ff (patch)
tree10323e8270596b289837df050335ba6ad0ac7c90 /vdagent
parent482a4980f4a162787baa46aaffe989796e2dfd1a (diff)
vdagent: log unsupported grabbed clipboard formats
rhbz #919451 debugging, useful anyway
Diffstat (limited to 'vdagent')
-rw-r--r--vdagent/vdagent.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index b5d65cd..e20c830 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -914,13 +914,16 @@ bool VDAgent::write_message(uint32_t type, uint32_t size = 0, void* data = NULL)
void VDAgent::on_clipboard_grab()
{
- uint32_t* types = new uint32_t[clipboard_formats_count * VD_CLIPBOARD_FORMAT_MAX_TYPES];
+ uint32_t types[clipboard_formats_count * VD_CLIPBOARD_FORMAT_MAX_TYPES];
int count = 0;
if (!VD_AGENT_HAS_CAPABILITY(_client_caps, _client_caps_size,
VD_AGENT_CAP_CLIPBOARD_BY_DEMAND)) {
return;
}
+ if (CountClipboardFormats() == 0) {
+ return;
+ }
for (unsigned int i = 0; i < clipboard_formats_count; i++) {
if (IsClipboardFormatAvailable(clipboard_formats[i].format)) {
for (uint32_t* ptype = clipboard_formats[i].types; *ptype; ptype++) {
@@ -932,9 +935,11 @@ void VDAgent::on_clipboard_grab()
write_message(VD_AGENT_CLIPBOARD_GRAB, count * sizeof(types[0]), types);
set_clipboard_owner(owner_guest);
} else {
- vd_printf("Unsupported clipboard format");
+ UINT format = 0;
+ while (format = EnumClipboardFormats(format)) {
+ vd_printf("Unsupported clipboard format %u", format);
+ }
}
- delete[] types;
}
// In delayed rendering, Windows requires us to SetClipboardData before we return from