setWaylandSurfaceTarget method

Future<void> setWaylandSurfaceTarget(
  1. WaylandSurfaceReplacement replacement
)

Replaces the Wayland surface that the session presents to.

Use it to give the session a surface again after RenderSessionHandle.releaseTarget(), to move it to another surface, or to resize it. Once the replacement completes, the session no longer uses the old surface.

See mln_render_session_set_wayland_surface_target in the C API reference.

Errors:

  • Status.unsupported when, in a Vulkan build, the new surface needs a different color format than the old one. Attach a new session instead.
  • Status.nativeError when the library can't present to the new surface.

Implementation

Future<void> setWaylandSurfaceTarget(WaylandSurfaceReplacement replacement) =>
    _run(
      (arena, completion) =>
          raw.mln_render_session_set_wayland_surface_target(
            _handle.raw,
            _writeWaylandSurfaceReplacement(replacement, arena),
            completion,
            nativeDiagnostic,
          ),
    );