forked from pyrite-dev/milsko
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.
This commit is contained in:
parent
ea046f3a52
commit
306f791641
2 changed files with 1 additions and 12 deletions
|
|
@ -79,7 +79,7 @@
|
||||||
MwLL parent;
|
MwLL parent;
|
||||||
MilskoFakePointer *handle;
|
MilskoFakePointer *handle;
|
||||||
NSUInteger strHash;
|
NSUInteger strHash;
|
||||||
MwBool pendingTicker;
|
NSEvent *lastEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (MilskoCocoa *)newWithParent:(MwLL)parent
|
+ (MilskoCocoa *)newWithParent:(MwLL)parent
|
||||||
|
|
|
||||||
|
|
@ -236,23 +236,12 @@ static CGPoint pointFlip(CGPoint point) {
|
||||||
_forceRender = MwFALSE;
|
_forceRender = MwFALSE;
|
||||||
return 1;
|
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
|
self->lastEvent = [self->window nextEventMatchingMask:NSAnyEventMask
|
||||||
untilDate:[NSDate distantPast]
|
untilDate:[NSDate distantPast]
|
||||||
inMode:NSDefaultRunLoopMode
|
inMode:NSDefaultRunLoopMode
|
||||||
dequeue:YES];
|
dequeue:YES];
|
||||||
|
|
||||||
|
|
||||||
return self->lastEvent != NULL;
|
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 {
|
- (void)getNextEvent {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue