<p>A bit of context: For Squeak, I am currently implementing full-fledged handling of DND events sent by the host system. Actually, Squeak only handles <code>SQDragDrop</code> at the moment.</p>
<p>However, when logging all received DND events on the image side, I discovered that whenever a file is dropped into the VM, after the last <code>SQDragMove</code> an <code>SQDragLeave</code> is received before the eventual <code>SQDragDrop</code>. This looks very suspicious to me. Neither does the same happen on any other platform (tested on Win32, too), nor does it appear logical to me in any way. If I release the mouse button <em>over</em> the image, the drag did not leave, so a "drag leave" should not be recorded.</p>
<p>This MR makes sure that in <code>dndInDrop()</code>, an <code>SQDragLeave</code> event is only recorded if the drop was not successful. (Please note that the <code>SQDragDrop</code> event itself will be sent in a deferred manner; <code>dndInDrop()</code> itself only calls <code>XConvertSelection()</code> from the X-Server which then will send a <code>SelectionNotify</code> which will trigger <code>dndGetSelection()</code> and eventually have <code>generateSqueakDropEventIfDroppedFiles()</code> called.)</p>
<p>Please review carefully, as I am a bloody VM newbie and this is my very first commit to this repo! :-) Mentioning <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/eliotmiranda/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eliotmiranda">@eliotmiranda</a> who appears to be the code owner of this plugin, according to the file's history.</p>
<p>Todos:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Think about backward compatibility: Squeak did not respect any of the drag events but <code>SQDragDrop</code> until today, and I'm reworking that handling ATM, so there will be no problem. But are there other users of this plugin that could rely on the old behavior which I consider a bug? Or does the <code>sq</code> in the prefix unambiguously stand for <code>Squeak</code>?</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Are there any tests I could run to make sure that this change cannot break anything else?</li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Fix a typo</li>
  <li>Comment out suspicious line</li>
  <li>Merge branch 'Cog' into sqUnixXdnd</li>
  <li>Refactor changes</li>
  <li>Don't skip SQDragLeave if XGetSelectionOwner failed</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508/files#diff-62a759e1d06520211b9aef8b4a55433a">platforms/unix/vm-display-X11/sqUnixXdnd.c</a>
    (11)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.patch'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.patch</a></li>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.diff'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW2C4FOEUNJQR7UOS33RWJ6IFANCNFSM4N4SXVFQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEW5KCHV62DI6D5E7CMTRWJ6IFA5CNFSM4N4SXVF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JQGPMEA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/508",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>