Skip to content

Commit

Permalink
Merge pull request #295 from guillep/fix/osx/events
Browse files Browse the repository at this point in the history
Do only handle events that correspond to the VM window
  • Loading branch information
clementbera committed Oct 23, 2018
2 parents cdbc68e + d63dedc commit 671517e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,28 @@ @implementation sqSqueakOSXApplication (events)
- (void) pumpRunLoopEventSendAndSignal:(BOOL)signal {
NSEvent *event;

#ifdef PharoVM
while ((event = [gDelegateApp.window nextEventMatchingMask:NSEventMaskAny
untilDate:nil
inMode:NSEventTrackingRunLoopMode
dequeue:NO])) {
if (event.window == 0 || event.window == gDelegateApp.window) {
event = [gDelegateApp.window nextEventMatchingMask:NSEventMaskAny
untilDate:nil
inMode:NSEventTrackingRunLoopMode
dequeue:YES];
}
else{
// STOP THE LOOP
// We have an event that does not correspond to our window
break;
}
#else
while ((event = [NSApp nextEventMatchingMask:NSEventMaskAny
untilDate:nil
inMode:NSEventTrackingRunLoopMode
dequeue:YES])) {
#endif
[NSApp sendEvent: event];
if (signal) {
interpreterProxy->signalSemaphoreWithIndex(gDelegateApp.squeakApplication.inputSemaphoreIndex);
Expand Down

0 comments on commit 671517e

Please sign in to comment.