accesskit_macos

Function add_focus_forwarder_to_window_class

Source
pub unsafe fn add_focus_forwarder_to_window_class(class_name: &str)
Expand description

Modifies the specified class, which must be a subclass of NSWindow, to include an accessibilityFocusedUIElement method that calls the corresponding method on the window’s content view. This is needed for windowing libraries such as SDL that place the keyboard focus directly on the window rather than the content view.

§Safety

This function is declared unsafe because the caller must ensure that the code for this crate is never unloaded from the application process, since it’s not possible to reverse this operation. It’s safest if this crate is statically linked into the application’s main executable. Also, this function assumes that the specified class is a subclass of NSWindow.