summaryrefslogtreecommitdiff
path: root/hw/xwin/winclipboardwndproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xwin/winclipboardwndproc.c')
-rw-r--r--hw/xwin/winclipboardwndproc.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index e19f678a7..077b9f0bf 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -151,6 +151,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static HWND s_hwndNextViewer;
static Bool s_fCBCInitialized;
+#if CYGDEBUG
+ winDebugWin32Message("winClipboardWindowProc", hwnd, message, wParam,
+ lParam);
+#endif
+
/* Branch on message type */
switch (message) {
case WM_DESTROY:
@@ -325,6 +330,29 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
"Clipboard does not contain CF_TEXT nor "
"CF_UNICODETEXT.\n");
+ winDebug("winClipboardWindowProc: %d formats\n",
+ CountClipboardFormats());
+ {
+ unsigned int format = 0;
+
+ do {
+ format = EnumClipboardFormats(format);
+ if (GetLastError() != ERROR_SUCCESS) {
+ winDebug
+ ("winClipboardWindowProc: EnumClipboardFormats failed %x\n",
+ GetLastError());
+ }
+ if (format > 0xc000) {
+ char buff[256];
+
+ GetClipboardFormatName(format, buff, 256);
+ winDebug("winClipboardWindowProc: %d %s\n", format,
+ buff);
+ }
+ else if (format > 0)
+ winDebug("winClipboardWindowProc: %d\n", format);
+ } while (format != 0);
+ }
/*
* We need to make sure that the X Server has processed
* previous XSetSelectionOwner messages.
@@ -337,24 +365,24 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
iReturn = XGetSelectionOwner(pDisplay, XA_PRIMARY);
if (iReturn == g_iClipboardWindow) {
winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "PRIMARY selection is owned by us.\n");
+ "PRIMARY selection is owned by us, releasing\n");
XSetSelectionOwner(pDisplay, XA_PRIMARY, None, CurrentTime);
}
else if (BadWindow == iReturn || BadAtom == iReturn)
winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "XGetSelection failed for PRIMARY: %d\n",
+ "XGetSelectionOwner failed for PRIMARY: %d\n",
iReturn);
/* Release CLIPBOARD selection if owned */
iReturn = XGetSelectionOwner(pDisplay, atomClipboard);
if (iReturn == g_iClipboardWindow) {
winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "CLIPBOARD selection is owned by us.\n");
+ "CLIPBOARD selection is owned by us, releasing\n");
XSetSelectionOwner(pDisplay, atomClipboard, None, CurrentTime);
}
else if (BadWindow == iReturn || BadAtom == iReturn)
winErrorFVerb(1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - "
- "XGetSelection failed for CLIPBOARD: %d\n",
+ "XGetSelectionOwner failed for CLIPBOARD: %d\n",
iReturn);
winDebug("winClipboardWindowProc - WM_DRAWCLIPBOARD: Exit\n");
@@ -424,7 +452,11 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Window iWindow = g_iClipboardWindow;
Bool fConvertToUnicode;
- winDebug("winClipboardWindowProc - WM_RENDER*FORMAT - Hello.\n");
+ if (message == WM_RENDERALLFORMATS)
+ winDebug("winClipboardWindowProc - WM_RENDERALLFORMATS - Hello.\n");
+ else
+ winDebug("winClipboardWindowProc - WM_RENDERFORMAT %d - Hello.\n",
+ wParam);
/* Flag whether to convert to Unicode or not */
if (message == WM_RENDERALLFORMATS)