As the title says, RedrawRequested occurs without a corresponding MainEventsCleared (and RedrawEventsCleared on macOS). Fundamentally, drawing inside kCFRunLoopBeforeWaiting is just plain incorrect.
Possible solutions:
- Emit those events inside
drawRect:
- Fiddle with the event loop such that the queued
RedrawRequested is drained quicker
- Tweak
NSView/UIView settings such that Window::request_redraw can just be [view/layer setNeedsToDrawRect:].
Some of the previous discussion:
And some references to myself:
As the title says,
RedrawRequestedoccurs without a correspondingMainEventsCleared(andRedrawEventsClearedon macOS). Fundamentally, drawing insidekCFRunLoopBeforeWaitingis just plain incorrect.Possible solutions:
drawRect:RedrawRequestedis drained quickerNSView/UIViewsettings such thatWindow::request_redrawcan just be[view/layer setNeedsToDrawRect:].Some of the previous discussion:
And some references to myself:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/Introduction/Introduction.html#//apple_ref/doc/uid/10000060i