Skip to content

Commit a9df082

Browse files
committed
Handle INCR clipboard
Warn user if vmside clipboard size is over 256KiB reverting to INCR
1 parent 4f40c65 commit a9df082

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

gui-agent/vmside.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
#include <linux/uinput.h>
6060
#include <time.h>
6161

62-
63-
6462
/* Time in milliseconds after which the clipboard data should be wiped */
6563
#define CLIPBOARD_WIPE_TIME 60000
6664

@@ -1061,11 +1059,18 @@ static void process_xevent_selection(Ghandles * g, XSelectionEvent * ev)
10611059
g->utf8_string_atom, g->qprop,
10621060
g->stub_win, ev->time);
10631061
else
1064-
send_clipboard_data(g->vchan, g->stub_win, (char *) data, len, g->protocol_version);
1065-
/* even if the clipboard owner does not support UTF8 and we requested
1066-
XA_STRING, it is fine - ascii is legal UTF8 */
1062+
if (type == XInternAtom(g->display, "INCR", False)) {
1063+
char INCR_WARNING[] =
1064+
"Qube clipboard size over 256KiB and X11 INCR protocol support is not implemented!\n";
1065+
send_clipboard_data(g->vchan, g->stub_win, (char *) &INCR_WARNING,
1066+
sizeof(INCR_WARNING), g->protocol_version);
1067+
} else {
1068+
send_clipboard_data(g->vchan, g->stub_win, (char *) data, len,
1069+
g->protocol_version);
1070+
/* even if the clipboard owner does not support UTF8 and we requested
1071+
XA_STRING, it is fine - ascii is legal UTF8 */
1072+
}
10671073
XFree(data);
1068-
10691074
}
10701075

10711076
static void process_xevent_selection_req(Ghandles * g,

0 commit comments

Comments
 (0)