<p>While playing with SDL on OSX we have noticed that the main window in the VM is randomly eating events that belong to other windows. This happens because we are consuming events regardless the window they come from.</p>
<p>The corresponding code is in the method pumpRunLoopEventSendAndSignal: in<br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXApplication%2Bevents.m">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXApplication%2Bevents.m</a></p>
<p>I've playing around with making the VM consume only events that come from its own window or from no window (window=null). This seems to work correctly, and I've had run into no issues in the last couple of hours.</p>
<p>I've put a guard so my code is only valid for PHAROVM builds, but I'd gladly remove the guards if people think this is a good move for all the community.</p>

<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/295'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Do only handle events that correspond to the VM window</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295/files#diff-0">platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m</a>
    (18)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.patch'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.patch</a></li>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.diff'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.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/295">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW5WhjC5iL31MbHhaEUK4rEXxETSjks5unabxgaJpZM4XzJ6z">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyWyGSUyZLAwNkrU5oyqFS4zQivctqks5unabxgaJpZM4XzJ6z.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Do only handle events that correspond to the VM window (#295)"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Do only handle events that correspond to the VM window (#295)",
"sections": [
{
"text": "",
"activityTitle": "**Guille Polito**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@guillep",
"facts": [

]
},
{
"title": "Commit Summary",
"facts": [
{
"name": "d63dedc",
"value": "Do only handle events that correspond to the VM window"
}
]
},
{
"title": "File Changes",
"facts": [
{
"name": "Modified",
"value": "[platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m](https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295/files#diff-0) (18 changes)"
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 295,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"pullRequestId\": 295\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.patch"
}
],
"@type": "OpenUri",
"name": "View patch"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295.diff"
}
],
"@type": "OpenUri",
"name": "View diff"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 399285939\n}"
}
],
"themeColor": "26292E"
}
]</script>