Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
59 magnus 1
Description: Make sure that -sendclipboard actually uses the clipboard
2
Author: OmegaPhil <OmegaPhil@startmail.com>
3
Bug-Debian: https://bugs.debian.org/841854
4
 
5
diff --git a/vnc_unixsrc/vncviewer/selection.c b/vnc_unixsrc/vncviewer/selection.c
6
index 48b0a98..beb6916 100644
7
--- a/vnc_unixsrc/vncviewer/selection.c
8
+++ b/vnc_unixsrc/vncviewer/selection.c
9
@@ -199,12 +199,18 @@ GetSelectionTimeCallback(Widget w, XtPointer clientData, Atom* selection,
10
                         Atom* type, XtPointer value, unsigned long* length,
11
                         int* format)
12
 {
13
+       Atom sendsel = XA_PRIMARY;
14
+
15
+       if (appData.sendClipboard && clipboard_atom != None) {
16
+               sendsel = clipboard_atom;
17
+       }
18
+
19
        if (value && *format == 32 && *length == 1) {
20
                Time t = *(CARD32 *)value;
21
 
22
                if (TIME_LATER(t, prevSelectionTime)) {
23
                        prevSelectionTime = t;
24
-                       XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, GetSelectionCallback, NULL, CurrentTime);
25
+                       XtGetSelectionValue(w, sendsel, XA_STRING, GetSelectionCallback, NULL, CurrentTime);
26
                }
27
        } else if (!getenv("VNCVIEWER_NO_CUTBUFFER")) {
28
                if (TIME_LATER(cutBufferTime, prevSelectionTime)) {