Skip to content

Commit

Permalink
Restore pumpRunLoopEventSendAndSignal: for Squeak
Browse files Browse the repository at this point in the history
@guillep introduced some additional logic to filter out events that do not correspond to the VM window. The about panel and the fullscreen frame are also alien windows, but were not receiving any events because of this change. As a consequence, these events will forever remain in the queue and therefore, the buttons of the fullscreen frame and about panel cannot be clicked.
This commit reverts all changes back to the previous version that consumes all events and forwards them to NSApp.
In order to avoid breaking PharoVM, we do all of this behind an `#ifdef PharoVM`.

Relevant changes:
#295
#300
  • Loading branch information
fniephaus committed Mar 2, 2020
1 parent c25b871 commit 6a0bc96
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions platforms/iOS/vm/OSX/sqSqueakOSXApplication+events.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ @implementation sqSqueakOSXApplication (events)
// This gives other windows the opportunity to consume their events
- (void) pumpRunLoopEventSendAndSignal:(BOOL)signal {

#ifdef PharoVM
@autoreleasepool {
NSEvent *event;
NSMutableArray *alienEventQueue = [[NSMutableArray alloc] init];
Expand All @@ -100,6 +101,21 @@ - (void) pumpRunLoopEventSendAndSignal:(BOOL)signal {
[alienEventQueue removeObject: event];
}
}
#else
NSEvent *event;

while ((event = [NSApp
nextEventMatchingMask:NSAnyEventMask
untilDate:nil
inMode:NSEventTrackingRunLoopMode
dequeue:YES])) {

[NSApp sendEvent: event];
if (signal) {
interpreterProxy->signalSemaphoreWithIndex(gDelegateApp.squeakApplication.inputSemaphoreIndex);
}
}
#endif
}

- (void) pumpRunLoop {
Expand Down

0 comments on commit 6a0bc96

Please sign in to comment.