Cocotron (AppKit) backend rework #937
Labels
Enhancement
A way Darling can be improved
Essential
An essential and well-defined task required for Darling to progress
This issue documents how Cocotron's integration to lower API layers should work.
Backends for X11 and Wayland
cocotron/AppKit/*.backend
must go. There's a nice reversed collection of CGS API declarations here.cocotron/CoreGraphics/*.backend
that implement the new CGS interfaces.Event Processing
CGEventCreateWithEventRecord()
) and later NSEvents (for AppKit apps).CGSGetEventPort()
)Another call stack:
Call stack of event reception by AppKit:
HIToolbox (Carbon) APIs return the event as an
EventRef
, which is converted to CGSEventRecord by AppKit using_GetEventPlatformEventRecord()
and then toNSEvent
usingNSEvent _initWithCGSEvent
.NSEvent most likely contains both
CGSEventRecord
andEventRef
:+[NSEvent eventWithCGEvent:]
callsCGEventRecordPointer()
andCreateEventWithCGEvent()
to pass the return values to-[NSEvent _initWithCGSEvent:eventRef:]
.Event Lifecycle
The lifecycle of a HID event seems to be:
CGSEventRecord
CGSGetEventPort()
CGEventCreateNextEvent()
, convert it into aCGEventRef
CGEventRef
into anEventRef
and stores it in an internal queueEventRef
, it then converts theEventRef
into aCGSEventRecord
CGSEventRecord
is converted to anNSEvent
and passed through further processingThe text was updated successfully, but these errors were encountered: