summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2014-07-15 13:17:09 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2014-07-21 12:20:47 +0200
commitb87fab52eb825429e5393ac4c2c073c918d8ed8f (patch)
tree430ef55985035905b0a1df119447529296a2b54d
parent1c25f882a32432a8ff2253c5a42ed4a7d6a7df1a (diff)
downloadvd_agent-b87fab52eb825429e5393ac4c2c073c918d8ed8f.tar.gz
vd_agent-b87fab52eb825429e5393ac4c2c073c918d8ed8f.tar.xz
vd_agent-b87fab52eb825429e5393ac4c2c073c918d8ed8f.zip
Reply to TIMESTAMP requests
Add TIMESTAMP handling, This is to please vncviewer. https://bugzilla.redhat.com/show_bug.cgi?id=1117764
-rw-r--r--src/vdagent-x11-priv.h1
-rw-r--r--src/vdagent-x11.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/vdagent-x11-priv.h b/src/vdagent-x11-priv.h
index c607850..4a5729b 100644
--- a/src/vdagent-x11-priv.h
+++ b/src/vdagent-x11-priv.h
@@ -83,6 +83,7 @@ struct vdagent_x11 {
Atom targets_atom;
Atom incr_atom;
Atom multiple_atom;
+ Atom timestamp_atom;
Window root_window[MAX_SCREENS];
Window selection_window;
struct udscs_connection *vdagentd;
diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c
index c5d54ac..752b337 100644
--- a/src/vdagent-x11.c
+++ b/src/vdagent-x11.c
@@ -218,6 +218,7 @@ struct vdagent_x11 *vdagent_x11_create(struct udscs_connection *vdagentd,
x11->targets_atom = XInternAtom(x11->display, "TARGETS", False);
x11->incr_atom = XInternAtom(x11->display, "INCR", False);
x11->multiple_atom = XInternAtom(x11->display, "MULTIPLE", False);
+ x11->timestamp_atom = XInternAtom(x11->display, "TIMESTAMP", False);
for(i = 0; i < clipboard_format_count; i++) {
x11->clipboard_formats[i].type = clipboard_format_templates[i].type;
for(j = 0; clipboard_format_templates[i].atom_names[j]; j++) {
@@ -1036,6 +1037,20 @@ static void vdagent_x11_handle_selection_request(struct vdagent_x11 *x11)
return;
}
+ if (event->xselectionrequest.target == x11->timestamp_atom) {
+ /* TODO: use more accurate selection time */
+ guint32 timestamp = event->xselectionrequest.time;
+
+ XChangeProperty(x11->display, event->xselectionrequest.requestor,
+ event->xselectionrequest.property,
+ event->xselectionrequest.target, 32, PropModeReplace,
+ (guint8*)&timestamp, 1);
+ vdagent_x11_send_selection_notify(x11,
+ event->xselectionrequest.property, NULL);
+ return;
+ }
+
+
if (event->xselectionrequest.target == x11->targets_atom) {
vdagent_x11_send_targets(x11, selection, event);
return;