<p>It seems that "peeking" from the event queue does not yield events in case of changing resolutions:</p>
<pre><code>NSApp nextEventMatchingMask:NSEventMaskAny
                             untilDate:nil
                             inMode:NSEventTrackingRunLoopMode
                             dequeue: ***NO***
</code></pre>
<p>And then it never enters the loop...</p>
<p>Of course, apple's doc says nothing about this: <a href="https://developer.apple.com/documentation/appkit/nsapplication/1428485-nexteventmatchingmask?language=objc" rel="nofollow">https://developer.apple.com/documentation/appkit/nsapplication/1428485-nexteventmatchingmask?language=objc</a><br>
So all this is speculation ^^.</p>
<p>This new version consumes all pending events in the NSApp, and it does not show any lockups when e.g., switching resolutions. If the event does not correspond to this window, we take it from the event queue anyways and re-post it afterwards, to give other windows the opportunity to consume their events.</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/300'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Consume all events in the event queue to avoid application lockups</li>
</ul>

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

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.patch'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.patch</a></li>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.diff'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.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/300">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW_0eTtJnWdqzXLHMGQX67TP5FDMuks5uqXKTgaJpZM4YDtNp">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW9rpUO2wFUjfGewIWT2-nG2K3bWvks5uqXKTgaJpZM4YDtNp.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":"Consume all events in the event queue to avoid application lockups (#300)"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300",
"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": "Consume all events in the event queue to avoid application lockups (#300)",
"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": "b6cb192",
"value": "Consume all events in the event queue to avoid application lockups"
}
]
},
{
"title": "File Changes",
"facts": [
{
"name": "Modified",
"value": "[platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m](https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300/files#diff-0) (50 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\": 300,\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\": 300\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.patch"
}
],
"@type": "OpenUri",
"name": "View patch"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/300.diff"
}
],
"@type": "OpenUri",
"name": "View diff"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 403624809\n}"
}
],
"themeColor": "26292E"
}
]</script>