<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">Folks,</span><br>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
I noticed that copying from the omnibar in Google Chrome in a linux guest (Ubuntu or Centos) didn’t allow pasting into the host, despite (a) pasting in the guest working fine, and (b) copying from elsewhere in the guest (including from the body of Google Chrome
 pages)  works fine and allows pasting in the host.</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
To cut a long-ish story short, the problem boils down to “Google Chrome grabs the clipboard twice when you copy from the omnibar”, which is fine from their end (if a little weird) but VBoxClient doesn’t handle this correctly (see attached xtrace output with
 inline comments) since it calls into `<span style="background:white">XtGetSelectionValue` twice before handling the first answer, and `XtGetSelectionValue` doesn’t appear to be re-entrant so it ends up reporting that there are no allowed formats for the clipboard
 when the second callback fires.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white">Back in VBox < 5.2, there was some code to prevent this re-entrancy, but it was `ifndef`’d out in 5.2 and has been deleted completely in the recent changes to the Shared Clipboard, but it seems that this defensive code is still
 needed.  I’ve attached a patch to re-add the logic, which I hereby release under the MIT license.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white">Thanks,</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="background:white">A</span></p>
</div>
</div>
</body>
</html>