From 6be20f1c90aa0fdb8cd7d198a7a23eb590a29853 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 21 Oct 2014 17:26:18 +0100 Subject: clipboard debug: Dump clipboard formats when GetClipboardData() fails --- hw/xwin/winclipboard/xevents.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c index d196a7246..312955186 100644 --- a/hw/xwin/winclipboard/xevents.c +++ b/hw/xwin/winclipboard/xevents.c @@ -385,9 +385,29 @@ winClipboardFlushXEvents(HWND hwnd, hGlobal = GetClipboardData(CF_TEXT); } if (!hGlobal) { + unsigned int format = 0; + ErrorF("winClipboardFlushXEvents - SelectionRequest - " "GetClipboardData () failed: %08lx\n", GetLastError()); + do { + format = EnumClipboardFormats(format); + if (GetLastError() != ERROR_SUCCESS) { + winDebug + ("winClipboardFlushXEvents - SelectionRequest - EnumClipboardFormats failed %x\n", + GetLastError()); + } + if (format > 0xc000) { + char buff[256]; + + GetClipboardFormatName(format, buff, 256); + winDebug("winClipboardFlushXEvents - SelectionRequest - %d %s\n", format, + buff); + } + else if (format > 0) + winDebug("winClipboardFlushXEvents - SelectionRequest - %d\n", format); + } while (format != 0); + /* Abort */ fAbort = TRUE; goto winClipboardFlushXEvents_SelectionRequest_Done; -- cgit v1.2.3