xserver-multidpi/hw/xwin/winclipboard
Jon TURNEY 851b504199 hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts
See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html

It looks like the change in a9aca218f5 had some
unforseen consequences.

If the X11 selection contents are not convertable to COMPOUND_TEXT, UTF8_STRING
or STRING format (for example, if it is an image), after those conversion
attempts have failed, we sit in winProcessXEventsTimeout() until the timeout
expires.

It also seems that maybe gnuplot doesn't respond correctly to this sequence of
conversion requests and doesn't reply to some of them, which also causes us to
sit in winProcessXEventsTimeout() until the timeout expires.

The Windows application which has requested the clipboard contents via
GetClipboardContents() is blocked until we return from WM_RENDERFORMAT, so
sitting waiting for this timeout to expire should be avoided.

So instead, explicitly request conversion to the TARGETS target, choose
the most preferred format, and request conversion to that.

Also: if there is no owned selection, there is nothing to paste, so don't bother
trying to convert it.

v2: Fix compilation with -Werror=declaration-after-statement

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-06 12:23:03 +00:00
..
debug.c hw/xwin: Add xwinclip test client 2014-09-13 14:18:38 +01:00
internal.h hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts 2014-11-06 12:23:03 +00:00
Makefile.am hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboard 2014-09-13 14:19:06 +01:00
textconv.c hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboard 2014-09-13 14:19:06 +01:00
thread.c hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts 2014-11-06 12:23:03 +00:00
winclipboard.h hw/xwin: Add fUseUnicode as parameter to winClipboardProc() 2014-09-13 14:18:30 +01:00
wndproc.c hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts 2014-11-06 12:23:03 +00:00
xevents.c hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attempts 2014-11-06 12:23:03 +00:00
xwinclip.c hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboard 2014-09-13 14:19:06 +01:00
xwinclip.man hw/xwin: Add a basic manpage for xwinclip 2014-09-13 14:19:01 +01:00