mac: apple doesn't give us a reliable way to check if events are pending but we have to do the nextEventMatching trick anyways because the alternating pending implementation breaks opengl.
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
ea046f3a52
commit
306f791641
2 changed files with 1 additions and 12 deletions
|
|
@ -79,7 +79,7 @@
|
|||
MwLL parent;
|
||||
MilskoFakePointer *handle;
|
||||
NSUInteger strHash;
|
||||
MwBool pendingTicker;
|
||||
NSEvent *lastEvent;
|
||||
}
|
||||
|
||||
+ (MilskoCocoa *)newWithParent:(MwLL)parent
|
||||
|
|
|
|||
|
|
@ -236,23 +236,12 @@ static CGPoint pointFlip(CGPoint point) {
|
|||
_forceRender = MwFALSE;
|
||||
return 1;
|
||||
}
|
||||
// Apple does not give you a reliable way to tell when events are coming. I
|
||||
// found this out by accident by stumbling upon a comment wxWidget's code,
|
||||
// thought I could figure out something better, and I ended up with the same
|
||||
// solution they tried and can confirm it doesn't work.
|
||||
// Thanks Tim Cook.
|
||||
#if 0
|
||||
self->lastEvent = [self->window nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:[NSDate distantPast]
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue:YES];
|
||||
|
||||
|
||||
return self->lastEvent != NULL;
|
||||
#endif
|
||||
// And unlike wxWidgets we can't just return 1, so instead we alternate
|
||||
// between such.
|
||||
return (self->pendingTicker = !self->pendingTicker);
|
||||
};
|
||||
|
||||
- (void)getNextEvent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue