From: Pierre Ossman Date: Mon, 4 Jan 2021 12:17:40 +0000 (+0100) Subject: Improve clipboard debug logging in viewer X-Git-Tag: v1.11.90~69^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=07935033b538e18ca428588c33dab67d70e79c5b;p=tigervnc.git Improve clipboard debug logging in viewer --- diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index b5466acb..d7203ea2 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -291,12 +291,8 @@ void Viewport::handleClipboardAnnounce(bool available) if (!acceptClipboard) return; - if (available) - vlog.debug("Got notification of new clipboard on server"); - else - vlog.debug("Clipboard is no longer available on server"); - if (!available) { + vlog.debug("Clipboard is no longer available on server"); pendingServerClipboard = false; return; } @@ -304,10 +300,12 @@ void Viewport::handleClipboardAnnounce(bool available) pendingClientClipboard = false; if (!hasFocus()) { + vlog.debug("Got notification of new clipboard on server whilst not focused, will request data later"); pendingServerClipboard = true; return; } + vlog.debug("Got notification of new clipboard on server, requesting data"); cc->requestClipboard(); } @@ -759,12 +757,14 @@ void Viewport::handleClipboardChange(int source, void *data) self->pendingServerClipboard = false; if (!self->hasFocus()) { + vlog.debug("Local clipboard changed whilst not focused, will notify server later"); self->pendingClientClipboard = true; // Clear any older client clipboard from the server self->cc->announceClipboard(false); return; } + vlog.debug("Local clipboard changed, notifying server"); try { self->cc->announceClipboard(true); } catch (rdr::Exception& e) { @@ -777,6 +777,7 @@ void Viewport::handleClipboardChange(int source, void *data) void Viewport::flushPendingClipboard() { if (pendingServerClipboard) { + vlog.debug("Focus regained after remote clipboard change, requesting data"); try { cc->requestClipboard(); } catch (rdr::Exception& e) { @@ -785,6 +786,7 @@ void Viewport::flushPendingClipboard() } } if (pendingClientClipboard) { + vlog.debug("Focus regained after local clipboard change, notifying server"); try { cc->announceClipboard(true); } catch (rdr::Exception& e) {