Class InternalClientLauncher

Class Documentation

class InternalClientLauncher

This class provides methods for launching internal clients.

See also

miral::ExternalClientLauncher - for launching clients as an external process

Public Functions

InternalClientLauncher()
~InternalClientLauncher()
void operator()(mir::Server &server)
void launch(std::function<void(struct ::wl_display *display)> const &wayland_fd, std::function<void(std::weak_ptr<mir::scene::Session> const session)> const &connect_notification) const

Launch an internal client in another thread.

The connect_notification call will be called when a connection to the server has been secured. This is called on a worker thread and must not block.

The wayland_fd callback will be called when the client has been initialized and is ready to start interacting with the server. Note that this callback happens on another thread. This callback must exit.

Parameters:
  • wayland_fd – called when the Wayland client is initialized

  • connect_notification – called when the session has connected

template<typename ClientObject>
inline void launch(ClientObject &client_object) const

Launch an internal client in another read.

The client_object instance must define:

  • operator()(struct wl_display*) - the method called when the client has been initialized and is ready to start interacting with the server. Note that this callback happens in another thread. This callback must exit.

  • operator()(std::weak_ptr<mir::scene::Session> const) - the method called when a connection to the server has been secured. This is called on a worker thread and must not block.

Parameters:

client_object – an object describing the client connection