[Spice-devel] [PATCH] client: support clipboard/selection-owner model (v2)

Hans de Goede hdegoede at redhat.com
Thu Sep 30 05:19:29 PDT 2010


Hi,

On 09/30/2010 11:20 AM, Gerd Hoffmann wrote:
>   Hi,
>
>> not done yet:
>> -clipboards formats are still uint32_t, not mime types stores as strings
>
> What is the plan for multiple formats? When copying something in firefox it provides both UTF8_STRING and text/html (and a few others too).

When some app acquires clipboard ownership (so when ctrl-c is pressed
inside the app), then either the agent (if it is an app running inside the guest),
or the client (app on the client case) queries the apps which formats
it supports for the clipboard (by doing a XConvertSelection with a target
of TARGETS under X11), then those are translated into vdagent clipboard
types, currently we only have 1 utf8 type as format, but the plan is
to support others too.

For example the current linux agent code will recognize any of
the following atoms:
     "UTF8_STRING",
     "text/plain;charset=UTF-8",
     "text/plain;charset=utf-8",

As utf8 and send a clipboard grab to the client with a type of:
VD_AGENT_CLIPBOARD_UTF8_TEXT

The grab command is being changed so that it takes an array of types
rather then a single type, so in your firefox example, if we
were to add a VD_AGENT_CLIPBOARD_HTML type and recognize
the text/html atom, the agent would send a
VD_AGENT_CLIPBOARD_GRAB
with 8 bytes (2 uint32_t-s) of data containing:
VD_AGENT_CLIPBOARD_UTF8_TEXT
VD_AGENT_CLIPBOARD_HTML

Both sides should ignore types they don't know about, so
that we can freely extend the list without worrying about
compatibility.

Regards,

Hans


More information about the Spice-devel mailing list