}
- cc->writer()->clientCutText(pendingClientCutText, len);
+ void Viewport::clearPendingClipboard()
+ {
+ delete [] pendingServerCutText;
+ pendingServerCutText = NULL;
+ delete [] pendingClientCutText;
+ pendingClientCutText = NULL;
+ }
+
+
+ void Viewport::flushPendingClipboard()
+ {
+ if (pendingServerCutText) {
+ size_t len = strlen(pendingServerCutText);
+ if (setPrimary)
+ Fl::copy(pendingServerCutText, len, 0);
+ Fl::copy(pendingServerCutText, len, 1);
+ }
+ if (pendingClientCutText) {
+ size_t len = strlen(pendingClientCutText);
+ vlog.debug("Sending pending clipboard data (%d bytes)", (int)len);
++ cc->writer()->writeClientCutText(pendingClientCutText, len);
+ }
+
+ clearPendingClipboard();
+ }
+
+
void Viewport::handlePointerEvent(const rfb::Point& pos, int buttonMask)
{
if (!viewOnly) {