summaryrefslogtreecommitdiff
path: root/hw/xwin
diff options
context:
space:
mode:
authorRoland Cassard <roland.cassard@gmail.com>2010-10-23 18:12:36 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-01-26 14:38:52 +0000
commita9aca218f557c723e637287272819a7c17174e1e (patch)
tree1a9cff7a1134c76e6d3f139550dcea5b45d663d7 /hw/xwin
parent75fe336b6c903133ae386f5cb8d308a0e9e2768e (diff)
hw/xwin: Don't assume we'll always have converted the clipboard selection after 2 attempts
Rather than knowing we have to call winProcessXEventsTimeout() for up to 2 WIN_XEVENTS_CONVERT messages, process all messages in winProcessXEventsTimeout() until either: (i) the time out expired, (ii) an error occurred, or (iii) received a WIN_XEVENTS_NOTIFY messaage indicating the data has been to put on the clipboard. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin')
-rw-r--r--hw/xwin/winclipboardwndproc.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 03da7f41c..02347ff43 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -42,7 +42,6 @@
* Constants
*/
-#define WIN_CLIPBOARD_PROP "cyg_clipboard_prop"
#define WIN_POLL_TIMEOUT 1
@@ -124,10 +123,9 @@ winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
iWindow,
pDisplay,
fUseUnicode);
- if (WIN_XEVENTS_NOTIFY == iReturn
- || WIN_XEVENTS_CONVERT == iReturn)
+ if (WIN_XEVENTS_NOTIFY == iReturn)
{
- /* Bail out if convert or notify processed */
+ /* Bail out if notify processed */
return iReturn;
}
}
@@ -503,22 +501,9 @@ winClipboardWindowProc (HWND hwnd, UINT message,
pDisplay,
fConvertToUnicode,
WIN_POLL_TIMEOUT);
- if (WIN_XEVENTS_CONVERT == iReturn)
- {
- /*
- * The selection was offered for conversion first, so we have
- * to process a second SelectionNotify event to get the actual
- * data in the selection.
- */
- iReturn = winProcessXEventsTimeout (hwnd,
- iWindow,
- pDisplay,
- fConvertToUnicode,
- WIN_POLL_TIMEOUT);
- }
-
+
/*
- * The last of the up-to two calls to winProcessXEventsTimeout
+ * The last call to winProcessXEventsTimeout
* from above had better have seen a notify event, or else we
* are dealing with a buggy or old X11 app. In these cases we
* have to paste some fake data to the Win32 clipboard to