summaryrefslogtreecommitdiff
path: root/hw/xwin/winclipboardxevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xwin/winclipboardxevents.c')
-rw-r--r--hw/xwin/winclipboardxevents.c67
1 files changed, 30 insertions, 37 deletions
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index ec40814db..fee50f63d 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -105,20 +105,17 @@ winClipboardFlushXEvents (HWND hwnd,
*/
case SelectionRequest:
-#if 0
{
char *pszAtomName = NULL;
-
- ErrorF ("SelectionRequest - target %d\n",
- event.xselectionrequest.target);
-
+ winDebug("SelectionRequest - target %d\n",
+ event.xselectionrequest.target);
+
pszAtomName = XGetAtomName (pDisplay,
event.xselectionrequest.target);
- ErrorF ("SelectionRequest - Target atom name %s\n", pszAtomName);
+ winDebug("SelectionRequest - Target atom name %s\n", pszAtomName);
XFree (pszAtomName);
pszAtomName = NULL;
}
-#endif
/* Abort if invalid target type */
if (event.xselectionrequest.target != XA_STRING
@@ -466,21 +463,17 @@ winClipboardFlushXEvents (HWND hwnd,
*/
case SelectionNotify:
-#if 0
- ErrorF ("winClipboardFlushXEvents - SelectionNotify\n");
+
+ winDebug ("winClipboardFlushXEvents - SelectionNotify\n");
{
char *pszAtomName;
-
pszAtomName = XGetAtomName (pDisplay,
event.xselection.selection);
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n",
- pszAtomName);
-
+ winDebug("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n",
+ pszAtomName);
XFree (pszAtomName);
}
-#endif
-
/*
* Request conversion of UTF8 and CompoundText targets.
@@ -489,18 +482,16 @@ winClipboardFlushXEvents (HWND hwnd,
{
if (event.xselection.target == XA_STRING)
{
-#if 0
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "XA_STRING\n");
-#endif
+ winDebug ("winClipboardFlushXEvents - SelectionNotify - "
+ "XA_STRING\n");
+
return WIN_XEVENTS_CONVERT;
}
else if (event.xselection.target == atomUTF8String)
{
-#if 0
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "Requesting conversion of UTF8 target.\n");
-#endif
+ winDebug("winClipboardFlushXEvents - SelectionNotify - "
+ "Requesting conversion of UTF8 target.\n");
+
iReturn = XConvertSelection (pDisplay,
event.xselection.selection,
XA_STRING,
@@ -523,10 +514,9 @@ winClipboardFlushXEvents (HWND hwnd,
#ifdef X_HAVE_UTF8_STRING
else if (event.xselection.target == atomCompoundText)
{
-#if 0
- ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
- "Requesting conversion of CompoundText target.\n");
-#endif
+ winDebug("winClipboardFlushXEvents - SelectionNotify - "
+ "Requesting conversion of CompoundText target.\n");
+
iReturn = XConvertSelection (pDisplay,
event.xselection.selection,
atomUTF8String,
@@ -577,10 +567,8 @@ winClipboardFlushXEvents (HWND hwnd,
break;
}
-#if 0
- ErrorF ("SelectionNotify - returned data %d left %d\n",
- xtpText.nitems, ulReturnBytesLeft);
-#endif
+ winDebug("SelectionNotify - returned data %d left %d\n",
+ xtpText.nitems, ulReturnBytesLeft);
/* Request the selection data */
iReturn = XGetWindowProperty (pDisplay,
@@ -603,19 +591,16 @@ winClipboardFlushXEvents (HWND hwnd,
break;
}
-#if 0
{
char *pszAtomName = NULL;
- ErrorF ("SelectionNotify - returned data %d left %d\n",
- xtpText.nitems, ulReturnBytesLeft);
-
+ winDebug("SelectionNotify - returned data %d left %d\n",
+ xtpText.nitems, ulReturnBytesLeft);
pszAtomName = XGetAtomName(pDisplay, xtpText.encoding);
- ErrorF ("Notify atom name %s\n", pszAtomName);
+ winDebug("Notify atom name %s\n", pszAtomName);
XFree (pszAtomName);
pszAtomName = NULL;
}
-#endif
if (fUseUnicode)
{
@@ -816,7 +801,15 @@ winClipboardFlushXEvents (HWND hwnd,
SetClipboardData (CF_TEXT, NULL);
return WIN_XEVENTS_NOTIFY;
+ case SelectionClear:
+ winDebug("SelectionClear - doing nothing\n");
+ break;
+
+ case PropertyNotify:
+ break;
+
default:
+ ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type);
break;
}
}