-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)H - help wantedSomeone please save usSomeone please save us
Description
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
RedrawRequestedis drained quicker - Tweak
NSView/UIViewsettings such thatWindow::request_redrawcan just be[view/layer setNeedsToDrawRect:].
Some of the previous discussion:
- NSGraphicsContext::currentContext not accessible from redraw handler on macOS #1605
- macos: Handle resizes synchronously #1911
- Modified repaint system on Mac OS to use the OS-mediated system instead of doing it entirely in winit to better support non-GPU-accelerated rendering #2189
- [MacOS] Fix deadlock on maximizing window from event callback #2636
- Fix panic when destroying window #2773
- Not receiving WindowEvent::RedrawRequested after using Window to create Surface with WGPU #3495
And some references to myself:
- https://developer.apple.com/documentation/appkit/nsview/1483695-wantslayer?language=objc
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/DrawingEnviron/DrawingEnviron.html
- https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaViewsGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002978
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/Introduction/Introduction.html#//apple_ref/doc/uid/10000060i
radiantly
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)H - help wantedSomeone please save usSomeone please save us