package wayland

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A frame ready for copy.

This object represents a single frame.

When created, a series of buffer events will be sent, each representing a supported buffer type. The "buffer_done" event is sent afterwards to indicate that all supported buffer types have been enumerated. The client will then be able to send a "copy" request. If the capture is successful, the compositor will send a "flags" followed by a "ready" event.

For objects version 2 or lower, wl_shm buffers are always supported, ie. the "buffer" event is guaranteed to be sent.

If the capture failed, the "failed" event is sent. This can happen anytime before the "ready" event.

Once either a "ready" or a "failed" event is received, the client should destroy the frame.

type 'v t = ([ `Zwlr_screencopy_frame_v1 ], 'v, [ `Client ]) Wayland.Proxy.t

Version 1

val destroy : [< `V1 | `V2 | `V3 ] t -> unit

Delete this object, used or not.

Destroys the frame. This request can be sent at any time by the client.

val copy : [< `V1 | `V2 | `V3 ] t -> buffer:([ `Wl_buffer ], 'a, [ `Client ]) Wayland.Proxy.t -> unit

Copy the frame.

Copy the frame to the supplied buffer. The buffer must have a the correct size, see zwlr_screencopy_frame_v1.buffer and zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a supported format.

If the frame is successfully copied, a "flags" and a "ready" events are sent. Otherwise, a "failed" event is sent.

Version 2

val copy_with_damage : [< `V2 | `V3 ] t -> buffer:([ `Wl_buffer ], 'a, [ `Client ]) Wayland.Proxy.t -> unit

Copy the frame when it's damaged.

Same as copy, except it waits until there is damage to copy.

Version 3

Handlers

Note: Servers will always want to use v1.

class virtual +'a v1 : object ... end

Handler for a proxy with version >= 1.

class virtual +'a v2 : object ... end

Handler for a proxy with version >= 2.

class virtual +'a v3 : object ... end

Handler for a proxy with version >= 3.