spice-protocol/spice
Marc-André Lureau 045a6978d6 vdagent: introduce VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
When this capability is negoticated by both the client & the agent,
the clipboard grab messages have an associated serial counter.

The serial is reset to 0 upon client connection.

The counter is increment by 1 on each grab message, by both sides.

The sender of the message with the highest serial should be the
clipboard grab owner, and the current session serial should be
updated.

If a lower serial than the current session serial is received, the
grab should be discarded.

Whenever two grabs share the same serial, the one coming from the
client should have a higher priority and the client should gain the
clipboard ownership.

No special treatement is done for the unlikely case of overflowing the
counter. It may temporarily inverse the priority, until both side have
overflown and/or synchronized.

Note: this mechanism isn't aiming at making "the most recent" (as in
time) side gaining the ownership. One side sending subsequent grab
messages earlier will likely take the ownership over a side sending a
single message simultaneously the other way. It only clears the
situation where both side believe that the other is the current
clipboard owner, by having a global ordering and priority in case of
serial conflict.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-06 09:24:31 +01:00
..
barrier.h Use gcc builtin rather than asm for memory barriers 2016-01-08 15:31:38 +01:00
controller_prot.h Fix typo in comment 2018-06-21 11:27:09 +01:00
end-packed.h qxl_dev: Align QXLRam to 4 bytes 2018-07-11 10:19:45 +01:00
enums.h protocol: Define an enumeration for Quality Indicator messages 2019-11-08 14:35:44 +00:00
foreign_menu_prot.h Fix typo in comment 2018-06-21 11:27:09 +01:00
ipc_ring.h Fix up SPICE_SPICE typo 2010-02-04 18:10:50 +01:00
macros.h macros: Remove unused SPICE_GNUC_XXX macros 2019-06-27 09:42:07 +01:00
Makefile.am vdi_dev: remove deprecated header 2020-03-02 18:23:16 +01:00
meson.build vdi_dev: remove deprecated header 2020-03-02 18:23:16 +01:00
protocol.h Add support for h265 video codec 2018-06-19 15:31:32 +01:00
qxl_dev.h qxl_dev: Add comment to QXLQUICData->data field 2019-08-22 13:30:26 +01:00
qxl_windows.h Add QXL_ESCAPE_MONITOR_CONFIG enum 2015-06-30 16:23:42 +02:00
start-packed.h start-packet: Correct misleading comment 2019-07-21 13:57:37 +01:00
stats.h stats: Avoid holes in SpiceStat structure 2019-01-17 17:10:58 +00:00
stream-device.h stream-device: Define Quality Indicator messages 2019-11-08 14:35:48 +00:00
types.h Add byteswapping macros 2010-05-19 16:02:40 +02:00
vd_agent.h vdagent: introduce VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL 2020-03-06 09:24:31 +01:00