Description
Hello,
This issue is a suggestion for the addition of a valuable function that is currently missing from the Swift API for CFRunLoop, which is _CFRunLoopSetWindowsMessageQueueMask
. This function plays a crucial role in integrating the Windows message loop and processing system events such as keystrokes and mouse input. This function exists in CoreFoundation but it is never called, and it is not accessible from the Swift API.
By exposing this function in the public API, developers would be able to customize the mask of messages that wake the MsgWaitForMultipleObjects
function. This would enable better control over event handling and processing in Swift applications running on Windows.
Without this function, creating a Windows application with Swift requires using a workaround that is not as efficient or easy to use as the built-in implementation of RunLoop, and it is more prone to various other problems. See also https://forums.swift.org/t/combining-windows-message-loop-with-swifts-run-loop/64054
Because of this, the addition of this function to the public API would be of significant assistance to developers working on Windows applications with Swift.
The function in question can be found in the CFRunLoop.c file: https://github.com/apple/swift-corelibs-foundation/blob/main/CoreFoundation/RunLoop.subproj/CFRunLoop.c#L1211