client/X11: teach RAIL to use clipboard redirection
authorilammy <a.lozovsky@gmail.com>
Thu, 18 Aug 2016 18:14:52 +0000 (21:14 +0300)
committerilammy <a.lozovsky@gmail.com>
Sun, 30 Apr 2017 23:10:55 +0000 (02:10 +0300)
commit82f3abac494d7a5c01ee60b76c4892a3379502a1
treebe8f2ad8f0f7ec36ceb15e93e3f2c535a287ddbd
parent38ca328739dd2c6fc8befcfdf8caf7eaa2557bca
client/X11: teach RAIL to use clipboard redirection

XSelection protocol does not define any global clipboard as there is on
Windows. Instead each window has its own property for clipboard content
(like CLIPBOARD or PRIMARY) and there is a global notion of clipboard
ownership.  Only one window can claim ownership of some clipboard type
at the moment.

FreeRDP uses CLIPBOARD for clipboard transfers (it's the one used by
applications when Ctrl+V is pressed). For regular desktop sessions the
session window itself is used for clipboard interactions via
xfc->drawable field. However, for remote app session there is no session
window. We cannot use the current remote app window as it may change or
be destroyed without closing the session. We also cannot use the root
window as it is already used for CF_RAW transfer protocol.

Therefore we create a simple dummy window to put into xfc->drawable for
this exact job: to act as a clipboard vessel on behalf of the entire
remote app session.

xf_create_window() usually creates the window as we immediately start in
RAIL mode when possible. xf_rail_enable_remoteapp_mode() is invoked only
when autologin failed or remote desktop had to show the session window
to the user for some reason.
client/X11/xf_client.c
client/X11/xf_event.c
client/X11/xf_rail.c
client/X11/xf_window.c
client/X11/xf_window.h