diff options
author | Pierre Ossman <ossman@cendio.se> | 2021-07-20 16:38:04 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2021-07-20 16:38:04 +0200 |
commit | 95ad4d70925c65ac3c90a10df5a4bf00ad22d90d (patch) | |
tree | ed0f5bdfb98d5028c55ba071035a83576a30eb71 /common/rfb/VNCServerST.cxx | |
parent | 1a008c1380305648ab50f1d99e73439747e9d61d (diff) | |
download | tigervnc-95ad4d70925c65ac3c90a10df5a4bf00ad22d90d.tar.gz tigervnc-95ad4d70925c65ac3c90a10df5a4bf00ad22d90d.zip |
Keep ownership of second selection when first is lost
This fixes regression introduced by the extended clipboard extension.
Previously it was possible for the server to hold on to the CLIPBOARD
selection even if another application took ownership of PRIMARY. This is
important to handle the common use case of selecting something in order
to paste over it.
The new request based model doesn't readily support this as we assume
the client has lost its data once we push the new PRIMARY selection to
it. So to handle this we have the maintain a cache of the client's data,
and make sure to fill that cache before we do anything that might cause
the client to lose the data.
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r-- | common/rfb/VNCServerST.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index 39cdde1f..fcc93a4e 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -338,8 +338,10 @@ void VNCServerST::setScreenLayout(const ScreenSet& layout) void VNCServerST::requestClipboard() { - if (clipboardClient == NULL) + if (clipboardClient == NULL) { + slog.debug("Got request for client clipboard but no client currently owns the clipboard"); return; + } clipboardClient->requestClipboardOrClose(); } @@ -348,9 +350,6 @@ void VNCServerST::announceClipboard(bool available) { std::list<VNCSConnectionST*>::iterator ci, ci_next; - if (available) - clipboardClient = NULL; - clipboardRequestors.clear(); for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { |