Convert clipboard integration code from libX11 to xcb
This drops support for COMPOUND_TEXT. Presumably some ancient
(pre-2000) clients exist which support that, but not UTF8_STRING, but we
don't have an example to test with. (Given the nature of the thing, the
users of those clients probably work in CJK languages)
Supporting COMPOUND_TEXT would also involve writing (or extracting from
Xlib) support for the ISO 2022 encoding.
v2:
Fix the length of text property set by a SelectionRequest
The length of the text property is not neccessarily the same as the
length of the clipboard text before it is d2u converted (specifically,
if that contains any '\r\n' sequences, it will be shorter as they are
now just '\n')
Always use CF_UNICODETEXT clipboard format. Windows will automatically
down-convert to CF_TEXT for clients which request that.
This is subtly different in one way: if CF_TEXT is requested, we now
post CF_UNICODETEXT and it is converted to CF_TEXT *in the locale of the
requesting process*. Previously, we would convert to CF_TEXT *in our
locale* and post that.
It looks like the code in the !X_HAVE_UTF8_STRING case didn't actually
work correctly, but fortunately that has never been true...
xwinclip: Add -noprimary option
Xwin: Add -primary and -noprimary options and tray-menu control
v2:
Use Bool type for fPrimarySelection
Add -noprimary to usage message
Fix indentation in hw/xwin/winwndproc.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Add fUseUnicode as parameter to winClipboardProc()
Access g_fUseUnicode global when calling it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Rename the libwinclipboard internal header from winclipboard.h to internal.h
Put libwinclipboard's public interface into winclipboard.h
This lets winclipboardinit.c partake of that public interface, and all X server
headers without clashes
winInitClipboard() prototype belongs in a server header
v2: Remove duplicate declaration of winClipboardWindowDestroy()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Return a shutdown flag from winClipboardProc(), and use it in
winClipboardThreadProc() to determine if we should stop.
Currently this is set if the clipboard messaging window received a WM_QUIT.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Move clipboard integration code down to a subdirectory and build as a
convenience library
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>