Skip to content

Commit

Permalink
Handle INCR clipboard
Browse files Browse the repository at this point in the history
Warn user if vmside clipboard size is over 256KiB reverting to INCR

fixes: QubesOS/qubes-issues#5220
  • Loading branch information
alimirjamali committed Oct 21, 2024
1 parent 4f40c65 commit 36040ec
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions gui-agent/vmside.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,11 +1061,18 @@ static void process_xevent_selection(Ghandles * g, XSelectionEvent * ev)
g->utf8_string_atom, g->qprop,
g->stub_win, ev->time);
else
send_clipboard_data(g->vchan, g->stub_win, (char *) data, len, g->protocol_version);
/* even if the clipboard owner does not support UTF8 and we requested
XA_STRING, it is fine - ascii is legal UTF8 */
if (type == XInternAtom(g->display, "INCR", False)) {
char INCR_WARNING[] =
"Qube clipboard size over 256KiB and X11 INCR protocol support is not implemented!\n";
send_clipboard_data(g->vchan, g->stub_win, (char *) &INCR_WARNING,
sizeof(INCR_WARNING), g->protocol_version);
} else {
send_clipboard_data(g->vchan, g->stub_win, (char *) data, len,
g->protocol_version);
/* even if the clipboard owner does not support UTF8 and we requested
XA_STRING, it is fine - ascii is legal UTF8 */
}
XFree(data);

}

static void process_xevent_selection_req(Ghandles * g,
Expand Down

0 comments on commit 36040ec

Please sign in to comment.