/// Spawns a server that proxies wayland protocol messages between wayland clients (components run
/// in starnix) and the wayland_bridge (which translates wayland to Scenic).
Spawns a server that proxies wayland protocol messages between wayland clients (components run
in starnix) and the wayland_bridge (which translates wayland to Scenic).
Spawns a server that proxies wayland protocol messages between wayland clients ( components run in starnix ) and the wayland_bridge ( which translates wayland to Scenic ) .
pub fn serve_wayland(
    task: &Task,
    display_path: FsString,
    device_path: FsString,
) -> Result<(), Errno> {
    let display_socket = create_display_socket(task, display_path)?;
    create_device_file(task, device_path)?;
    let kernel = task.thread_group.kernel.clone();
    let outgoing_dir_channel = kernel.outgoing_dir.lock().take().ok_or(errno!(EINVAL))?;
    let kernel = Arc::downgrade(&kernel);
    let (wayland_server_channel, wayland_bridge) =
        zx::Channel::create().map_err(|_| errno!(EINVAL))?;
    // Spawn a thread that waits for the view provider from the `ViewProducer`, and then uses
    // that view provider to serve view provider requests on behalf of the component that is
    // running.
    let _view_producer_thread = std::thread::spawn(move || -> Result<(), Error> {
        let executor = fasync::LocalExecutor::new()?;
        let wayland_dispatcher = connect_to_protocol::<fvirt::WaylandDispatcherMarker>()?;
        let view_producer = connect_to_protocol::<fwayland::ViewProducerMarker>()?;
        serve_view_protocols(
            kernel,
            executor,
            display_socket,
            outgoing_dir_channel,
            wayland_server_channel,
            wayland_bridge,
            view_producer,
            wayland_dispatcher,
        )
    });
    Ok(())
}
pub fn serve_wayland ( task : & Task , display_path : FsString , device_path : FsString , ) -> Result < ( ) , Errno > { let display_socket = create_display_socket ( task , display_path ) ? ; create_device_file ( task , device_path ) ? ; let kernel = task . thread_group . kernel . clone ( ) ; let outgoing_dir_channel = kernel . outgoing_dir . lock ( ) . take ( ) . ok_or ( errno ! ( EINVAL ) ) ? ; let kernel = Arc :: downgrade ( & kernel ) ; let ( wayland_server_channel , wayland_bridge ) = zx :: Channel :: create ( ) . map_err ( | _ | errno ! ( EINVAL ) ) ? ; // Spawn a thread that waits for the view provider from the `ViewProducer`, and then uses // that view provider to serve view provider requests on behalf of the component that is // running. let _view_producer_thread = std :: thread :: spawn ( move | | -> Result < ( ) , Error > { let executor = fasync :: LocalExecutor :: new ( ) ? ; let wayland_dispatcher = connect_to_protocol :: < fvirt :: WaylandDispatcherMarker > ( ) ? ; let view_producer = connect_to_protocol :: < fwayland :: ViewProducerMarker > ( ) ? ; serve_view_protocols ( kernel , executor , display_socket , outgoing_dir_channel , wayland_server_channel , wayland_bridge , view_producer , wayland_dispatcher , ) } ) ; Ok ( ( ) ) }
Spawns a server that proxies wayland protocol messages between wayland clients (components run
in starnix) and the wayland_bridge (which translates wayland to Scenic).
Spawns a server that proxies wayland protocol messages between wayland clients ( components run in starnix ) and the wayland_bridge ( which translates wayland to Scenic ) .
task
&Task
display_path
FsString
device_path
FsString