FreeRDP/client
ilammy b9a297379b client/X11: improve named clipboard format support
Clipboard formats are identified by numerical IDs and literal names.
We can keep using arbitrary defined IDs for local clipboard formats
as we are sure that they have some fixed meaning, but the server can
and will be using its own IDs, which can be different from ours for
the named formats.

Therefore:

1) A correct way to compare a local format to a remote one is
   to check the names first, and only then compare their IDs.
   (Extra care should be taken to support short format names.)

2) Server IDs cannot be used with wClipboard directly when dealing
   with named formats. Format name should be used to extract correct
   local ID for the use with Clipboard{Set,Get}Data().

Also, I find the notion of 'alternate' format IDs to be confusing.
We either deal with a fixed ID format (declared in <winpr/user.h>),
or a format that was given an arbitrary fixed ID for local use
(defined in <freerdp/channels/cliprdr.h>), or a remote format
identified by a pair of an ID and a name. Format IDs can be local
and remote, but there are no 'alternates'.

So now:

1) A new function xf_cliprdr_formats_equal() is used to compare
   formats correctly in xf_cliprdr_get_server_format_by_atom()
   when searching for a server format corresponding to a local
   one, and in xf_cliprdr_server_format_list() when constructing
   a local TARGETS list from the server format list.

2) Correct local format IDs are used with wClipboard conversions
   by xf_cliprdr_process_requested_data() and
   xf_cliprdr_server_format_data_response().

3) We refer to formatId and formatName when doing requests,
   and srcFormatId and dstFormatId when doing conversions,
   instead of using formatId and altFormatId for both purposes.

4) Server format ID and name are used to identify cached clipboard
   contents. The name is compared directly as a pointer because it
   will be a pointer from the same clipboard->serverFormats array.

   Also, the clipboard contents are invalidated when format list
   arrives, so xf_cliprdr_server_format_list() now also clears
   the format ID and name together with the data.
2015-11-14 19:03:10 +02:00
..
Android Merge pull request #2917 from binglinoioij/master 2015-11-10 10:13:47 +01:00
common settings: update settings/help to match 2015-08-28 11:09:38 +02:00
DirectFB Fixes for malloc / calloc + other fixes 2015-06-22 19:21:47 +02:00
iOS client/ios: fix unchecked strdups 2015-06-22 19:09:59 +02:00
Mac Merge pull request #2825 from akallabeth/pointer_decoding_fix 2015-09-01 11:09:42 +02:00
Sample Fixes for malloc / calloc + other fixes 2015-06-22 19:21:47 +02:00
Wayland Fixed leaks, NULL dereferences and broken init. 2015-06-23 21:29:21 +02:00
Windows libfreerdp-core: fix code style 2015-09-15 10:37:57 -04:00
X11 client/X11: improve named clipboard format support 2015-11-14 19:03:10 +02:00
.gitignore Fixes for malloc / calloc + other fixes 2015-06-22 19:21:47 +02:00
CMakeLists.txt Disabled client builds if WITH_CLIENT is not set. 2015-11-03 17:32:52 +01:00