From e364fa7799933c2b31b5755b7f2e881a681c83ff Mon Sep 17 00:00:00 2001 From: Arnon Gilboa Date: Mon, 18 Mar 2013 13:21:14 +0200 Subject: vdagent: log unsupported grabbed clipboard formats rhbz #919451 debugging, useful anyway --- vdagent/vdagent.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vdagent') 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 -- cgit v1.2.3