Documentation

struct wlr_addon

struct wlr_addon {
	const struct wlr_addon_interface *impl;
	const void *owner;
	struct wl_list link;
};

wlr_addon_find()

struct wlr_addon *wlr_addon_find(​struct wlr_addon_set *set, const void *owner, const struct wlr_addon_interface *impl);

wlr_addon_finish()

void wlr_addon_finish(​struct wlr_addon *addon);

wlr_addon_init()

void wlr_addon_init(​struct wlr_addon *addon, struct wlr_addon_set *set, const void *owner, const struct wlr_addon_interface *impl);

struct wlr_addon_interface

struct wlr_addon_interface {
	const char *name;
	void (*destroy)(​struct wlr_addon *addon);
};

struct wlr_addon_set

struct wlr_addon_set {
	struct wl_list addons;
};

wlr_addon_set_finish()

void wlr_addon_set_finish(​struct wlr_addon_set *set);

wlr_addon_set_init()

void wlr_addon_set_init(​struct wlr_addon_set *set);

struct wlr_allocator

struct wlr_allocator {
	const struct wlr_allocator_interface *impl;
	uint32_t buffer_caps;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_allocator_autocreate()

struct wlr_allocator *wlr_allocator_autocreate(​struct wlr_backend *backend, struct wlr_renderer *renderer);

Creates the adequate wlr_allocator given a backend and a renderer

wlr_allocator_create_buffer()

struct wlr_buffer *wlr_allocator_create_buffer(​struct wlr_allocator *alloc, int width, int height, const struct wlr_drm_format *format);

Allocate a new buffer.

When the caller is done with it, they must unreference it by calling wlr_buffer_drop.

The `format` passed in indicates the format to use and the list of acceptable modifiers. The order in which modifiers are listed is not significant.

When running with legacy drivers which don't support explicit modifiers, the allocator must recognize two modifiers: INVALID (for implicit tiling and/or compression) and LINEAR.

The allocator must return a buffer using one of the modifiers listed. In particular, allocators must not return a buffer with an implicit modifier unless the user has allowed it by passing INVALID in the modifier list.

wlr_allocator_destroy()

void wlr_allocator_destroy(​struct wlr_allocator *alloc);

Destroy the allocator.

wlr_allocator_init()

void wlr_allocator_init(​struct wlr_allocator *alloc, const struct wlr_allocator_interface *impl, uint32_t buffer_caps);

struct wlr_allocator_interface

struct wlr_allocator_interface {
	struct wlr_buffer *(*create_buffer)(​struct wlr_allocator *alloc, int width, int height, const struct wlr_drm_format *format);
	void (*destroy)(​struct wlr_allocator *alloc);
};

struct wlr_backend

struct wlr_backend;

wlr_backend_finish()

void wlr_backend_finish(​struct wlr_backend *backend);

Emit the destroy event and clean up common backend state.

struct wlr_backend_impl

struct wlr_backend_impl {
	bool (*start)(​struct wlr_backend *backend);
	void (*destroy)(​struct wlr_backend *backend);
	struct wlr_session *(*get_session)(​struct wlr_backend *backend);
	clockid_t (*get_presentation_clock)(​struct wlr_backend *backend);
	int (*get_drm_fd)(​struct wlr_backend *backend);
	uint32_t (*get_buffer_caps)(​struct wlr_backend *backend);
};

wlr_backend_init()

void wlr_backend_init(​struct wlr_backend *backend, const struct wlr_backend_impl *impl);

Initializes common state on a wlr_backend and sets the implementation to the provided wlr_backend_impl reference.

wlr_backend_is_drm()

bool wlr_backend_is_drm(​struct wlr_backend *backend);

wlr_backend_is_headless()

bool wlr_backend_is_headless(​struct wlr_backend *backend);

wlr_backend_is_libinput()

bool wlr_backend_is_libinput(​struct wlr_backend *backend);

wlr_backend_is_multi()

bool wlr_backend_is_multi(​struct wlr_backend *backend);

wlr_backend_is_wl()

bool wlr_backend_is_wl(​struct wlr_backend *backend);

True if the given backend is a wlr_wl_backend.

wlr_backend_is_x11()

bool wlr_backend_is_x11(​struct wlr_backend *backend);

True if the given backend is a wlr_x11_backend.

struct wlr_box

struct wlr_box {
	int x, y;
	int width, height;
};

A box representing a rectangle region in a 2D space.

The x and y coordinates are inclusive, and the width and height lengths are exclusive. In other words, the box starts from the coordinates (x, y), and goes up to but not including (x + width, y + height)

wlr_box_closest_point()

void wlr_box_closest_point(​const struct wlr_box *box, double x, double y, double *dest_x, double *dest_y);

Finds the closest point within the box bounds

Returns NAN if the box is empty

wlr_box_contains_point()

bool wlr_box_contains_point(​const struct wlr_box *box, double x, double y);

Verifies if a point is contained within the bounds of a given wlr_box.

For example: - A point at (100, 50) is not contained in the box (0, 0, 100, 50). - A point at (10, 10) is contained in the box (10, 0, 50, 50).

wlr_box_empty()

bool wlr_box_empty(​const struct wlr_box *box);

Checks whether a box is empty or not.

A wlr_box is considered empty if its width and/or height is zero or negative.

wlr_box_intersection()

bool wlr_box_intersection(​struct wlr_box *dest, const struct wlr_box *box_a, const struct wlr_box *box_b);

Gives the intersecting box between two wlr_box.

Returns an empty wlr_box if the provided wlr_box don't intersect.

wlr_box_transform()

void wlr_box_transform(​struct wlr_box *dest, const struct wlr_box *box, enum wl_output_transform transform, int width, int height);

Transforms a box inside a (0, 0, width, height) box.

struct wlr_buffer

struct wlr_buffer;

struct wlr_data_control_device_v1

struct wlr_data_control_device_v1 {
	struct wl_resource *resource;
	struct wlr_data_control_manager_v1 *manager;
	struct wl_list link;
	struct wlr_seat *seat;
	struct wl_resource *selection_offer_resource;
	struct wl_resource *primary_selection_offer_resource;
	struct wl_listener seat_destroy;
	struct wl_listener seat_set_selection;
	struct wl_listener seat_set_primary_selection;
};

wlr_data_control_device_v1_destroy()

void wlr_data_control_device_v1_destroy(​struct wlr_data_control_device_v1 *device);

struct wlr_data_control_manager_v1

struct wlr_data_control_manager_v1 {
	struct wl_global *global;
	struct wl_list devices;
	struct {
		struct wl_signal destroy;
		struct wl_signal new_device;
	} events;
	struct wl_listener display_destroy;
};

wlr_data_control_manager_v1_create()

struct wlr_data_control_manager_v1 *wlr_data_control_manager_v1_create(​struct wl_display *display);

struct wlr_data_device_manager

struct wlr_data_device_manager {
	struct wl_global *global;
	struct wl_list data_sources;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_data_device_manager_create()

struct wlr_data_device_manager *wlr_data_device_manager_create(​struct wl_display *display);

Create a wl data device manager global for this display.

struct wlr_data_offer

struct wlr_data_offer {
	struct wl_resource *resource;
	struct wlr_data_source *source;
	enum wlr_data_offer_type type;
	struct wl_list link;
	uint32_t actions;
	enum wl_data_device_manager_dnd_action preferred_action;
	bool in_ask;
	struct wl_listener source_destroy;
};

enum wlr_data_offer_type

enum wlr_data_offer_type {
	WLR_DATA_OFFER_SELECTION,
	WLR_DATA_OFFER_DRAG,
};

struct wlr_data_source

struct wlr_data_source {
	const struct wlr_data_source_impl *impl;
	struct wl_array mime_types;
	int32_t actions;
	bool accepted;
	enum wl_data_device_manager_dnd_action current_dnd_action;
	uint32_t compositor_action;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_data_source_accept()

void wlr_data_source_accept(​struct wlr_data_source *source, uint32_t serial, const char *mime_type);

Notifies the data source that a target accepts one of the offered MIME types. If a target doesn't accept any of the offered types, `mime_type` is NULL.

wlr_data_source_destroy()

void wlr_data_source_destroy(​struct wlr_data_source *source);

Notifies the data source it is no longer valid and should be destroyed. That destroys immediately the data source.

wlr_data_source_dnd_action()

void wlr_data_source_dnd_action(​struct wlr_data_source *source, enum wl_data_device_manager_dnd_action action);

Notifies the data source that a target accepts the drag with the specified action.

This shouldn't be called after `wlr_data_source_dnd_drop` unless the drag-and-drop operation ended in an "ask" action.

wlr_data_source_dnd_drop()

void wlr_data_source_dnd_drop(​struct wlr_data_source *source);

Notifies the data source that the drop operation was performed. This does not indicate acceptance.

The data source may still be used in the future and should not be destroyed here.

wlr_data_source_dnd_finish()

void wlr_data_source_dnd_finish(​struct wlr_data_source *source);

Notifies the data source that the drag-and-drop operation concluded. That potentially destroys immediately the data source.

struct wlr_data_source_impl

struct wlr_data_source_impl {
	void (*send)(​struct wlr_data_source *source, const char *mime_type, int32_t fd);
	void (*accept)(​struct wlr_data_source *source, uint32_t serial, const char *mime_type);
	void (*destroy)(​struct wlr_data_source *source);
	void (*dnd_drop)(​struct wlr_data_source *source);
	void (*dnd_finish)(​struct wlr_data_source *source);
	void (*dnd_action)(​struct wlr_data_source *source, enum wl_data_device_manager_dnd_action action);
};

A data source implementation. Only the `send` function is mandatory. Refer to the matching wl_data_source_* functions documentation to know what they do.

wlr_data_source_init()

void wlr_data_source_init(​struct wlr_data_source *source, const struct wlr_data_source_impl *impl);

Initializes the data source with the provided implementation.

wlr_data_source_send()

void wlr_data_source_send(​struct wlr_data_source *source, const char *mime_type, int32_t fd);

Sends the data as the specified MIME type over the passed file descriptor, then close it.

enum wlr_direction

enum wlr_direction {
	WLR_DIRECTION_UP,
	WLR_DIRECTION_DOWN,
	WLR_DIRECTION_LEFT,
	WLR_DIRECTION_RIGHT,
};

struct wlr_dmabuf_v1_buffer

struct wlr_dmabuf_v1_buffer {
	struct wlr_buffer base;
	struct wl_resource *resource;
	struct wlr_dmabuf_attributes attributes;
	struct wl_listener release;
};

wlr_dmabuf_v1_buffer_from_buffer_resource()

struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_buffer_resource(​struct wl_resource *buffer_resource);

Returns the wlr_dmabuf_buffer if the given resource was created via the linux-dmabuf buffer protocol

wlr_dmabuf_v1_resource_is_buffer()

bool wlr_dmabuf_v1_resource_is_buffer(​struct wl_resource *buffer_resource);

Returns true if the given resource was created via the linux-dmabuf buffer protocol, false otherwise

struct wlr_drag

struct wlr_drag {
	enum wlr_drag_grab_type grab_type;
	struct wlr_seat_keyboard_grab keyboard_grab;
	struct wlr_seat_pointer_grab pointer_grab;
	struct wlr_seat_touch_grab touch_grab;
	struct wlr_seat *seat;
	struct wlr_seat_client *seat_client;
	struct wlr_seat_client *focus_client;
	struct wlr_drag_icon *icon;
	struct wlr_surface *focus;
	struct wlr_data_source *source;
	bool started, dropped, cancelling;
	int32_t grab_touch_id, touch_id;
	struct {
		struct wl_signal focus;
		struct wl_signal motion;
		struct wl_signal drop;
		struct wl_signal destroy;
	} events;
	struct wl_listener source_destroy;
	struct wl_listener seat_client_destroy;
	struct wl_listener icon_destroy;
	void *data;
};

wlr_drag_create()

struct wlr_drag *wlr_drag_create(​struct wlr_seat_client *seat_client, struct wlr_data_source *source, struct wlr_surface *icon_surface);

Creates a new drag. To request to start the drag, call `wlr_seat_request_start_drag`.

struct wlr_drag_drop_event

struct wlr_drag_drop_event {
	struct wlr_drag *drag;
	uint32_t time;
};

enum wlr_drag_grab_type

enum wlr_drag_grab_type {
	WLR_DRAG_GRAB_KEYBOARD,
	WLR_DRAG_GRAB_KEYBOARD_POINTER,
	WLR_DRAG_GRAB_KEYBOARD_TOUCH,
};

struct wlr_drag_icon

struct wlr_drag_icon {
	struct wlr_drag *drag;
	struct wlr_surface *surface;
	bool mapped;
	struct {
		struct wl_signal map;
		struct wl_signal unmap;
		struct wl_signal destroy;
	} events;
	struct wl_listener surface_destroy;
	void *data;
};

struct wlr_drag_motion_event

struct wlr_drag_motion_event {
	struct wlr_drag *drag;
	uint32_t time;
	double sx, sy;
};

struct wlr_drm

struct wlr_drm {
	struct wl_global *global;
	struct wlr_renderer *renderer;
	char *node_name;
	struct {
		struct wl_signal destroy;
	} events;
	struct wl_listener display_destroy;
	struct wl_listener renderer_destroy;
};

A stub implementation of Mesa's wl_drm protocol.

It only implements the minimum necessary for modern clients to behave properly. In particular, flink handles are left unimplemented.

struct wlr_drm_backend

struct wlr_drm_backend;

wlr_drm_backend_create()

struct wlr_backend *wlr_drm_backend_create(​struct wl_display *display, struct wlr_session *session, struct wlr_device *dev, struct wlr_backend *parent);

Creates a DRM backend using the specified GPU file descriptor (typically from a device node in /dev/dri).

To slave this to another DRM backend, pass it as the parent (which _must_ be a DRM backend, other kinds of backends raise SIGABRT).

wlr_drm_backend_get_non_master_fd()

int wlr_drm_backend_get_non_master_fd(​struct wlr_backend *backend);

Tries to open non-master DRM FD. The compositor must not call `drmSetMaster` on the returned FD. Returns a valid opened DRM FD, or -1 on error.

struct wlr_drm_buffer

struct wlr_drm_buffer {
	struct wlr_buffer base;
	struct wl_resource *resource;
	struct wlr_dmabuf_attributes dmabuf;
	struct wl_listener release;
};

wlr_drm_buffer_from_resource()

struct wlr_drm_buffer *wlr_drm_buffer_from_resource(​struct wl_resource *resource);

wlr_drm_buffer_is_resource()

bool wlr_drm_buffer_is_resource(​struct wl_resource *resource);

wlr_drm_connector_add_mode()

struct wlr_output_mode *wlr_drm_connector_add_mode(​struct wlr_output *output, const drmModeModeInfo *mode);

wlr_drm_connector_get_id()

uint32_t wlr_drm_connector_get_id(​struct wlr_output *output);

Get the KMS connector object ID.

wlr_drm_connector_get_panel_orientation()

enum wl_output_transform wlr_drm_connector_get_panel_orientation(​struct wlr_output *output);

Get the connector's panel orientation.

On some devices the panel is mounted in the casing in such a way that the top side of the panel does not match with the top side of the device. This function returns the output transform which needs to be applied to compensate for this.

wlr_drm_create()

struct wlr_drm *wlr_drm_create(​struct wl_display *display, struct wlr_renderer *renderer);

wlr_drm_create_lease()

struct wlr_drm_lease *wlr_drm_create_lease(​struct wlr_output **outputs, size_t n_outputs, int *lease_fd);

Leases the given outputs to the caller. The outputs must be from the associated DRM backend.

Returns NULL on error.

struct wlr_drm_format

struct wlr_drm_format {
	uint32_t format;
	size_t len;
	size_t capacity;
	uint64_t modifiers[];
};

A single DRM format, with a set of modifiers attached.

struct wlr_drm_format_set

struct wlr_drm_format_set {
	size_t len;
	size_t capacity;
	struct wlr_drm_format **formats;
};

A set of DRM formats and modifiers.

This is used to describe the supported format + modifier combinations. For instance, backends will report the set they can display, and renderers will report the set they can render to. For a more general overview of formats and modifiers, see: https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/

For compatibility with legacy drivers which don't support explicit modifiers, the special modifier DRM_FORMAT_MOD_INVALID is used to indicate that implicit modifiers are supported. Legacy drivers can also support the DRM_FORMAT_MOD_LINEAR modifier, which forces the buffer to have a linear layout.

Users must not assume that implicit modifiers are supported unless INVALID is listed in the modifier list.

wlr_drm_format_set_add()

bool wlr_drm_format_set_add(​struct wlr_drm_format_set *set, uint32_t format, uint64_t modifier);

wlr_drm_format_set_finish()

void wlr_drm_format_set_finish(​struct wlr_drm_format_set *set);

Free all of the DRM formats in the set, making the set empty. Does not free the set itself.

wlr_drm_format_set_has()

bool wlr_drm_format_set_has(​const struct wlr_drm_format_set *set, uint32_t format, uint64_t modifier);

wlr_drm_format_set_intersect()

bool wlr_drm_format_set_intersect(​struct wlr_drm_format_set *dst, const struct wlr_drm_format_set *a, const struct wlr_drm_format_set *b);

Intersect two DRM format sets `a` and `b`, storing in the destination set `dst` the format + modifier pairs which are in both source sets.

Returns false on failure or when the intersection is empty.

struct wlr_drm_lease

struct wlr_drm_lease {
	int fd;
	uint32_t lessee_id;
	struct wlr_drm_backend *backend;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

struct wlr_drm_lease_connector_v1

struct wlr_drm_lease_connector_v1 {
	struct wl_list resources;
	struct wlr_output *output;
	struct wlr_drm_lease_device_v1 *device;
	struct wlr_drm_lease_v1 *active_lease;
	struct wl_listener destroy;
	struct wl_list link;
};

struct wlr_drm_lease_device_v1

struct wlr_drm_lease_device_v1 {
	struct wl_list resources;
	struct wl_global *global;
	struct wlr_drm_lease_v1_manager *manager;
	struct wlr_backend *backend;
	struct wl_list connectors;
	struct wl_list leases;
	struct wl_list requests;
	struct wl_list link;
	struct wl_listener backend_destroy;
	void *data;
};

struct wlr_drm_lease_request_v1

struct wlr_drm_lease_request_v1 {
	struct wl_resource *resource;
	struct wlr_drm_lease_device_v1 *device;
	struct wlr_drm_lease_connector_v1 **connectors;
	size_t n_connectors;
	struct wlr_drm_lease_v1 *lease;
	bool invalid;
	struct wl_list link;
};

wlr_drm_lease_request_v1_grant()

struct wlr_drm_lease_v1 *wlr_drm_lease_request_v1_grant(​struct wlr_drm_lease_request_v1 *request);

Grants a client's lease request. The lease device will then provision the DRM lease and transfer the file descriptor to the client. After calling this, each wlr_output leased is destroyed, and will be re-issued through wlr_backend.events.new_outputs when the lease is revoked.

This will return NULL without leasing any resources if the lease is invalid; this can happen for example if two clients request the same resources and an attempt to grant both leases is made.

wlr_drm_lease_request_v1_reject()

void wlr_drm_lease_request_v1_reject(​struct wlr_drm_lease_request_v1 *request);

Rejects a client's lease request. The output will still be available to lease until withdrawn by the compositor.

wlr_drm_lease_terminate()

void wlr_drm_lease_terminate(​struct wlr_drm_lease *lease);

Terminates and destroys a given lease.

The outputs will be owned again by the backend.

struct wlr_drm_lease_v1

struct wlr_drm_lease_v1 {
	struct wl_resource *resource;
	struct wlr_drm_lease *drm_lease;
	struct wlr_drm_lease_device_v1 *device;
	struct wlr_drm_lease_connector_v1 **connectors;
	size_t n_connectors;
	struct wl_list link;
	struct wl_listener destroy;
	void *data;
};

struct wlr_drm_lease_v1_manager

struct wlr_drm_lease_v1_manager {
	struct wl_list devices;
	struct wl_display *display;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal request;
	} events;
};

wlr_drm_lease_v1_manager_create()

struct wlr_drm_lease_v1_manager *wlr_drm_lease_v1_manager_create(​struct wl_display *display, struct wlr_backend *backend);

Creates a DRM lease manager. A DRM lease device will be created for each DRM backend supplied in case of a wlr_multi_backend. Returns NULL if no DRM backend is supplied.

wlr_drm_lease_v1_manager_offer_output()

bool wlr_drm_lease_v1_manager_offer_output(​struct wlr_drm_lease_v1_manager *manager, struct wlr_output *output);

Offers a wlr_output for lease. Returns false if the output can't be offered to lease.

wlr_drm_lease_v1_manager_withdraw_output()

void wlr_drm_lease_v1_manager_withdraw_output(​struct wlr_drm_lease_v1_manager *manager, struct wlr_output *output);

Withdraws a previously offered output for lease. If the output is leased to a client, a finished event will be send and the lease will be terminated.

wlr_drm_lease_v1_revoke()

void wlr_drm_lease_v1_revoke(​struct wlr_drm_lease_v1 *lease);

Revokes a client's lease request. The output will still be available to lease until withdrawn by the compositor.

struct wlr_egl

struct wlr_egl {
	EGLDisplay display;
	EGLContext context;
	EGLDeviceEXT device;
	struct gbm_device *gbm_device;
	struct {
		bool KHR_image_base;
		bool EXT_image_dma_buf_import;
		bool EXT_image_dma_buf_import_modifiers;
		bool IMG_context_priority;
		bool EXT_device_drm;
		bool EXT_device_drm_render_node;
		bool EXT_device_query;
		bool KHR_platform_gbm;
		bool EXT_platform_device;
	} exts;
	struct {
		PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
		PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
		PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
		PFNEGLQUERYWAYLANDBUFFERWLPROC eglQueryWaylandBufferWL;
		PFNEGLQUERYDMABUFFORMATSEXTPROC eglQueryDmaBufFormatsEXT;
		PFNEGLQUERYDMABUFMODIFIERSEXTPROC eglQueryDmaBufModifiersEXT;
		PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR;
		PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT;
		PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
		PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT;
	} procs;
	bool has_modifiers;
	struct wlr_drm_format_set dmabuf_texture_formats;
	struct wlr_drm_format_set dmabuf_render_formats;
};

wlr_egl_create_with_context()

struct wlr_egl *wlr_egl_create_with_context(​EGLDisplay display, EGLContext context);

wlr_egl_is_current()

bool wlr_egl_is_current(​struct wlr_egl *egl);

wlr_egl_make_current()

bool wlr_egl_make_current(​struct wlr_egl *egl);

Make the EGL context current.

Callers are expected to clear the current context when they are done by calling wlr_egl_unset_current.

wlr_egl_unset_current()

bool wlr_egl_unset_current(​struct wlr_egl *egl);

struct wlr_export_dmabuf_frame_v1

struct wlr_export_dmabuf_frame_v1 {
	struct wl_resource *resource;
	struct wlr_export_dmabuf_manager_v1 *manager;
	struct wl_list link;
	struct wlr_output *output;
	bool cursor_locked;
	struct wl_listener output_commit;
};

struct wlr_export_dmabuf_manager_v1

struct wlr_export_dmabuf_manager_v1 {
	struct wl_global *global;
	struct wl_list frames;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_export_dmabuf_manager_v1_create()

struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create(​struct wl_display *display);

struct wlr_fbox

struct wlr_fbox {
	double x, y;
	double width, height;
};

A floating-point box representing a rectangle region in a 2D space.

wlr_fbox has the same semantics as wlr_box

wlr_fbox_empty()

bool wlr_fbox_empty(​const struct wlr_fbox *box);

Checks whether a box is empty or not.

A wlr_box is considered empty if its width and/or height is zero or negative.

wlr_fbox_transform()

void wlr_fbox_transform(​struct wlr_fbox *dest, const struct wlr_fbox *box, enum wl_output_transform transform, double width, double height);

Transforms a floating-point box inside a (0, 0, width, height) box.

struct wlr_foreign_toplevel_handle_v1

struct wlr_foreign_toplevel_handle_v1 {
	struct wlr_foreign_toplevel_manager_v1 *manager;
	struct wl_list resources;
	struct wl_list link;
	struct wl_event_source *idle_source;
	char *title;
	char *app_id;
	struct wlr_foreign_toplevel_handle_v1 *parent;
	struct wl_list outputs;
	uint32_t state;
	struct {
		struct wl_signal request_maximize;
		struct wl_signal request_minimize;
		struct wl_signal request_activate;
		struct wl_signal request_fullscreen;
		struct wl_signal request_close;
		struct wl_signal set_rectangle;
		struct wl_signal destroy;
	} events;
	void *data;
};

struct wlr_foreign_toplevel_handle_v1_activated_event

struct wlr_foreign_toplevel_handle_v1_activated_event {
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
	struct wlr_seat *seat;
};

wlr_foreign_toplevel_handle_v1_create()

struct wlr_foreign_toplevel_handle_v1 *wlr_foreign_toplevel_handle_v1_create(​struct wlr_foreign_toplevel_manager_v1 *manager);

wlr_foreign_toplevel_handle_v1_destroy()

void wlr_foreign_toplevel_handle_v1_destroy(​struct wlr_foreign_toplevel_handle_v1 *toplevel);

Destroy the given toplevel handle, sending the closed event to any client. Also, if the destroyed toplevel is set as a parent of any other valid toplevel, clients still holding a handle to both are sent a parent signal with NULL parent. If this is not desired, the caller should ensure that any child toplevels are destroyed before the parent.

struct wlr_foreign_toplevel_handle_v1_fullscreen_event

struct wlr_foreign_toplevel_handle_v1_fullscreen_event {
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
	bool fullscreen;
	struct wlr_output *output;
};

struct wlr_foreign_toplevel_handle_v1_maximized_event

struct wlr_foreign_toplevel_handle_v1_maximized_event {
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
	bool maximized;
};

struct wlr_foreign_toplevel_handle_v1_minimized_event

struct wlr_foreign_toplevel_handle_v1_minimized_event {
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
	bool minimized;
};

struct wlr_foreign_toplevel_handle_v1_output

struct wlr_foreign_toplevel_handle_v1_output {
	struct wl_list link;
	struct wl_listener output_destroy;
	struct wlr_output *output;
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
};

wlr_foreign_toplevel_handle_v1_output_enter()

void wlr_foreign_toplevel_handle_v1_output_enter(​struct wlr_foreign_toplevel_handle_v1 *toplevel, struct wlr_output *output);

wlr_foreign_toplevel_handle_v1_output_leave()

void wlr_foreign_toplevel_handle_v1_output_leave(​struct wlr_foreign_toplevel_handle_v1 *toplevel, struct wlr_output *output);

wlr_foreign_toplevel_handle_v1_set_activated()

void wlr_foreign_toplevel_handle_v1_set_activated(​struct wlr_foreign_toplevel_handle_v1 *toplevel, bool activated);

wlr_foreign_toplevel_handle_v1_set_app_id()

void wlr_foreign_toplevel_handle_v1_set_app_id(​struct wlr_foreign_toplevel_handle_v1 *toplevel, const char *app_id);

wlr_foreign_toplevel_handle_v1_set_fullscreen()

void wlr_foreign_toplevel_handle_v1_set_fullscreen(​struct wlr_foreign_toplevel_handle_v1 *toplevel, bool fullscreen);

wlr_foreign_toplevel_handle_v1_set_maximized()

void wlr_foreign_toplevel_handle_v1_set_maximized(​struct wlr_foreign_toplevel_handle_v1 *toplevel, bool maximized);

wlr_foreign_toplevel_handle_v1_set_minimized()

void wlr_foreign_toplevel_handle_v1_set_minimized(​struct wlr_foreign_toplevel_handle_v1 *toplevel, bool minimized);

wlr_foreign_toplevel_handle_v1_set_parent()

void wlr_foreign_toplevel_handle_v1_set_parent(​struct wlr_foreign_toplevel_handle_v1 *toplevel, struct wlr_foreign_toplevel_handle_v1 *parent);

Set the parent of a toplevel. If the parent changed from its previous value, also sends a parent event to all clients that hold handles to both toplevel and parent (no message is sent to clients that have previously destroyed their parent handle). NULL is allowed as the parent, meaning no parent exists.

struct wlr_foreign_toplevel_handle_v1_set_rectangle_event

struct wlr_foreign_toplevel_handle_v1_set_rectangle_event {
	struct wlr_foreign_toplevel_handle_v1 *toplevel;
	struct wlr_surface *surface;
	int32_t x, y, width, height;
};

wlr_foreign_toplevel_handle_v1_set_title()

void wlr_foreign_toplevel_handle_v1_set_title(​struct wlr_foreign_toplevel_handle_v1 *toplevel, const char *title);

enum wlr_foreign_toplevel_handle_v1_state

enum wlr_foreign_toplevel_handle_v1_state {
	WLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED,
	WLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MINIMIZED,
	WLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED,
	WLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN,
};

struct wlr_foreign_toplevel_manager_v1

struct wlr_foreign_toplevel_manager_v1 {
	struct wl_event_loop *event_loop;
	struct wl_global *global;
	struct wl_list resources;
	struct wl_list toplevels;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_foreign_toplevel_manager_v1_create()

struct wlr_foreign_toplevel_manager_v1 *wlr_foreign_toplevel_manager_v1_create(​struct wl_display *display);

struct wlr_fullscreen_shell_v1

struct wlr_fullscreen_shell_v1 {
	struct wl_global *global;
	struct {
		struct wl_signal destroy;
		struct wl_signal present_surface;
	} events;
	struct wl_listener display_destroy;
	void *data;
};

wlr_fullscreen_shell_v1_create()

struct wlr_fullscreen_shell_v1 *wlr_fullscreen_shell_v1_create(​struct wl_display *display);

struct wlr_fullscreen_shell_v1_present_surface_event

struct wlr_fullscreen_shell_v1_present_surface_event {
	struct wl_client *client;
	struct wlr_surface *surface;
	enum zwp_fullscreen_shell_v1_present_method method;
	struct wlr_output *output;
};

struct wlr_gamma_control_manager_v1

struct wlr_gamma_control_manager_v1 {
	struct wl_global *global;
	struct wl_list controls;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_gamma_control_manager_v1_create()

struct wlr_gamma_control_manager_v1 *wlr_gamma_control_manager_v1_create(​struct wl_display *display);

struct wlr_gamma_control_v1

struct wlr_gamma_control_v1 {
	struct wl_resource *resource;
	struct wlr_output *output;
	struct wl_list link;
	uint16_t *table;
	size_t ramp_size;
	struct wl_listener output_commit_listener;
	struct wl_listener output_destroy_listener;
	void *data;
};

wlr_gles2_renderer_check_ext()

bool wlr_gles2_renderer_check_ext(​struct wlr_renderer *renderer, const char *ext);

wlr_gles2_renderer_create()

struct wlr_renderer *wlr_gles2_renderer_create(​struct wlr_egl *egl);

wlr_gles2_renderer_create_with_drm_fd()

struct wlr_renderer *wlr_gles2_renderer_create_with_drm_fd(​int drm_fd);

wlr_gles2_renderer_get_current_fbo()

GLuint wlr_gles2_renderer_get_current_fbo(​struct wlr_renderer *wlr_renderer);

Returns the OpenGL FBO of current buffer.

wlr_gles2_renderer_get_egl()

struct wlr_egl *wlr_gles2_renderer_get_egl(​struct wlr_renderer *renderer);

struct wlr_gles2_texture_attribs

struct wlr_gles2_texture_attribs {
	GLenum target;
	GLuint tex;
	bool has_alpha;
};

wlr_gles2_texture_get_attribs()

void wlr_gles2_texture_get_attribs(​struct wlr_texture *texture, struct wlr_gles2_texture_attribs *attribs);

wlr_headless_add_input_device()

struct wlr_input_device *wlr_headless_add_input_device(​struct wlr_backend *backend, enum wlr_input_device_type type);

Creates a new input device. The caller is responsible for manually raising any event signals on the new input device if it wants to simulate input events.

wlr_headless_add_output()

struct wlr_output *wlr_headless_add_output(​struct wlr_backend *backend, unsigned int width, unsigned int height);

Create a new headless output backed by an in-memory EGL framebuffer. You can read pixels from this framebuffer via wlr_renderer_read_pixels but it is otherwise not displayed.

wlr_headless_backend_create()

struct wlr_backend *wlr_headless_backend_create(​struct wl_display *display);

Creates a headless backend. A headless backend has no outputs or inputs by default.

struct wlr_idle

struct wlr_idle {
	struct wl_global *global;
	struct wl_list idle_timers;
	struct wl_event_loop *event_loop;
	bool enabled;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal activity_notify;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_idle_create()

struct wlr_idle *wlr_idle_create(​struct wl_display *display);

struct wlr_idle_inhibit_manager_v1

struct wlr_idle_inhibit_manager_v1 {
	struct wl_list inhibitors;
	struct wl_global *global;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_inhibitor;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_idle_inhibit_v1_create()

struct wlr_idle_inhibit_manager_v1 *wlr_idle_inhibit_v1_create(​struct wl_display *display);

struct wlr_idle_inhibitor_v1

struct wlr_idle_inhibitor_v1 {
	struct wlr_surface *surface;
	struct wl_resource *resource;
	struct wl_listener surface_destroy;
	struct wl_list link;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_idle_notify_activity()

void wlr_idle_notify_activity(​struct wlr_idle *idle, struct wlr_seat *seat);

Send notification to restart all timers for the given seat. Called by compositor when there is an user activity event on that seat.

wlr_idle_set_enabled()

void wlr_idle_set_enabled(​struct wlr_idle *idle, struct wlr_seat *seat, bool enabled);

Enable or disable timers for a given idle resource by seat. Passing a NULL seat means update timers for all seats.

struct wlr_idle_timeout

struct wlr_idle_timeout {
	struct wl_resource *resource;
	struct wl_list link;
	struct wlr_seat *seat;
	struct wl_event_source *idle_source;
	bool idle_state;
	bool enabled;
	uint32_t timeout;
	struct {
		struct wl_signal idle;
		struct wl_signal resume;
		struct wl_signal destroy;
	} events;
	struct wl_listener input_listener;
	struct wl_listener seat_destroy;
	void *data;
};

wlr_idle_timeout_create()

struct wlr_idle_timeout *wlr_idle_timeout_create(​struct wlr_idle *idle, struct wlr_seat *seat, uint32_t timeout);

Create a new timer on the given seat. The idle event will be called after the given amount of milliseconds of inactivity, and the resumed event will be sent at the first user activity after the fired event.

wlr_idle_timeout_destroy()

void wlr_idle_timeout_destroy(​struct wlr_idle_timeout *timeout);

wlr_input_device_destroy()

void wlr_input_device_destroy(​struct wlr_input_device *dev);

wlr_input_device_get_virtual_keyboard()

struct wlr_virtual_keyboard_v1 *wlr_input_device_get_virtual_keyboard(​struct wlr_input_device *wlr_dev);

struct wlr_input_device_impl

struct wlr_input_device_impl {
	void (*destroy)(​struct wlr_input_device *wlr_device);
};

wlr_input_device_init()

void wlr_input_device_init(​struct wlr_input_device *wlr_device, enum wlr_input_device_type type, const struct wlr_input_device_impl *impl, const char *name, int vendor, int product);

wlr_input_device_is_headless()

bool wlr_input_device_is_headless(​struct wlr_input_device *device);

wlr_input_device_is_libinput()

bool wlr_input_device_is_libinput(​struct wlr_input_device *device);

wlr_input_device_is_wl()

bool wlr_input_device_is_wl(​struct wlr_input_device *device);

True if the given input device is a wlr_wl_input_device.

wlr_input_device_is_x11()

bool wlr_input_device_is_x11(​struct wlr_input_device *device);

True if the given input device is a wlr_x11_input_device.

struct wlr_input_inhibit_manager

struct wlr_input_inhibit_manager {
	struct wl_global *global;
	struct wl_client *active_client;
	struct wl_resource *active_inhibitor;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal activate;
		struct wl_signal deactivate;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_input_inhibit_manager_create()

struct wlr_input_inhibit_manager *wlr_input_inhibit_manager_create(​struct wl_display *display);

struct wlr_input_method_keyboard_grab_v2

struct wlr_input_method_keyboard_grab_v2 {
	struct wl_resource *resource;
	struct wlr_input_method_v2 *input_method;
	struct wlr_keyboard *keyboard;
	struct wl_listener keyboard_keymap;
	struct wl_listener keyboard_repeat_info;
	struct wl_listener keyboard_destroy;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_input_method_keyboard_grab_v2_destroy()

void wlr_input_method_keyboard_grab_v2_destroy(​struct wlr_input_method_keyboard_grab_v2 *keyboard_grab);

wlr_input_method_keyboard_grab_v2_send_key()

void wlr_input_method_keyboard_grab_v2_send_key(​struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, uint32_t time, uint32_t key, uint32_t state);

wlr_input_method_keyboard_grab_v2_send_modifiers()

void wlr_input_method_keyboard_grab_v2_send_modifiers(​struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, struct wlr_keyboard_modifiers *modifiers);

wlr_input_method_keyboard_grab_v2_set_keyboard()

void wlr_input_method_keyboard_grab_v2_set_keyboard(​struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, struct wlr_keyboard *keyboard);

struct wlr_input_method_manager_v2

struct wlr_input_method_manager_v2 {
	struct wl_global *global;
	struct wl_list input_methods;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal input_method;
		struct wl_signal destroy;
	} events;
};

wlr_input_method_manager_v2_create()

struct wlr_input_method_manager_v2 *wlr_input_method_manager_v2_create(​struct wl_display *display);

struct wlr_input_method_v2

struct wlr_input_method_v2 {
	struct wl_resource *resource;
	struct wlr_seat *seat;
	struct wlr_seat_client *seat_client;
	struct wlr_input_method_v2_state pending;
	struct wlr_input_method_v2_state current;
	bool active;
	bool client_active;
	uint32_t current_serial;
	struct wl_list popup_surfaces;
	struct wlr_input_method_keyboard_grab_v2 *keyboard_grab;
	struct wl_list link;
	struct wl_listener seat_client_destroy;
	struct {
		struct wl_signal commit;
		struct wl_signal new_popup_surface;
		struct wl_signal grab_keyboard;
		struct wl_signal destroy;
	} events;
};

struct wlr_input_method_v2_delete_surrounding_text

struct wlr_input_method_v2_delete_surrounding_text {
	uint32_t before_length;
	uint32_t after_length;
};

struct wlr_input_method_v2_preedit_string

struct wlr_input_method_v2_preedit_string {
	char *text;
	int32_t cursor_begin;
	int32_t cursor_end;
};

wlr_input_method_v2_send_activate()

void wlr_input_method_v2_send_activate(​struct wlr_input_method_v2 *input_method);

wlr_input_method_v2_send_content_type()

void wlr_input_method_v2_send_content_type(​struct wlr_input_method_v2 *input_method, uint32_t hint, uint32_t purpose);

wlr_input_method_v2_send_deactivate()

void wlr_input_method_v2_send_deactivate(​struct wlr_input_method_v2 *input_method);

wlr_input_method_v2_send_done()

void wlr_input_method_v2_send_done(​struct wlr_input_method_v2 *input_method);

wlr_input_method_v2_send_surrounding_text()

void wlr_input_method_v2_send_surrounding_text(​struct wlr_input_method_v2 *input_method, const char *text, uint32_t cursor, uint32_t anchor);

wlr_input_method_v2_send_text_change_cause()

void wlr_input_method_v2_send_text_change_cause(​struct wlr_input_method_v2 *input_method, uint32_t cause);

wlr_input_method_v2_send_unavailable()

void wlr_input_method_v2_send_unavailable(​struct wlr_input_method_v2 *input_method);

struct wlr_input_method_v2_state

struct wlr_input_method_v2_state {
	struct wlr_input_method_v2_preedit_string preedit;
	char *commit_text;
	struct wlr_input_method_v2_delete_surrounding_text delete;
};

struct wlr_input_popup_surface_v2

struct wlr_input_popup_surface_v2 {
	struct wl_resource *resource;
	struct wlr_input_method_v2 *input_method;
	struct wl_list link;
	bool mapped;
	struct wlr_surface *surface;
	struct wl_listener surface_destroy;
	struct {
		struct wl_signal map;
		struct wl_signal unmap;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_input_popup_surface_v2_from_wlr_surface()

struct wlr_input_popup_surface_v2 *wlr_input_popup_surface_v2_from_wlr_surface(​struct wlr_surface *surface);

wlr_input_popup_surface_v2_send_text_input_rectangle()

void wlr_input_popup_surface_v2_send_text_input_rectangle(​struct wlr_input_popup_surface_v2 *popup_surface, struct wlr_box *sbox);

wlr_keyboard_destroy()

void wlr_keyboard_destroy(​struct wlr_keyboard *keyboard);

struct wlr_keyboard_group

struct wlr_keyboard_group {
	struct wlr_keyboard keyboard;
	struct wlr_input_device *input_device;
	struct wl_list devices;
	struct wl_list keys;
	struct {
		struct wl_signal enter;
		struct wl_signal leave;
	} events;
	void *data;
};

wlr_keyboard_group_add_keyboard()

bool wlr_keyboard_group_add_keyboard(​struct wlr_keyboard_group *group, struct wlr_keyboard *keyboard);

wlr_keyboard_group_create()

struct wlr_keyboard_group *wlr_keyboard_group_create(​void);

wlr_keyboard_group_destroy()

void wlr_keyboard_group_destroy(​struct wlr_keyboard_group *group);

wlr_keyboard_group_from_wlr_keyboard()

struct wlr_keyboard_group *wlr_keyboard_group_from_wlr_keyboard(​struct wlr_keyboard *keyboard);

wlr_keyboard_group_remove_keyboard()

void wlr_keyboard_group_remove_keyboard(​struct wlr_keyboard_group *group, struct wlr_keyboard *keyboard);

struct wlr_keyboard_impl

struct wlr_keyboard_impl {
	void (*destroy)(​struct wlr_keyboard *keyboard);
	void (*led_update)(​struct wlr_keyboard *keyboard, uint32_t leds);
};

wlr_keyboard_init()

void wlr_keyboard_init(​struct wlr_keyboard *keyboard, const struct wlr_keyboard_impl *impl);

wlr_keyboard_notify_key()

void wlr_keyboard_notify_key(​struct wlr_keyboard *keyboard, struct wlr_event_keyboard_key *event);

wlr_keyboard_notify_modifiers()

void wlr_keyboard_notify_modifiers(​struct wlr_keyboard *keyboard, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group);

struct wlr_keyboard_shortcuts_inhibit_manager_v1

struct wlr_keyboard_shortcuts_inhibit_manager_v1 {
	struct wl_list inhibitors;
	struct wl_global *global;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_inhibitor;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_keyboard_shortcuts_inhibit_v1_create()

struct wlr_keyboard_shortcuts_inhibit_manager_v1 *wlr_keyboard_shortcuts_inhibit_v1_create(​struct wl_display *display);

struct wlr_keyboard_shortcuts_inhibitor_v1

struct wlr_keyboard_shortcuts_inhibitor_v1 {
	struct wlr_surface *surface;
	struct wlr_seat *seat;
	bool active;
	struct wl_resource *resource;
	struct wl_listener surface_destroy;
	struct wl_listener seat_destroy;
	struct wl_list link;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_keyboard_shortcuts_inhibitor_v1_activate()

void wlr_keyboard_shortcuts_inhibitor_v1_activate(​struct wlr_keyboard_shortcuts_inhibitor_v1 *inhibitor);

wlr_keyboard_shortcuts_inhibitor_v1_deactivate()

void wlr_keyboard_shortcuts_inhibitor_v1_deactivate(​struct wlr_keyboard_shortcuts_inhibitor_v1 *inhibitor);

struct wlr_layer_shell_v1

struct wlr_layer_shell_v1 {
	struct wl_global *global;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_surface;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_layer_shell_v1 allows clients to arrange themselves in "layers" on the desktop in accordance with the wlr-layer-shell protocol. When a client is added, the new_surface signal will be raised and passed a reference to our wlr_layer_surface_v1. At this time, the client will have configured the surface as it desires, including information like desired anchors and margins. The compositor should use this information to decide how to arrange the layer on-screen, then determine the dimensions of the layer and call wlr_layer_surface_v1_configure. The client will then attach a buffer and commit the surface, at which point the wlr_layer_surface_v1 map signal is raised and the compositor should begin rendering the surface.

wlr_layer_shell_v1_create()

struct wlr_layer_shell_v1 *wlr_layer_shell_v1_create(​struct wl_display *display);

struct wlr_layer_surface_v1

struct wlr_layer_surface_v1 {
	struct wlr_surface *surface;
	struct wlr_output *output;
	struct wl_resource *resource;
	struct wlr_layer_shell_v1 *shell;
	struct wl_list popups;
	char *namespace;
	bool added, configured, mapped;
	struct wl_list configure_list;
	struct wlr_layer_surface_v1_state current, pending;
	struct wl_listener surface_destroy;
	struct {
		struct wl_signal destroy;
		struct wl_signal map;
		struct wl_signal unmap;
		struct wl_signal new_popup;
	} events;
	void *data;
};

wlr_layer_surface_v1_configure()

uint32_t wlr_layer_surface_v1_configure(​struct wlr_layer_surface_v1 *surface, uint32_t width, uint32_t height);

Notifies the layer surface to configure itself with this width/height. The layer_surface will signal its map event when the surface is ready to assume this size. Returns the associated configure serial.

struct wlr_layer_surface_v1_configure

struct wlr_layer_surface_v1_configure {
	struct wl_list link;
	uint32_t serial;
	uint32_t width, height;
};

wlr_layer_surface_v1_destroy()

void wlr_layer_surface_v1_destroy(​struct wlr_layer_surface_v1 *surface);

Notify the client that the surface has been closed and destroy the wlr_layer_surface_v1, rendering the resource inert.

wlr_layer_surface_v1_for_each_popup_surface()

void wlr_layer_surface_v1_for_each_popup_surface(​struct wlr_layer_surface_v1 *surface, wlr_surface_iterator_func_t iterator, void *user_data);

Call `iterator` on each popup's surface and popup's subsurface in the layer surface's tree, with the surfaces's position relative to the root layer surface. The function is called from root to leaves (in rendering order).

wlr_layer_surface_v1_for_each_surface()

void wlr_layer_surface_v1_for_each_surface(​struct wlr_layer_surface_v1 *surface, wlr_surface_iterator_func_t iterator, void *user_data);

Calls the iterator function for each mapped sub-surface and popup of this surface (whether or not this surface is mapped).

wlr_layer_surface_v1_from_wlr_surface()

struct wlr_layer_surface_v1 *wlr_layer_surface_v1_from_wlr_surface(​struct wlr_surface *surface);

wlr_layer_surface_v1_popup_surface_at()

struct wlr_surface *wlr_layer_surface_v1_popup_surface_at(​struct wlr_layer_surface_v1 *surface, double sx, double sy, double *sub_x, double *sub_y);

Find a surface within this layer-surface's popup tree at the given surface-local coordinates. Returns the surface and coordinates in the leaf surface coordinate system or NULL if no surface is found at that location.

struct wlr_layer_surface_v1_state

struct wlr_layer_surface_v1_state {
	uint32_t committed;
	uint32_t anchor;
	int32_t exclusive_zone;
	struct {
		int32_t top, right, bottom, left;
	} margin;
	enum zwlr_layer_surface_v1_keyboard_interactivity keyboard_interactive;
	uint32_t desired_width, desired_height;
	enum zwlr_layer_shell_v1_layer layer;
	uint32_t configure_serial;
	uint32_t actual_width, actual_height;
};

enum wlr_layer_surface_v1_state_field

enum wlr_layer_surface_v1_state_field {
	WLR_LAYER_SURFACE_V1_STATE_DESIRED_SIZE,
	WLR_LAYER_SURFACE_V1_STATE_ANCHOR,
	WLR_LAYER_SURFACE_V1_STATE_EXCLUSIVE_ZONE,
	WLR_LAYER_SURFACE_V1_STATE_MARGIN,
	WLR_LAYER_SURFACE_V1_STATE_KEYBOARD_INTERACTIVITY,
	WLR_LAYER_SURFACE_V1_STATE_LAYER,
};

wlr_layer_surface_v1_surface_at()

struct wlr_surface *wlr_layer_surface_v1_surface_at(​struct wlr_layer_surface_v1 *surface, double sx, double sy, double *sub_x, double *sub_y);

Find a surface within this layer-surface tree at the given surface-local coordinates. Returns the surface and coordinates in the leaf surface coordinate system or NULL if no surface is found at that location.

wlr_libinput_backend_create()

struct wlr_backend *wlr_libinput_backend_create(​struct wl_display *display, struct wlr_session *session);

wlr_libinput_get_device_handle()

struct libinput_device *wlr_libinput_get_device_handle(​struct wlr_input_device *dev);

Gets the underlying libinput_device handle for the given wlr_input_device

struct wlr_linux_dmabuf_feedback_v1

struct wlr_linux_dmabuf_feedback_v1 {
	dev_t main_device;
	size_t tranches_len;
	const struct wlr_linux_dmabuf_feedback_v1_tranche *tranches;
};

struct wlr_linux_dmabuf_feedback_v1_tranche

struct wlr_linux_dmabuf_feedback_v1_tranche {
	dev_t target_device;
	uint32_t flags;
	const struct wlr_drm_format_set *formats;
};

struct wlr_linux_dmabuf_v1

struct wlr_linux_dmabuf_v1 {
	struct wl_global *global;
	struct wlr_renderer *renderer;
	struct {
		struct wl_signal destroy;
	} events;
	struct wlr_linux_dmabuf_feedback_v1_compiled *default_feedback;
	struct wl_list surfaces;
	struct wl_listener display_destroy;
	struct wl_listener renderer_destroy;
};

the protocol interface

wlr_linux_dmabuf_v1_create()

struct wlr_linux_dmabuf_v1 *wlr_linux_dmabuf_v1_create(​struct wl_display *display, struct wlr_renderer *renderer);

Create linux-dmabuf interface

wlr_linux_dmabuf_v1_set_surface_feedback()

bool wlr_linux_dmabuf_v1_set_surface_feedback(​struct wlr_linux_dmabuf_v1 *linux_dmabuf, struct wlr_surface *surface, const struct wlr_linux_dmabuf_feedback_v1 *feedback);

Set a surface's DMA-BUF feedback.

Passing a NULL feedback resets it to the default feedback.

wlr_log_get_verbosity()

enum wlr_log_importance wlr_log_get_verbosity(​void);

enum wlr_log_importance

enum wlr_log_importance {
	WLR_SILENT,
	WLR_ERROR,
	WLR_INFO,
	WLR_DEBUG,
	WLR_LOG_IMPORTANCE_LAST,
};

wlr_log_init()

void wlr_log_init(​enum wlr_log_importance verbosity, wlr_log_func_t callback);

wlr_matrix_identity()

void wlr_matrix_identity(​float mat[]);

Writes the identity matrix into mat

wlr_matrix_multiply()

void wlr_matrix_multiply(​float mat[], const float a[], const float b[]);

mat ← a × b

wlr_matrix_project_box()

void wlr_matrix_project_box(​float mat[], const struct wlr_box *box, enum wl_output_transform transform, float rotation, const float projection[]);

Shortcut for the various matrix operations involved in projecting the specified wlr_box onto a given orthographic projection with a given rotation. The result is written to mat, which can be applied to each coordinate of the box to get a new coordinate from [-1,1].

wlr_matrix_projection()

void wlr_matrix_projection(​float mat[], int width, int height, enum wl_output_transform transform);

Writes a 2D orthographic projection matrix to mat of (width, height) with a specified wl_output_transform.

Deprecated: this function is deprecated and will be removed in a future version of wlroots.

wlr_matrix_rotate()

void wlr_matrix_rotate(​float mat[], float rad);

Writes a 2D rotation matrix to mat at an angle of rad radians

wlr_matrix_scale()

void wlr_matrix_scale(​float mat[], float x, float y);

Writes a 2D scale matrix to mat of magnitude (x, y)

wlr_matrix_transform()

void wlr_matrix_transform(​float mat[], enum wl_output_transform transform);

Writes a transformation matrix which applies the specified wl_output_transform to mat

wlr_matrix_translate()

void wlr_matrix_translate(​float mat[], float x, float y);

Writes a 2D translation matrix to mat of magnitude (x, y)

wlr_matrix_transpose()

void wlr_matrix_transpose(​float mat[], const float a[]);

wlr_multi_backend_add()

bool wlr_multi_backend_add(​struct wlr_backend *multi, struct wlr_backend *backend);

Adds the given backend to the multi backend. This should be done before the new backend is started.

wlr_multi_backend_create()

struct wlr_backend *wlr_multi_backend_create(​struct wl_display *display);

Creates a multi-backend. Multi-backends wrap an arbitrary number of backends and aggregate their new_output/new_input signals.

wlr_multi_backend_remove()

void wlr_multi_backend_remove(​struct wlr_backend *multi, struct wlr_backend *backend);

wlr_multi_for_each_backend()

void wlr_multi_for_each_backend(​struct wlr_backend *backend, void (*callback)(​struct wlr_backend *backend, void *data), void *data);

wlr_multi_is_empty()

bool wlr_multi_is_empty(​struct wlr_backend *backend);

struct wlr_output

struct wlr_output;

struct wlr_output_configuration_head_v1

struct wlr_output_configuration_head_v1 {
	struct wlr_output_head_v1_state state;
	struct wlr_output_configuration_v1 *config;
	struct wl_list link;
	struct wl_resource *resource;
	struct wl_listener output_destroy;
};

wlr_output_configuration_head_v1_create()

struct wlr_output_configuration_head_v1 *wlr_output_configuration_head_v1_create(​struct wlr_output_configuration_v1 *config, struct wlr_output *output);

Create a new configuration head for the given output. This adds the head to the provided output configuration.

The configuration head will be pre-filled with data from `output`. The compositor should adjust this data according to its current internal state.

struct wlr_output_configuration_v1

struct wlr_output_configuration_v1 {
	struct wl_list heads;
	struct wlr_output_manager_v1 *manager;
	uint32_t serial;
	bool finalized;
	bool finished;
	struct wl_resource *resource;
};

wlr_output_configuration_v1_create()

struct wlr_output_configuration_v1 *wlr_output_configuration_v1_create(​void);

Create a new, empty output configuration. Compositors should add current head status with `wlr_output_configuration_head_v1_create`. They can then call `wlr_output_manager_v1_set_configuration`.

wlr_output_configuration_v1_destroy()

void wlr_output_configuration_v1_destroy(​struct wlr_output_configuration_v1 *config);

wlr_output_configuration_v1_send_failed()

void wlr_output_configuration_v1_send_failed(​struct wlr_output_configuration_v1 *config);

If the configuration comes from a client request, this sends negative feedback to the client (configuration has not been applied).

wlr_output_configuration_v1_send_succeeded()

void wlr_output_configuration_v1_send_succeeded(​struct wlr_output_configuration_v1 *config);

If the configuration comes from a client request, this sends positive feedback to the client (configuration has been applied).

struct wlr_output_damage

struct wlr_output_damage {
	struct wlr_output *output;
	int max_rects;
	pixman_region32_t current;
	pixman_region32_t previous[];
	size_t previous_idx;
	bool pending_attach_render;
	struct {
		struct wl_signal frame;
		struct wl_signal destroy;
	} events;
	struct wl_listener output_destroy;
	struct wl_listener output_mode;
	struct wl_listener output_needs_frame;
	struct wl_listener output_damage;
	struct wl_listener output_frame;
	struct wl_listener output_precommit;
	struct wl_listener output_commit;
};

Tracks damage for an output.

The `frame` event will be emitted when it is a good time for the compositor to submit a new frame.

To render a new frame, compositors should call `wlr_output_damage_attach_render`, render and call `wlr_output_commit`. No rendering should happen outside a `frame` event handler or before `wlr_output_damage_attach_render`.

wlr_output_damage_add()

void wlr_output_damage_add(​struct wlr_output_damage *output_damage, pixman_region32_t *damage);

Accumulates damage and schedules a `frame` event.

wlr_output_damage_add_box()

void wlr_output_damage_add_box(​struct wlr_output_damage *output_damage, struct wlr_box *box);

Accumulates damage from a box and schedules a `frame` event.

wlr_output_damage_add_whole()

void wlr_output_damage_add_whole(​struct wlr_output_damage *output_damage);

Damages the whole output and schedules a `frame` event.

wlr_output_damage_attach_render()

bool wlr_output_damage_attach_render(​struct wlr_output_damage *output_damage, bool *needs_frame, pixman_region32_t *buffer_damage);

Attach the renderer's buffer to the output. Compositors must call this function before rendering. After they are done rendering, they should call `wlr_output_set_damage` and `wlr_output_commit` to submit the new frame.

`needs_frame` will be set to true if a frame should be submitted. `damage` will be set to the region of the output that needs to be repainted, in output-buffer-local coordinates.

The buffer damage region accumulates all damage since the buffer has last been swapped. This is not to be confused with the output surface damage, which only contains the changes between two frames.

wlr_output_damage_create()

struct wlr_output_damage *wlr_output_damage_create(​struct wlr_output *output);

wlr_output_damage_destroy()

void wlr_output_damage_destroy(​struct wlr_output_damage *output_damage);

wlr_output_damage_whole()

void wlr_output_damage_whole(​struct wlr_output *output);

Notify compositors that the output needs to be fully repainted.

struct wlr_output_event_present

struct wlr_output_event_present;

struct wlr_output_head_v1

struct wlr_output_head_v1 {
	struct wlr_output_head_v1_state state;
	struct wlr_output_manager_v1 *manager;
	struct wl_list link;
	struct wl_list resources;
	struct wl_list mode_resources;
	struct wl_listener output_destroy;
};

struct wlr_output_head_v1_state

struct wlr_output_head_v1_state {
	struct wlr_output *output;
	bool enabled;
	struct wlr_output_mode *mode;
	struct {
		int32_t width, height;
		int32_t refresh;
	} custom_mode;
	int32_t x, y;
	enum wl_output_transform transform;
	float scale;
};

struct wlr_output_impl

struct wlr_output_impl {
	bool (*set_cursor)(​struct wlr_output *output, struct wlr_buffer *buffer, int hotspot_x, int hotspot_y);
	bool (*move_cursor)(​struct wlr_output *output, int x, int y);
	void (*destroy)(​struct wlr_output *output);
	bool (*test)(​struct wlr_output *output);
	bool (*commit)(​struct wlr_output *output);
	size_t (*get_gamma_size)(​struct wlr_output *output);
	const struct wlr_drm_format_set *(*get_cursor_formats)(​struct wlr_output *output, uint32_t buffer_caps);
	void (*get_cursor_size)(​struct wlr_output *output, int *width, int *height);
	const struct wlr_drm_format_set *(*get_primary_formats)(​struct wlr_output *output, uint32_t buffer_caps);
};

A backend implementation of wlr_output.

The commit function is mandatory. Other functions are optional.

wlr_output_init()

void wlr_output_init(​struct wlr_output *output, struct wlr_backend *backend, const struct wlr_output_impl *impl, struct wl_display *display);

Initialize a new output.

wlr_output_is_drm()

bool wlr_output_is_drm(​struct wlr_output *output);

wlr_output_is_headless()

bool wlr_output_is_headless(​struct wlr_output *output);

wlr_output_is_wl()

bool wlr_output_is_wl(​struct wlr_output *output);

True if the given output is a wlr_wl_output.

wlr_output_is_x11()

bool wlr_output_is_x11(​struct wlr_output *output);

True if the given output is a wlr_x11_output.

struct wlr_output_layout

struct wlr_output_layout {
	struct wl_list outputs;
	struct wlr_output_layout_state *state;
	struct {
		struct wl_signal add;
		struct wl_signal change;
		struct wl_signal destroy;
	} events;
	void *data;
};

Helper to arrange outputs in a 2D coordinate space. The output effective resolution is used, see wlr_output_effective_resolution.

Outputs added to the output layout are automatically exposed to clients (see wlr_output_create_global). They are no longer exposed when removed from the layout.

wlr_output_layout_add()

void wlr_output_layout_add(​struct wlr_output_layout *layout, struct wlr_output *output, int lx, int ly);

Add the output to the layout at the specified coordinates. If the output is already part of the output layout, this moves the output.

wlr_output_layout_add_auto()

void wlr_output_layout_add_auto(​struct wlr_output_layout *layout, struct wlr_output *output);

Add an auto configured output to the layout. This will place the output in a sensible location in the layout. The coordinates of the output in the layout may adjust dynamically when the layout changes. If the output is already in the layout, it will become auto configured. If the position of the output is set such as with `wlr_output_layout_move()`, the output will become manually configured.

wlr_output_layout_adjacent_output()

struct wlr_output *wlr_output_layout_adjacent_output(​struct wlr_output_layout *layout, enum wlr_direction direction, struct wlr_output *reference, double ref_lx, double ref_ly);

Get the closest adjacent output to the reference output from the reference point in the given direction.

wlr_output_layout_closest_point()

void wlr_output_layout_closest_point(​struct wlr_output_layout *layout, struct wlr_output *reference, double lx, double ly, double *dest_lx, double *dest_ly);

Get the closest point on this layout from the given point from the reference output. If reference is NULL, gets the closest point from the entire layout.

wlr_output_layout_contains_point()

bool wlr_output_layout_contains_point(​struct wlr_output_layout *layout, struct wlr_output *reference, int lx, int ly);

wlr_output_layout_create()

struct wlr_output_layout *wlr_output_layout_create(​void);

wlr_output_layout_destroy()

void wlr_output_layout_destroy(​struct wlr_output_layout *layout);

wlr_output_layout_farthest_output()

struct wlr_output *wlr_output_layout_farthest_output(​struct wlr_output_layout *layout, enum wlr_direction direction, struct wlr_output *reference, double ref_lx, double ref_ly);

wlr_output_layout_get()

struct wlr_output_layout_output *wlr_output_layout_get(​struct wlr_output_layout *layout, struct wlr_output *reference);

Get the output layout for the specified output. Returns NULL if no output matches.

wlr_output_layout_get_box()

struct wlr_box *wlr_output_layout_get_box(​struct wlr_output_layout *layout, struct wlr_output *reference);

Get the box of the layout for the given reference output in layout coordinates. If `reference` is NULL, the box will be for the extents of the entire layout.

wlr_output_layout_get_center_output()

struct wlr_output *wlr_output_layout_get_center_output(​struct wlr_output_layout *layout);

Get the output closest to the center of the layout extents.

wlr_output_layout_intersects()

bool wlr_output_layout_intersects(​struct wlr_output_layout *layout, struct wlr_output *reference, const struct wlr_box *target_lbox);

wlr_output_layout_move()

void wlr_output_layout_move(​struct wlr_output_layout *layout, struct wlr_output *output, int lx, int ly);

struct wlr_output_layout_output

struct wlr_output_layout_output {
	struct wlr_output *output;
	int x, y;
	struct wl_list link;
	struct wlr_output_layout_output_state *state;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_output_layout_output_at()

struct wlr_output *wlr_output_layout_output_at(​struct wlr_output_layout *layout, double lx, double ly);

Get the output at the specified layout coordinates. Returns NULL if no output matches the coordinates.

wlr_output_layout_output_coords()

void wlr_output_layout_output_coords(​struct wlr_output_layout *layout, struct wlr_output *reference, double *lx, double *ly);

Given x and y in layout coordinates, adjusts them to local output coordinates relative to the given reference output.

struct wlr_output_layout_output_state

struct wlr_output_layout_output_state;

wlr_output_layout_remove()

void wlr_output_layout_remove(​struct wlr_output_layout *layout, struct wlr_output *output);

struct wlr_output_layout_state

struct wlr_output_layout_state;

struct wlr_output_manager_v1

struct wlr_output_manager_v1 {
	struct wl_display *display;
	struct wl_global *global;
	struct wl_list resources;
	struct wl_list heads;
	uint32_t serial;
	bool current_configuration_dirty;
	struct {
		struct wl_signal apply;
		struct wl_signal test;
		struct wl_signal destroy;
	} events;
	struct wl_listener display_destroy;
	void *data;
};

wlr_output_manager_v1_create()

struct wlr_output_manager_v1 *wlr_output_manager_v1_create(​struct wl_display *display);

Create a new output manager. The compositor is responsible for calling `wlr_output_manager_v1_set_configuration` whenever the current output configuration changes.

wlr_output_manager_v1_set_configuration()

void wlr_output_manager_v1_set_configuration(​struct wlr_output_manager_v1 *manager, struct wlr_output_configuration_v1 *config);

Updates the output manager's current configuration. This will broadcast any changes to all clients.

This function takes ownership over `config`. That is, the compositor must not access the configuration anymore.

struct wlr_output_power_manager_v1

struct wlr_output_power_manager_v1 {
	struct wl_global *global;
	struct wl_list output_powers;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal set_mode;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_output_power_manager_v1_create()

struct wlr_output_power_manager_v1 *wlr_output_power_manager_v1_create(​struct wl_display *display);

struct wlr_output_power_v1

struct wlr_output_power_v1 {
	struct wl_resource *resource;
	struct wlr_output *output;
	struct wlr_output_power_manager_v1 *manager;
	struct wl_list link;
	struct wl_listener output_destroy_listener;
	struct wl_listener output_commit_listener;
	void *data;
};

struct wlr_output_power_v1_set_mode_event

struct wlr_output_power_v1_set_mode_event {
	struct wlr_output *output;
	enum zwlr_output_power_v1_mode mode;
};

wlr_output_send_frame()

void wlr_output_send_frame(​struct wlr_output *output);

Send a frame event.

See wlr_output.events.frame.

wlr_output_send_present()

void wlr_output_send_present(​struct wlr_output *output, struct wlr_output_event_present *event);

Send a present event.

See wlr_output.events.present.

wlr_output_update_custom_mode()

void wlr_output_update_custom_mode(​struct wlr_output *output, int32_t width, int32_t height, int32_t refresh);

Update the current output custom mode.

The backend must call this function when the mode is updated to notify compositors about the change.

wlr_output_update_enabled()

void wlr_output_update_enabled(​struct wlr_output *output, bool enabled);

Update the current output status.

The backend must call this function when the status is updated to notify compositors about the change.

wlr_output_update_mode()

void wlr_output_update_mode(​struct wlr_output *output, struct wlr_output_mode *mode);

Update the current output mode.

The backend must call this function when the mode is updated to notify compositors about the change.

wlr_output_update_needs_frame()

void wlr_output_update_needs_frame(​struct wlr_output *output);

Notify compositors that they need to submit a new frame in order to apply output changes.

wlr_pixman_renderer_create()

struct wlr_renderer *wlr_pixman_renderer_create(​void);

wlr_pixman_renderer_get_current_image()

pixman_image_t *wlr_pixman_renderer_get_current_image(​struct wlr_renderer *wlr_renderer);

Returns the image of current buffer.

wlr_pixman_texture_get_image()

pixman_image_t *wlr_pixman_texture_get_image(​struct wlr_texture *wlr_texture);

struct wlr_pointer_constraint_v1

struct wlr_pointer_constraint_v1 {
	struct wlr_pointer_constraints_v1 *pointer_constraints;
	struct wl_resource *resource;
	struct wlr_surface *surface;
	struct wlr_seat *seat;
	enum zwp_pointer_constraints_v1_lifetime lifetime;
	enum wlr_pointer_constraint_v1_type type;
	pixman_region32_t region;
	struct wlr_pointer_constraint_v1_state current, pending;
	struct wl_listener surface_commit;
	struct wl_listener surface_destroy;
	struct wl_listener seat_destroy;
	struct wl_list link;
	struct {
		struct wl_signal set_region;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_pointer_constraint_v1_send_activated()

void wlr_pointer_constraint_v1_send_activated(​struct wlr_pointer_constraint_v1 *constraint);

wlr_pointer_constraint_v1_send_deactivated()

void wlr_pointer_constraint_v1_send_deactivated(​struct wlr_pointer_constraint_v1 *constraint);

Deactivate the constraint. May destroy the constraint.

struct wlr_pointer_constraint_v1_state

struct wlr_pointer_constraint_v1_state {
	uint32_t committed;
	pixman_region32_t region;
	struct {
		double x, y;
	} cursor_hint;
};

enum wlr_pointer_constraint_v1_state_field

enum wlr_pointer_constraint_v1_state_field {
	WLR_POINTER_CONSTRAINT_V1_STATE_REGION,
	WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT,
};

enum wlr_pointer_constraint_v1_type

enum wlr_pointer_constraint_v1_type {
	WLR_POINTER_CONSTRAINT_V1_LOCKED,
	WLR_POINTER_CONSTRAINT_V1_CONFINED,
};

struct wlr_pointer_constraints_v1

struct wlr_pointer_constraints_v1 {
	struct wl_global *global;
	struct wl_list constraints;
	struct {
		struct wl_signal new_constraint;
	} events;
	struct wl_listener display_destroy;
	void *data;
};

wlr_pointer_constraints_v1_constraint_for_surface()

struct wlr_pointer_constraint_v1 *wlr_pointer_constraints_v1_constraint_for_surface(​struct wlr_pointer_constraints_v1 *pointer_constraints, struct wlr_surface *surface, struct wlr_seat *seat);

wlr_pointer_constraints_v1_create()

struct wlr_pointer_constraints_v1 *wlr_pointer_constraints_v1_create(​struct wl_display *display);

wlr_pointer_destroy()

void wlr_pointer_destroy(​struct wlr_pointer *pointer);

struct wlr_pointer_gestures_v1

struct wlr_pointer_gestures_v1 {
	struct wl_global *global;
	struct wl_list swipes;
	struct wl_list pinches;
	struct wl_list holds;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_pointer_gestures_v1_create()

struct wlr_pointer_gestures_v1 *wlr_pointer_gestures_v1_create(​struct wl_display *display);

wlr_pointer_gestures_v1_send_hold_begin()

void wlr_pointer_gestures_v1_send_hold_begin(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, uint32_t fingers);

wlr_pointer_gestures_v1_send_hold_end()

void wlr_pointer_gestures_v1_send_hold_end(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, bool cancelled);

wlr_pointer_gestures_v1_send_pinch_begin()

void wlr_pointer_gestures_v1_send_pinch_begin(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, uint32_t fingers);

wlr_pointer_gestures_v1_send_pinch_end()

void wlr_pointer_gestures_v1_send_pinch_end(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, bool cancelled);

wlr_pointer_gestures_v1_send_pinch_update()

void wlr_pointer_gestures_v1_send_pinch_update(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, double dx, double dy, double scale, double rotation);

wlr_pointer_gestures_v1_send_swipe_begin()

void wlr_pointer_gestures_v1_send_swipe_begin(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, uint32_t fingers);

wlr_pointer_gestures_v1_send_swipe_end()

void wlr_pointer_gestures_v1_send_swipe_end(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, bool cancelled);

wlr_pointer_gestures_v1_send_swipe_update()

void wlr_pointer_gestures_v1_send_swipe_update(​struct wlr_pointer_gestures_v1 *gestures, struct wlr_seat *seat, uint32_t time_msec, double dx, double dy);

struct wlr_pointer_impl

struct wlr_pointer_impl {
	void (*destroy)(​struct wlr_pointer *pointer);
};

wlr_pointer_init()

void wlr_pointer_init(​struct wlr_pointer *pointer, const struct wlr_pointer_impl *impl);

struct wlr_presentation

struct wlr_presentation {
	struct wl_global *global;
	clockid_t clock;
	struct {
		struct wl_signal destroy;
	} events;
	struct wl_listener display_destroy;
};

wlr_presentation_create()

struct wlr_presentation *wlr_presentation_create(​struct wl_display *display, struct wlr_backend *backend);

struct wlr_presentation_event

struct wlr_presentation_event {
	struct wlr_output *output;
	uint64_t tv_sec;
	uint32_t tv_nsec;
	uint32_t refresh;
	uint64_t seq;
	uint32_t flags;
};

wlr_presentation_event_from_output()

void wlr_presentation_event_from_output(​struct wlr_presentation_event *event, const struct wlr_output_event_present *output_event);

Fill a wlr_presentation_event from a wlr_output_event_present.

struct wlr_presentation_feedback

struct wlr_presentation_feedback {
	struct wl_list resources;
	struct wlr_output *output;
	bool output_committed;
	uint32_t output_commit_seq;
	struct wl_listener output_commit;
	struct wl_listener output_present;
	struct wl_listener output_destroy;
};

wlr_presentation_feedback_destroy()

void wlr_presentation_feedback_destroy(​struct wlr_presentation_feedback *feedback);

wlr_presentation_feedback_send_presented()

void wlr_presentation_feedback_send_presented(​struct wlr_presentation_feedback *feedback, struct wlr_presentation_event *event);

wlr_presentation_surface_sampled()

struct wlr_presentation_feedback *wlr_presentation_surface_sampled(​struct wlr_presentation *presentation, struct wlr_surface *surface);

Mark the current surface's buffer as sampled.

The compositor must call this function when it uses the surface's current contents (e.g. when rendering the surface's current texture, when referencing its current buffer, or when directly scanning out its current buffer). A wlr_presentation_feedback is returned. The compositor should call wlr_presentation_feedback_send_presented if this content has been displayed, then wlr_presentation_feedback_destroy.

NULL is returned if the client hasn't requested presentation feedback for this surface.

wlr_presentation_surface_sampled_on_output()

void wlr_presentation_surface_sampled_on_output(​struct wlr_presentation *presentation, struct wlr_surface *surface, struct wlr_output *output);

Mark the current surface's buffer as sampled on the given output.

Instead of calling wlr_presentation_surface_sampled and managing the wlr_presentation_feedback itself, the compositor can call this function before a wlr_output_commit call to indicate that the surface's current contents will be displayed on the output.

struct wlr_primary_selection_source

struct wlr_primary_selection_source {
	const struct wlr_primary_selection_source_impl *impl;
	struct wl_array mime_types;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

A source is the sending side of a selection.

wlr_primary_selection_source_destroy()

void wlr_primary_selection_source_destroy(​struct wlr_primary_selection_source *source);

struct wlr_primary_selection_source_impl

struct wlr_primary_selection_source_impl {
	void (*send)(​struct wlr_primary_selection_source *source, const char *mime_type, int fd);
	void (*destroy)(​struct wlr_primary_selection_source *source);
};

A data source implementation. Only the `send` function is mandatory.

wlr_primary_selection_source_init()

void wlr_primary_selection_source_init(​struct wlr_primary_selection_source *source, const struct wlr_primary_selection_source_impl *impl);

wlr_primary_selection_source_send()

void wlr_primary_selection_source_send(​struct wlr_primary_selection_source *source, const char *mime_type, int fd);

struct wlr_primary_selection_v1_device

struct wlr_primary_selection_v1_device {
	struct wlr_primary_selection_v1_device_manager *manager;
	struct wlr_seat *seat;
	struct wl_list link;
	struct wl_list resources;
	struct wl_list offers;
	struct wl_listener seat_destroy;
	struct wl_listener seat_focus_change;
	struct wl_listener seat_set_primary_selection;
	void *data;
};

A device is a per-seat object used to set and get the current selection.

struct wlr_primary_selection_v1_device_manager

struct wlr_primary_selection_v1_device_manager {
	struct wl_global *global;
	struct wl_list devices;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_primary_selection_v1_device_manager_create()

struct wlr_primary_selection_v1_device_manager *wlr_primary_selection_v1_device_manager_create(​struct wl_display *display);

wlr_region_confine()

bool wlr_region_confine(​pixman_region32_t *region, double x1, double y1, double x2, double y2, double *x2_out, double *y2_out);

wlr_region_expand()

void wlr_region_expand(​pixman_region32_t *dst, pixman_region32_t *src, int distance);

Expands the region of `distance`. If `distance` is negative, it shrinks the region.

wlr_region_from_resource()

pixman_region32_t *wlr_region_from_resource(​struct wl_resource *resource);

Obtain a Pixman region from a wl_region resource.

To allow clients to create wl_region objects, call wlr_compositor_create().

wlr_region_rotated_bounds()

void wlr_region_rotated_bounds(​pixman_region32_t *dst, pixman_region32_t *src, float rotation, int ox, int oy);

Builds the smallest possible region that contains the region rotated about the point (ox, oy).

wlr_region_scale()

void wlr_region_scale(​pixman_region32_t *dst, pixman_region32_t *src, float scale);

Scales a region, ie. multiplies all its coordinates by `scale`.

The resulting coordinates are rounded up or down so that the new region is at least as big as the original one.

wlr_region_scale_xy()

void wlr_region_scale_xy(​pixman_region32_t *dst, pixman_region32_t *src, float scale_x, float scale_y);

wlr_region_transform()

void wlr_region_transform(​pixman_region32_t *dst, pixman_region32_t *src, enum wl_output_transform transform, int width, int height);

Applies a transform to a region inside a box of size `width` x `height`.

struct wlr_relative_pointer_manager_v1

struct wlr_relative_pointer_manager_v1 {
	struct wl_global *global;
	struct wl_list relative_pointers;
	struct {
		struct wl_signal destroy;
		struct wl_signal new_relative_pointer;
	} events;
	struct wl_listener display_destroy_listener;
	void *data;
};

A global interface used for getting the relative pointer object for a given pointer.

wlr_relative_pointer_manager_v1_create()

struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_manager_v1_create(​struct wl_display *display);

wlr_relative_pointer_manager_v1_send_relative_motion()

void wlr_relative_pointer_manager_v1_send_relative_motion(​struct wlr_relative_pointer_manager_v1 *manager, struct wlr_seat *seat, uint64_t time_usec, double dx, double dy, double dx_unaccel, double dy_unaccel);

Send a relative motion event to the seat. Time is given in microseconds (unlike wl_pointer which uses milliseconds).

struct wlr_relative_pointer_v1

struct wlr_relative_pointer_v1 {
	struct wl_resource *resource;
	struct wl_resource *pointer_resource;
	struct wlr_seat *seat;
	struct wl_list link;
	struct {
		struct wl_signal destroy;
	} events;
	struct wl_listener seat_destroy;
	struct wl_listener pointer_destroy;
	void *data;
};

A wp_relative_pointer object is an extension to the wl_pointer interface used for emitting relative pointer events. It shares the same focus as wl_pointer objects of the same seat and will only emit events when it has focus.

wlr_relative_pointer_v1_from_resource()

struct wlr_relative_pointer_v1 *wlr_relative_pointer_v1_from_resource(​struct wl_resource *resource);

Get a relative pointer from its resource. Returns NULL if inert.

wlr_render_quad_with_matrix()

void wlr_render_quad_with_matrix(​struct wlr_renderer *r, const float color[], const float matrix[]);

Renders a solid quadrangle in the specified color with the specified matrix.

wlr_render_rect()

void wlr_render_rect(​struct wlr_renderer *r, const struct wlr_box *box, const float color[], const float projection[]);

Renders a solid rectangle in the specified color.

wlr_render_subtexture_with_matrix()

bool wlr_render_subtexture_with_matrix(​struct wlr_renderer *r, struct wlr_texture *texture, const struct wlr_fbox *box, const float matrix[], float alpha);

Renders the requested texture using the provided matrix, after cropping it to the provided rectangle.

wlr_render_texture()

bool wlr_render_texture(​struct wlr_renderer *r, struct wlr_texture *texture, const float projection[], int x, int y, float alpha);

Renders the requested texture.

wlr_render_texture_with_matrix()

bool wlr_render_texture_with_matrix(​struct wlr_renderer *r, struct wlr_texture *texture, const float matrix[], float alpha);

Renders the requested texture using the provided matrix.

struct wlr_renderer

struct wlr_renderer {
	const struct wlr_renderer_impl *impl;
	bool rendering;
	bool rendering_with_buffer;
	struct {
		struct wl_signal destroy;
	} events;
};

wlr_renderer_autocreate()

struct wlr_renderer *wlr_renderer_autocreate(​struct wlr_backend *backend);

wlr_renderer_begin()

void wlr_renderer_begin(​struct wlr_renderer *r, uint32_t width, uint32_t height);

wlr_renderer_begin_with_buffer()

bool wlr_renderer_begin_with_buffer(​struct wlr_renderer *r, struct wlr_buffer *buffer);

wlr_renderer_clear()

void wlr_renderer_clear(​struct wlr_renderer *r, const float color[]);

wlr_renderer_destroy()

void wlr_renderer_destroy(​struct wlr_renderer *renderer);

Destroys this wlr_renderer. Textures must be destroyed separately.

wlr_renderer_end()

void wlr_renderer_end(​struct wlr_renderer *r);

wlr_renderer_get_drm_fd()

int wlr_renderer_get_drm_fd(​struct wlr_renderer *r);

Obtains the FD of the DRM device used for rendering, or -1 if unavailable.

The caller doesn't have ownership of the FD, it must not close it.

struct wlr_renderer_impl

struct wlr_renderer_impl {
	bool (*bind_buffer)(​struct wlr_renderer *renderer, struct wlr_buffer *buffer);
	void (*begin)(​struct wlr_renderer *renderer, uint32_t width, uint32_t height);
	void (*end)(​struct wlr_renderer *renderer);
	void (*clear)(​struct wlr_renderer *renderer, const float color[]);
	void (*scissor)(​struct wlr_renderer *renderer, struct wlr_box *box);
	bool (*render_subtexture_with_matrix)(​struct wlr_renderer *renderer, struct wlr_texture *texture, const struct wlr_fbox *box, const float matrix[], float alpha);
	void (*render_quad_with_matrix)(​struct wlr_renderer *renderer, const float color[], const float matrix[]);
	const uint32_t *(*get_shm_texture_formats)(​struct wlr_renderer *renderer, size_t *len);
	const struct wlr_drm_format_set *(*get_dmabuf_texture_formats)(​struct wlr_renderer *renderer);
	const struct wlr_drm_format_set *(*get_render_formats)(​struct wlr_renderer *renderer);
	uint32_t (*preferred_read_format)(​struct wlr_renderer *renderer);
	bool (*read_pixels)(​struct wlr_renderer *renderer, uint32_t fmt, uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data);
	void (*destroy)(​struct wlr_renderer *renderer);
	int (*get_drm_fd)(​struct wlr_renderer *renderer);
	uint32_t (*get_render_buffer_caps)(​struct wlr_renderer *renderer);
	struct wlr_texture *(*texture_from_buffer)(​struct wlr_renderer *renderer, struct wlr_buffer *buffer);
};

wlr_renderer_init()

void wlr_renderer_init(​struct wlr_renderer *renderer, const struct wlr_renderer_impl *impl);

wlr_renderer_init_wl_display()

bool wlr_renderer_init_wl_display(​struct wlr_renderer *r, struct wl_display *wl_display);

Initializes wl_shm, linux-dmabuf and other buffer factory protocols.

Returns false on failure.

wlr_renderer_init_wl_shm()

bool wlr_renderer_init_wl_shm(​struct wlr_renderer *r, struct wl_display *wl_display);

Initializes wl_shm on the provided wl_display.

wlr_renderer_is_gles2()

bool wlr_renderer_is_gles2(​struct wlr_renderer *wlr_renderer);

wlr_renderer_is_pixman()

bool wlr_renderer_is_pixman(​struct wlr_renderer *wlr_renderer);

wlr_renderer_read_pixels()

bool wlr_renderer_read_pixels(​struct wlr_renderer *r, uint32_t fmt, uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data);

Reads out of pixels of the currently bound surface into data. `stride` is in bytes.

If `flags` is not NULl, the caller indicates that it accepts frame flags defined in `enum wlr_renderer_read_pixels_flags`.

enum wlr_renderer_read_pixels_flags

enum wlr_renderer_read_pixels_flags {
	WLR_RENDERER_READ_PIXELS_Y_INVERT,
};

wlr_renderer_scissor()

void wlr_renderer_scissor(​struct wlr_renderer *r, struct wlr_box *box);

Defines a scissor box. Only pixels that lie within the scissor box can be modified by drawing functions. Providing a NULL `box` disables the scissor box.

struct wlr_scene

struct wlr_scene {
	struct wlr_scene_node node;
	struct wl_list outputs;
	struct wlr_presentation *presentation;
	struct wl_listener presentation_destroy;
};

The root scene-graph node.

wlr_scene_attach_output_layout()

bool wlr_scene_attach_output_layout(​struct wlr_scene *scene, struct wlr_output_layout *output_layout);

Attach an output layout to a scene.

Outputs in the output layout are automatically added to the scene. Any change to the output layout is mirrored to the scene-graph outputs.

struct wlr_scene_buffer

struct wlr_scene_buffer {
	struct wlr_scene_node node;
	struct wlr_buffer *buffer;
	struct wlr_texture *texture;
	struct wlr_fbox src_box;
	int dst_width, dst_height;
	enum wl_output_transform transform;
};

A scene-graph node displaying a buffer

wlr_scene_buffer_create()

struct wlr_scene_buffer *wlr_scene_buffer_create(​struct wlr_scene_node *parent, struct wlr_buffer *buffer);

Add a node displaying a buffer to the scene-graph.

wlr_scene_buffer_set_dest_size()

void wlr_scene_buffer_set_dest_size(​struct wlr_scene_buffer *scene_buffer, int width, int height);

Set the destination size describing the region of the scene-graph the buffer will be painted onto. This allows scaling the buffer.

If zero, the destination size will be the buffer size. By default, the destination size is zero.

wlr_scene_buffer_set_source_box()

void wlr_scene_buffer_set_source_box(​struct wlr_scene_buffer *scene_buffer, const struct wlr_fbox *box);

Set the source rectangle describing the region of the buffer which will be sampled to render this node. This allows cropping the buffer.

If NULL, the whole buffer is sampled. By default, the source box is NULL.

wlr_scene_buffer_set_transform()

void wlr_scene_buffer_set_transform(​struct wlr_scene_buffer *scene_buffer, enum wl_output_transform transform);

Set a transform which will be applied to the buffer.

wlr_scene_create()

struct wlr_scene *wlr_scene_create(​void);

Create a new scene-graph.

wlr_scene_get_scene_output()

struct wlr_scene_output *wlr_scene_get_scene_output(​struct wlr_scene *scene, struct wlr_output *output);

Get a scene-graph output from a wlr_output.

If the output hasn't been added to the scene-graph, returns NULL.

struct wlr_scene_node

struct wlr_scene_node {
	enum wlr_scene_node_type type;
	struct wlr_scene_node *parent;
	struct wlr_scene_node_state state;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

A node is an object in the scene.

wlr_scene_node_at()

struct wlr_scene_node *wlr_scene_node_at(​struct wlr_scene_node *node, double lx, double ly, double *nx, double *ny);

Find the topmost node in this scene-graph that contains the point at the given layout-local coordinates. (For surface nodes, this means accepting input events at that point.) Returns the node and coordinates relative to the returned node, or NULL if no node is found at that location.

wlr_scene_node_coords()

bool wlr_scene_node_coords(​struct wlr_scene_node *node, int *lx, int *ly);

Get the node's layout-local coordinates.

True is returned if the node and all of its ancestors are enabled.

wlr_scene_node_destroy()

void wlr_scene_node_destroy(​struct wlr_scene_node *node);

Immediately destroy the scene-graph node.

wlr_scene_node_for_each_surface()

void wlr_scene_node_for_each_surface(​struct wlr_scene_node *node, wlr_surface_iterator_func_t iterator, void *user_data);

Call `iterator` on each surface in the scene-graph, with the surface's position in layout coordinates. The function is called from root to leaves (in rendering order).

wlr_scene_node_lower_to_bottom()

void wlr_scene_node_lower_to_bottom(​struct wlr_scene_node *node);

Move the node below all of its sibling nodes.

wlr_scene_node_place_above()

void wlr_scene_node_place_above(​struct wlr_scene_node *node, struct wlr_scene_node *sibling);

Move the node right above the specified sibling. Asserts that node and sibling are distinct and share the same parent.

wlr_scene_node_place_below()

void wlr_scene_node_place_below(​struct wlr_scene_node *node, struct wlr_scene_node *sibling);

Move the node right below the specified sibling. Asserts that node and sibling are distinct and share the same parent.

wlr_scene_node_raise_to_top()

void wlr_scene_node_raise_to_top(​struct wlr_scene_node *node);

Move the node above all of its sibling nodes.

wlr_scene_node_reparent()

void wlr_scene_node_reparent(​struct wlr_scene_node *node, struct wlr_scene_node *new_parent);

Move the node to another location in the tree.

wlr_scene_node_set_enabled()

void wlr_scene_node_set_enabled(​struct wlr_scene_node *node, bool enabled);

Enable or disable this node. If a node is disabled, all of its children are implicitly disabled as well.

wlr_scene_node_set_position()

void wlr_scene_node_set_position(​struct wlr_scene_node *node, int x, int y);

Set the position of the node relative to its parent.

struct wlr_scene_node_state

struct wlr_scene_node_state {
	struct wl_list link;
	struct wl_list children;
	bool enabled;
	int x, y;
};

enum wlr_scene_node_type

enum wlr_scene_node_type {
	WLR_SCENE_NODE_ROOT,
	WLR_SCENE_NODE_TREE,
	WLR_SCENE_NODE_SURFACE,
	WLR_SCENE_NODE_RECT,
	WLR_SCENE_NODE_BUFFER,
};

struct wlr_scene_output

struct wlr_scene_output {
	struct wlr_output *output;
	struct wl_list link;
	struct wlr_scene *scene;
	struct wlr_addon addon;
	struct wlr_output_damage *damage;
	int x, y;
	bool prev_scanout;
};

A viewport for an output in the scene-graph

wlr_scene_output_commit()

bool wlr_scene_output_commit(​struct wlr_scene_output *scene_output);

Render and commit an output.

wlr_scene_output_create()

struct wlr_scene_output *wlr_scene_output_create(​struct wlr_scene *scene, struct wlr_output *output);

Add a viewport for the specified output to the scene-graph.

An output can only be added once to the scene-graph.

wlr_scene_output_destroy()

void wlr_scene_output_destroy(​struct wlr_scene_output *scene_output);

Destroy a scene-graph output.

wlr_scene_output_for_each_surface()

void wlr_scene_output_for_each_surface(​struct wlr_scene_output *scene_output, wlr_surface_iterator_func_t iterator, void *user_data);

Call `iterator` on each surface in the scene-graph visible on the output, with the surface's position in layout coordinates. The function is called from root to leaves (in rendering order).

wlr_scene_output_send_frame_done()

void wlr_scene_output_send_frame_done(​struct wlr_scene_output *scene_output, struct timespec *now);

Call wlr_surface_send_frame_done() on all surfaces in the scene rendered by wlr_scene_output_commit() for which wlr_scene_surface->primary_output matches the given scene_output.

wlr_scene_output_set_position()

void wlr_scene_output_set_position(​struct wlr_scene_output *scene_output, int lx, int ly);

Set the output's position in the scene-graph.

struct wlr_scene_rect

struct wlr_scene_rect {
	struct wlr_scene_node node;
	int width, height;
	float color[];
};

A scene-graph node displaying a solid-colored rectangle

wlr_scene_rect_create()

struct wlr_scene_rect *wlr_scene_rect_create(​struct wlr_scene_node *parent, int width, int height, const float color[]);

Add a node displaying a solid-colored rectangle to the scene-graph.

wlr_scene_rect_set_color()

void wlr_scene_rect_set_color(​struct wlr_scene_rect *rect, const float color[]);

Change the color of an existing rectangle node.

wlr_scene_rect_set_size()

void wlr_scene_rect_set_size(​struct wlr_scene_rect *rect, int width, int height);

Change the width and height of an existing rectangle node.

wlr_scene_render_output()

void wlr_scene_render_output(​struct wlr_scene *scene, struct wlr_output *output, int lx, int ly, pixman_region32_t *damage);

Manually render the scene-graph on an output. The compositor needs to call wlr_renderer_begin before and wlr_renderer_end after calling this function. Damage is given in output-buffer-local coordinates and can be set to NULL to disable damage tracking.

wlr_scene_set_presentation()

void wlr_scene_set_presentation(​struct wlr_scene *scene, struct wlr_presentation *presentation);

Handle presentation feedback for all surfaces in the scene, assuming that scene outputs and the scene rendering functions are used.

Asserts that a wlr_presentation hasn't already been set for the scene.

wlr_scene_subsurface_tree_create()

struct wlr_scene_node *wlr_scene_subsurface_tree_create(​struct wlr_scene_node *parent, struct wlr_surface *surface);

Add a node displaying a surface and all of its sub-surfaces to the scene-graph.

struct wlr_scene_surface

struct wlr_scene_surface {
	struct wlr_scene_node node;
	struct wlr_surface *surface;
	struct wlr_output *primary_output;
	int prev_width, prev_height;
	struct wl_listener surface_destroy;
	struct wl_listener surface_commit;
};

A scene-graph node displaying a single surface.

wlr_scene_surface_create()

struct wlr_scene_surface *wlr_scene_surface_create(​struct wlr_scene_node *parent, struct wlr_surface *surface);

Add a node displaying a single surface to the scene-graph.

The child sub-surfaces are ignored.

wlr_surface_send_enter()/wlr_surface_send_leave() will be called automatically based on the position of the surface and outputs in the scene.

wlr_scene_surface_from_node()

struct wlr_scene_surface *wlr_scene_surface_from_node(​struct wlr_scene_node *node);

struct wlr_scene_tree

struct wlr_scene_tree {
	struct wlr_scene_node node;
};

A sub-tree in the scene-graph.

wlr_scene_tree_create()

struct wlr_scene_tree *wlr_scene_tree_create(​struct wlr_scene_node *parent);

Add a node displaying nothing but its children.

wlr_scene_xdg_surface_create()

struct wlr_scene_node *wlr_scene_xdg_surface_create(​struct wlr_scene_node *parent, struct wlr_xdg_surface *xdg_surface);

Add a node displaying an xdg_surface and all of its sub-surfaces to the scene-graph.

The origin of the returned scene-graph node will match the top-left corner of the xdg_surface window geometry.

struct wlr_screencopy_frame_v1

struct wlr_screencopy_frame_v1 {
	struct wl_resource *resource;
	struct wlr_screencopy_v1_client *client;
	struct wl_list link;
	enum wl_shm_format format;
	uint32_t fourcc;
	struct wlr_box box;
	int stride;
	bool overlay_cursor, cursor_locked;
	bool with_damage;
	struct wl_shm_buffer *shm_buffer;
	struct wlr_dmabuf_v1_buffer *dma_buffer;
	struct wl_listener buffer_destroy;
	struct wlr_output *output;
	struct wl_listener output_commit;
	struct wl_listener output_destroy;
	struct wl_listener output_enable;
	void *data;
};

struct wlr_screencopy_manager_v1

struct wlr_screencopy_manager_v1 {
	struct wl_global *global;
	struct wl_list frames;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_screencopy_manager_v1_create()

struct wlr_screencopy_manager_v1 *wlr_screencopy_manager_v1_create(​struct wl_display *display);

struct wlr_screencopy_v1_client

struct wlr_screencopy_v1_client {
	int ref;
	struct wlr_screencopy_manager_v1 *manager;
	struct wl_list damages;
};

struct wlr_seat

struct wlr_seat;

wlr_seat_request_set_primary_selection()

void wlr_seat_request_set_primary_selection(​struct wlr_seat *seat, struct wlr_seat_client *client, struct wlr_primary_selection_source *source, uint32_t serial);

Request setting the primary selection. If `client` is not null, then the serial will be checked against the set of serials sent to the client on that seat.

wlr_seat_request_set_selection()

void wlr_seat_request_set_selection(​struct wlr_seat *seat, struct wlr_seat_client *client, struct wlr_data_source *source, uint32_t serial);

Requests a selection to be set for the seat. If the request comes from a client, then set `client` to be the matching seat client so that this function can verify that the serial provided was once sent to the client on this seat.

wlr_seat_request_start_drag()

void wlr_seat_request_start_drag(​struct wlr_seat *seat, struct wlr_drag *drag, struct wlr_surface *origin, uint32_t serial);

Requests a drag to be started on the seat.

wlr_seat_set_primary_selection()

void wlr_seat_set_primary_selection(​struct wlr_seat *seat, struct wlr_primary_selection_source *source, uint32_t serial);

Sets the current primary selection for the seat. NULL can be provided to clear it. This removes the previous one if there was any. In case the selection doesn't come from a client, wl_display_next_serial() can be used to generate a serial.

wlr_seat_set_selection()

void wlr_seat_set_selection(​struct wlr_seat *seat, struct wlr_data_source *source, uint32_t serial);

Sets the current selection for the seat. NULL can be provided to clear it. This removes the previous one if there was any. In case the selection doesn't come from a client, wl_display_next_serial() can be used to generate a serial.

wlr_seat_start_drag()

void wlr_seat_start_drag(​struct wlr_seat *seat, struct wlr_drag *drag, uint32_t serial);

Starts a drag on the seat. This starts an implicit keyboard grab, but doesn't start a pointer or a touch grab.

wlr_seat_start_pointer_drag()

void wlr_seat_start_pointer_drag(​struct wlr_seat *seat, struct wlr_drag *drag, uint32_t serial);

Starts a pointer drag on the seat. This starts implicit keyboard and pointer grabs.

wlr_seat_start_touch_drag()

void wlr_seat_start_touch_drag(​struct wlr_seat *seat, struct wlr_drag *drag, uint32_t serial, struct wlr_touch_point *point);

Starts a touch drag on the seat. This starts implicit keyboard and touch grabs.

wlr_send_tablet_v2_tablet_pad_button()

void wlr_send_tablet_v2_tablet_pad_button(​struct wlr_tablet_v2_tablet_pad *pad, size_t button, uint32_t time, enum zwp_tablet_pad_v2_button_state state);

wlr_send_tablet_v2_tablet_pad_enter()

uint32_t wlr_send_tablet_v2_tablet_pad_enter(​struct wlr_tablet_v2_tablet_pad *pad, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);

wlr_send_tablet_v2_tablet_pad_leave()

uint32_t wlr_send_tablet_v2_tablet_pad_leave(​struct wlr_tablet_v2_tablet_pad *pad, struct wlr_surface *surface);

wlr_send_tablet_v2_tablet_pad_mode()

uint32_t wlr_send_tablet_v2_tablet_pad_mode(​struct wlr_tablet_v2_tablet_pad *pad, size_t group, uint32_t mode, uint32_t time);

wlr_send_tablet_v2_tablet_pad_ring()

void wlr_send_tablet_v2_tablet_pad_ring(​struct wlr_tablet_v2_tablet_pad *pad, uint32_t ring, double position, bool finger, uint32_t time);

wlr_send_tablet_v2_tablet_pad_strip()

void wlr_send_tablet_v2_tablet_pad_strip(​struct wlr_tablet_v2_tablet_pad *pad, uint32_t strip, double position, bool finger, uint32_t time);

wlr_send_tablet_v2_tablet_tool_button()

void wlr_send_tablet_v2_tablet_tool_button(​struct wlr_tablet_v2_tablet_tool *tool, uint32_t button, enum zwp_tablet_pad_v2_button_state state);

wlr_send_tablet_v2_tablet_tool_distance()

void wlr_send_tablet_v2_tablet_tool_distance(​struct wlr_tablet_v2_tablet_tool *tool, double distance);

wlr_send_tablet_v2_tablet_tool_down()

void wlr_send_tablet_v2_tablet_tool_down(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_send_tablet_v2_tablet_tool_motion()

void wlr_send_tablet_v2_tablet_tool_motion(​struct wlr_tablet_v2_tablet_tool *tool, double x, double y);

wlr_send_tablet_v2_tablet_tool_pressure()

void wlr_send_tablet_v2_tablet_tool_pressure(​struct wlr_tablet_v2_tablet_tool *tool, double pressure);

wlr_send_tablet_v2_tablet_tool_proximity_in()

void wlr_send_tablet_v2_tablet_tool_proximity_in(​struct wlr_tablet_v2_tablet_tool *tool, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);

wlr_send_tablet_v2_tablet_tool_proximity_out()

void wlr_send_tablet_v2_tablet_tool_proximity_out(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_send_tablet_v2_tablet_tool_rotation()

void wlr_send_tablet_v2_tablet_tool_rotation(​struct wlr_tablet_v2_tablet_tool *tool, double degrees);

wlr_send_tablet_v2_tablet_tool_slider()

void wlr_send_tablet_v2_tablet_tool_slider(​struct wlr_tablet_v2_tablet_tool *tool, double position);

wlr_send_tablet_v2_tablet_tool_tilt()

void wlr_send_tablet_v2_tablet_tool_tilt(​struct wlr_tablet_v2_tablet_tool *tool, double x, double y);

wlr_send_tablet_v2_tablet_tool_up()

void wlr_send_tablet_v2_tablet_tool_up(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_send_tablet_v2_tablet_tool_wheel()

void wlr_send_tablet_v2_tablet_tool_wheel(​struct wlr_tablet_v2_tablet_tool *tool, double degrees, int32_t clicks);

struct wlr_server_decoration

struct wlr_server_decoration {
	struct wl_resource *resource;
	struct wlr_surface *surface;
	struct wl_list link;
	uint32_t mode;
	struct {
		struct wl_signal destroy;
		struct wl_signal mode;
	} events;
	struct wl_listener surface_destroy_listener;
	void *data;
};

struct wlr_server_decoration_manager

struct wlr_server_decoration_manager {
	struct wl_global *global;
	struct wl_list resources;
	struct wl_list decorations;
	uint32_t default_mode;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_decoration;
		struct wl_signal destroy;
	} events;
	void *data;
};

A decoration negotiation interface which implements the KDE protocol.

wlr_server_decoration_manager_create()

struct wlr_server_decoration_manager *wlr_server_decoration_manager_create(​struct wl_display *display);

enum wlr_server_decoration_manager_mode

enum wlr_server_decoration_manager_mode {
	WLR_SERVER_DECORATION_MANAGER_MODE_NONE,
	WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT,
	WLR_SERVER_DECORATION_MANAGER_MODE_SERVER,
};

Possible values to use in request_mode and the event mode. Same as org_kde_kwin_server_decoration_manager_mode.

wlr_server_decoration_manager_set_default_mode()

void wlr_server_decoration_manager_set_default_mode(​struct wlr_server_decoration_manager *manager, uint32_t default_mode);

struct wlr_surface

struct wlr_surface;

wlr_surface_accepts_tablet_v2()

bool wlr_surface_accepts_tablet_v2(​struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);

wlr_surface_is_input_popup_surface_v2()

bool wlr_surface_is_input_popup_surface_v2(​struct wlr_surface *surface);

wlr_surface_is_layer_surface()

bool wlr_surface_is_layer_surface(​struct wlr_surface *surface);

wlr_surface_is_xwayland_surface()

bool wlr_surface_is_xwayland_surface(​struct wlr_surface *surface);

wlr_switch_destroy()

void wlr_switch_destroy(​struct wlr_switch *switch_device);

struct wlr_switch_impl

struct wlr_switch_impl {
	void (*destroy)(​struct wlr_switch *switch_device);
};

wlr_switch_init()

void wlr_switch_init(​struct wlr_switch *switch_device, struct wlr_switch_impl *impl);

struct wlr_tablet_client_v2

struct wlr_tablet_client_v2;

wlr_tablet_create()

struct wlr_tablet_v2_tablet *wlr_tablet_create(​struct wlr_tablet_manager_v2 *manager, struct wlr_seat *wlr_seat, struct wlr_input_device *wlr_device);

wlr_tablet_destroy()

void wlr_tablet_destroy(​struct wlr_tablet *tablet);

struct wlr_tablet_impl

struct wlr_tablet_impl {
	void (*destroy)(​struct wlr_tablet *tablet);
};

wlr_tablet_init()

void wlr_tablet_init(​struct wlr_tablet *tablet, const struct wlr_tablet_impl *impl);

struct wlr_tablet_manager_v2

struct wlr_tablet_manager_v2 {
	struct wl_global *wl_global;
	struct wl_list clients;
	struct wl_list seats;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

struct wlr_tablet_pad_client_v2

struct wlr_tablet_pad_client_v2;

wlr_tablet_pad_create()

struct wlr_tablet_v2_tablet_pad *wlr_tablet_pad_create(​struct wlr_tablet_manager_v2 *manager, struct wlr_seat *wlr_seat, struct wlr_input_device *wlr_device);

wlr_tablet_pad_destroy()

void wlr_tablet_pad_destroy(​struct wlr_tablet_pad *pad);

struct wlr_tablet_pad_impl

struct wlr_tablet_pad_impl {
	void (*destroy)(​struct wlr_tablet_pad *pad);
};

wlr_tablet_pad_init()

void wlr_tablet_pad_init(​struct wlr_tablet_pad *pad, struct wlr_tablet_pad_impl *impl);

struct wlr_tablet_pad_v2_grab

struct wlr_tablet_pad_v2_grab {
	const struct wlr_tablet_pad_v2_grab_interface *interface;
	struct wlr_tablet_v2_tablet_pad *pad;
	void *data;
};

struct wlr_tablet_pad_v2_grab_interface

struct wlr_tablet_pad_v2_grab_interface {
	uint32_t (*enter)(​struct wlr_tablet_pad_v2_grab *grab, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);
	void (*button)(​struct wlr_tablet_pad_v2_grab *grab, size_t button, uint32_t time, enum zwp_tablet_pad_v2_button_state state);
	void (*strip)(​struct wlr_tablet_pad_v2_grab *grab, uint32_t strip, double position, bool finger, uint32_t time);
	void (*ring)(​struct wlr_tablet_pad_v2_grab *grab, uint32_t ring, double position, bool finger, uint32_t time);
	uint32_t (*leave)(​struct wlr_tablet_pad_v2_grab *grab, struct wlr_surface *surface);
	uint32_t (*mode)(​struct wlr_tablet_pad_v2_grab *grab, size_t group, uint32_t mode, uint32_t time);
	void (*cancel)(​struct wlr_tablet_pad_v2_grab *grab);
};

struct wlr_tablet_tool_client_v2

struct wlr_tablet_tool_client_v2;

wlr_tablet_tool_create()

struct wlr_tablet_v2_tablet_tool *wlr_tablet_tool_create(​struct wlr_tablet_manager_v2 *manager, struct wlr_seat *wlr_seat, struct wlr_tablet_tool *wlr_tool);

wlr_tablet_tool_v2_end_grab()

void wlr_tablet_tool_v2_end_grab(​struct wlr_tablet_v2_tablet_tool *tool);

struct wlr_tablet_tool_v2_grab

struct wlr_tablet_tool_v2_grab {
	const struct wlr_tablet_tool_v2_grab_interface *interface;
	struct wlr_tablet_v2_tablet_tool *tool;
	void *data;
};

struct wlr_tablet_tool_v2_grab_interface

struct wlr_tablet_tool_v2_grab_interface {
	void (*proximity_in)(​struct wlr_tablet_tool_v2_grab *grab, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);
	void (*down)(​struct wlr_tablet_tool_v2_grab *grab);
	void (*up)(​struct wlr_tablet_tool_v2_grab *grab);
	void (*motion)(​struct wlr_tablet_tool_v2_grab *grab, double x, double y);
	void (*pressure)(​struct wlr_tablet_tool_v2_grab *grab, double pressure);
	void (*distance)(​struct wlr_tablet_tool_v2_grab *grab, double distance);
	void (*tilt)(​struct wlr_tablet_tool_v2_grab *grab, double x, double y);
	void (*rotation)(​struct wlr_tablet_tool_v2_grab *grab, double degrees);
	void (*slider)(​struct wlr_tablet_tool_v2_grab *grab, double position);
	void (*wheel)(​struct wlr_tablet_tool_v2_grab *grab, double degrees, int32_t clicks);
	void (*proximity_out)(​struct wlr_tablet_tool_v2_grab *grab);
	void (*button)(​struct wlr_tablet_tool_v2_grab *grab, uint32_t button, enum zwp_tablet_pad_v2_button_state state);
	void (*cancel)(​struct wlr_tablet_tool_v2_grab *grab);
};

wlr_tablet_tool_v2_has_implicit_grab()

bool wlr_tablet_tool_v2_has_implicit_grab(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_tablet_tool_v2_start_grab()

void wlr_tablet_tool_v2_start_grab(​struct wlr_tablet_v2_tablet_tool *tool, struct wlr_tablet_tool_v2_grab *grab);

wlr_tablet_tool_v2_start_implicit_grab()

void wlr_tablet_tool_v2_start_implicit_grab(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_tablet_v2_create()

struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(​struct wl_display *display);

wlr_tablet_v2_end_grab()

void wlr_tablet_v2_end_grab(​struct wlr_tablet_v2_tablet_pad *pad);

struct wlr_tablet_v2_event_cursor

struct wlr_tablet_v2_event_cursor {
	struct wlr_surface *surface;
	uint32_t serial;
	int32_t hotspot_x;
	int32_t hotspot_y;
	struct wlr_seat_client *seat_client;
};

struct wlr_tablet_v2_event_feedback

struct wlr_tablet_v2_event_feedback {
	const char *description;
	size_t index;
	uint32_t serial;
};

wlr_tablet_v2_start_grab()

void wlr_tablet_v2_start_grab(​struct wlr_tablet_v2_tablet_pad *pad, struct wlr_tablet_pad_v2_grab *grab);

struct wlr_tablet_v2_tablet

struct wlr_tablet_v2_tablet {
	struct wl_list link;
	struct wlr_tablet *wlr_tablet;
	struct wlr_input_device *wlr_device;
	struct wl_list clients;
	struct wl_listener tool_destroy;
	struct wlr_tablet_client_v2 *current_client;
};

struct wlr_tablet_v2_tablet_pad

struct wlr_tablet_v2_tablet_pad {
	struct wl_list link;
	struct wlr_tablet_pad *wlr_pad;
	struct wlr_input_device *wlr_device;
	struct wl_list clients;
	size_t group_count;
	uint32_t *groups;
	struct wl_listener pad_destroy;
	struct wlr_tablet_pad_client_v2 *current_client;
	struct wlr_tablet_pad_v2_grab *grab;
	struct wlr_tablet_pad_v2_grab default_grab;
	struct {
		struct wl_signal button_feedback;
		struct wl_signal strip_feedback;
		struct wl_signal ring_feedback;
	} events;
};

wlr_tablet_v2_tablet_pad_notify_button()

void wlr_tablet_v2_tablet_pad_notify_button(​struct wlr_tablet_v2_tablet_pad *pad, size_t button, uint32_t time, enum zwp_tablet_pad_v2_button_state state);

wlr_tablet_v2_tablet_pad_notify_enter()

uint32_t wlr_tablet_v2_tablet_pad_notify_enter(​struct wlr_tablet_v2_tablet_pad *pad, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);

wlr_tablet_v2_tablet_pad_notify_leave()

uint32_t wlr_tablet_v2_tablet_pad_notify_leave(​struct wlr_tablet_v2_tablet_pad *pad, struct wlr_surface *surface);

wlr_tablet_v2_tablet_pad_notify_mode()

uint32_t wlr_tablet_v2_tablet_pad_notify_mode(​struct wlr_tablet_v2_tablet_pad *pad, size_t group, uint32_t mode, uint32_t time);

wlr_tablet_v2_tablet_pad_notify_ring()

void wlr_tablet_v2_tablet_pad_notify_ring(​struct wlr_tablet_v2_tablet_pad *pad, uint32_t ring, double position, bool finger, uint32_t time);

wlr_tablet_v2_tablet_pad_notify_strip()

void wlr_tablet_v2_tablet_pad_notify_strip(​struct wlr_tablet_v2_tablet_pad *pad, uint32_t strip, double position, bool finger, uint32_t time);

struct wlr_tablet_v2_tablet_tool

struct wlr_tablet_v2_tablet_tool {
	struct wl_list link;
	struct wlr_tablet_tool *wlr_tool;
	struct wl_list clients;
	struct wl_listener tool_destroy;
	struct wlr_tablet_tool_client_v2 *current_client;
	struct wlr_surface *focused_surface;
	struct wl_listener surface_destroy;
	struct wlr_tablet_tool_v2_grab *grab;
	struct wlr_tablet_tool_v2_grab default_grab;
	uint32_t proximity_serial;
	bool is_down;
	uint32_t down_serial;
	size_t num_buttons;
	uint32_t pressed_buttons[];
	uint32_t pressed_serials[];
	struct {
		struct wl_signal set_cursor;
	} events;
};

wlr_tablet_v2_tablet_tool_notify_button()

void wlr_tablet_v2_tablet_tool_notify_button(​struct wlr_tablet_v2_tablet_tool *tool, uint32_t button, enum zwp_tablet_pad_v2_button_state state);

wlr_tablet_v2_tablet_tool_notify_distance()

void wlr_tablet_v2_tablet_tool_notify_distance(​struct wlr_tablet_v2_tablet_tool *tool, double distance);

wlr_tablet_v2_tablet_tool_notify_down()

void wlr_tablet_v2_tablet_tool_notify_down(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_tablet_v2_tablet_tool_notify_motion()

void wlr_tablet_v2_tablet_tool_notify_motion(​struct wlr_tablet_v2_tablet_tool *tool, double x, double y);

wlr_tablet_v2_tablet_tool_notify_pressure()

void wlr_tablet_v2_tablet_tool_notify_pressure(​struct wlr_tablet_v2_tablet_tool *tool, double pressure);

wlr_tablet_v2_tablet_tool_notify_proximity_in()

void wlr_tablet_v2_tablet_tool_notify_proximity_in(​struct wlr_tablet_v2_tablet_tool *tool, struct wlr_tablet_v2_tablet *tablet, struct wlr_surface *surface);

wlr_tablet_v2_tablet_tool_notify_proximity_out()

void wlr_tablet_v2_tablet_tool_notify_proximity_out(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_tablet_v2_tablet_tool_notify_rotation()

void wlr_tablet_v2_tablet_tool_notify_rotation(​struct wlr_tablet_v2_tablet_tool *tool, double degrees);

wlr_tablet_v2_tablet_tool_notify_slider()

void wlr_tablet_v2_tablet_tool_notify_slider(​struct wlr_tablet_v2_tablet_tool *tool, double position);

wlr_tablet_v2_tablet_tool_notify_tilt()

void wlr_tablet_v2_tablet_tool_notify_tilt(​struct wlr_tablet_v2_tablet_tool *tool, double x, double y);

wlr_tablet_v2_tablet_tool_notify_up()

void wlr_tablet_v2_tablet_tool_notify_up(​struct wlr_tablet_v2_tablet_tool *tool);

wlr_tablet_v2_tablet_tool_notify_wheel()

void wlr_tablet_v2_tablet_tool_notify_wheel(​struct wlr_tablet_v2_tablet_tool *tool, double degrees, int32_t clicks);

struct wlr_text_input_manager_v3

struct wlr_text_input_manager_v3 {
	struct wl_global *global;
	struct wl_list text_inputs;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal text_input;
		struct wl_signal destroy;
	} events;
};

wlr_text_input_manager_v3_create()

struct wlr_text_input_manager_v3 *wlr_text_input_manager_v3_create(​struct wl_display *wl_display);

struct wlr_text_input_v3

struct wlr_text_input_v3 {
	struct wlr_seat *seat;
	struct wl_resource *resource;
	struct wlr_surface *focused_surface;
	struct wlr_text_input_v3_state pending;
	struct wlr_text_input_v3_state current;
	uint32_t current_serial;
	bool pending_enabled;
	bool current_enabled;
	uint32_t active_features;
	struct wl_list link;
	struct wl_listener surface_destroy;
	struct wl_listener seat_destroy;
	struct {
		struct wl_signal enable;
		struct wl_signal commit;
		struct wl_signal disable;
		struct wl_signal destroy;
	} events;
};

enum wlr_text_input_v3_features

enum wlr_text_input_v3_features {
	WLR_TEXT_INPUT_V3_FEATURE_SURROUNDING_TEXT,
	WLR_TEXT_INPUT_V3_FEATURE_CONTENT_TYPE,
	WLR_TEXT_INPUT_V3_FEATURE_CURSOR_RECTANGLE,
};

wlr_text_input_v3_send_commit_string()

void wlr_text_input_v3_send_commit_string(​struct wlr_text_input_v3 *text_input, const char *text);

wlr_text_input_v3_send_delete_surrounding_text()

void wlr_text_input_v3_send_delete_surrounding_text(​struct wlr_text_input_v3 *text_input, uint32_t before_length, uint32_t after_length);

wlr_text_input_v3_send_done()

void wlr_text_input_v3_send_done(​struct wlr_text_input_v3 *text_input);

wlr_text_input_v3_send_enter()

void wlr_text_input_v3_send_enter(​struct wlr_text_input_v3 *text_input, struct wlr_surface *wlr_surface);

wlr_text_input_v3_send_leave()

void wlr_text_input_v3_send_leave(​struct wlr_text_input_v3 *text_input);

wlr_text_input_v3_send_preedit_string()

void wlr_text_input_v3_send_preedit_string(​struct wlr_text_input_v3 *text_input, const char *text, int32_t cursor_begin, int32_t cursor_end);

struct wlr_text_input_v3_state

struct wlr_text_input_v3_state {
	struct {
		char *text;
		uint32_t cursor;
		uint32_t anchor;
	} surrounding;
	uint32_t text_change_cause;
	struct {
		uint32_t hint;
		uint32_t purpose;
	} content_type;
	struct wlr_box cursor_rectangle;
	uint32_t features;
};

struct wlr_texture_impl

struct wlr_texture_impl {
	bool (*is_opaque)(​struct wlr_texture *texture);
	bool (*write_pixels)(​struct wlr_texture *texture, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, const void *data);
	void (*destroy)(​struct wlr_texture *texture);
};

wlr_texture_init()

void wlr_texture_init(​struct wlr_texture *texture, const struct wlr_texture_impl *impl, uint32_t width, uint32_t height);

wlr_texture_is_gles2()

bool wlr_texture_is_gles2(​struct wlr_texture *texture);

wlr_texture_is_pixman()

bool wlr_texture_is_pixman(​struct wlr_texture *texture);

wlr_texture_is_vk()

bool wlr_texture_is_vk(​struct wlr_texture *texture);

wlr_touch_destroy()

void wlr_touch_destroy(​struct wlr_touch *touch);

struct wlr_touch_impl

struct wlr_touch_impl {
	void (*destroy)(​struct wlr_touch *touch);
};

wlr_touch_init()

void wlr_touch_init(​struct wlr_touch *touch, const struct wlr_touch_impl *impl);

struct wlr_viewporter

struct wlr_viewporter {
	struct wl_global *global;
	struct {
		struct wl_signal destroy;
	} events;
	struct wl_listener display_destroy;
};

Implementation for the viewporter protocol.

When enabling viewporter, compositors need to update their rendering logic:

- The size of the surface texture may not match the surface size anymore. Compositors must use the surface size only. - Compositors must call wlr_render_subtexture_with_matrix when rendering a surface texture with the source box returned by wlr_surface_get_buffer_source_box.

wlr_viewporter_create()

struct wlr_viewporter *wlr_viewporter_create(​struct wl_display *display);

struct wlr_virtual_keyboard_manager_v1

struct wlr_virtual_keyboard_manager_v1 {
	struct wl_global *global;
	struct wl_list virtual_keyboards;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_virtual_keyboard;
		struct wl_signal destroy;
	} events;
};

wlr_virtual_keyboard_manager_v1_create()

struct wlr_virtual_keyboard_manager_v1 *wlr_virtual_keyboard_manager_v1_create(​struct wl_display *display);

struct wlr_virtual_keyboard_v1

struct wlr_virtual_keyboard_v1 {
	struct wlr_input_device input_device;
	struct wl_resource *resource;
	struct wlr_seat *seat;
	bool has_keymap;
	struct wl_list link;
	struct {
		struct wl_signal destroy;
	} events;
};

struct wlr_virtual_pointer_manager_v1

struct wlr_virtual_pointer_manager_v1 {
	struct wl_global *global;
	struct wl_list virtual_pointers;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_virtual_pointer;
		struct wl_signal destroy;
	} events;
};

wlr_virtual_pointer_manager_v1_create()

struct wlr_virtual_pointer_manager_v1 *wlr_virtual_pointer_manager_v1_create(​struct wl_display *display);

struct wlr_virtual_pointer_v1

struct wlr_virtual_pointer_v1 {
	struct wlr_input_device input_device;
	struct wl_resource *resource;
	struct wlr_event_pointer_axis axis_event[];
	enum wl_pointer_axis axis;
	bool axis_valid[];
	struct wl_list link;
	struct {
		struct wl_signal destroy;
	} events;
};

struct wlr_virtual_pointer_v1_new_pointer_event

struct wlr_virtual_pointer_v1_new_pointer_event {
	struct wlr_virtual_pointer_v1 *new_pointer;
	struct wlr_seat *suggested_seat;
	struct wlr_output *suggested_output;
};

wlr_vk_renderer_create_with_drm_fd()

struct wlr_renderer *wlr_vk_renderer_create_with_drm_fd(​int drm_fd);

wlr_wl_backend_create()

struct wlr_backend *wlr_wl_backend_create(​struct wl_display *display, const char *remote);

Creates a new wlr_wl_backend. This backend will be created with no outputs; you must use wlr_wl_output_create to add them.

The `remote` argument is the name of the host compositor wayland socket. Set to NULL for the default behaviour (WAYLAND_DISPLAY env variable or wayland-0 default)

wlr_wl_backend_get_remote_display()

struct wl_display *wlr_wl_backend_get_remote_display(​struct wlr_backend *backend);

Returns the remote wl_display used by the Wayland backend.

wlr_wl_input_device_get_seat()

struct wl_seat *wlr_wl_input_device_get_seat(​struct wlr_input_device *dev);

Returns the remote wl_seat for a Wayland input device.

wlr_wl_output_create()

struct wlr_output *wlr_wl_output_create(​struct wlr_backend *backend);

Adds a new output to this backend. You may remove outputs by destroying them. Note that if called before initializing the backend, this will return NULL and your outputs will be created during initialization (and given to you via the output_add signal).

wlr_wl_output_get_surface()

struct wl_surface *wlr_wl_output_get_surface(​struct wlr_output *output);

Returns the remote wl_surface used by the Wayland output.

wlr_wl_output_set_title()

void wlr_wl_output_set_title(​struct wlr_output *output, const char *title);

Sets the title of a wlr_output which is a Wayland window.

wlr_x11_backend_create()

struct wlr_backend *wlr_x11_backend_create(​struct wl_display *display, const char *x11_display);

Creates a new wlr_x11_backend. This backend will be created with no outputs; you must use wlr_x11_output_create to add them.

The `x11_display` argument is the name of the X Display socket. Set to NULL for the default behaviour of XOpenDisplay.

wlr_x11_output_create()

struct wlr_output *wlr_x11_output_create(​struct wlr_backend *backend);

Adds a new output to this backend. You may remove outputs by destroying them. Note that if called before initializing the backend, this will return NULL and your outputs will be created during initialization (and given to you via the output_add signal).

wlr_x11_output_set_title()

void wlr_x11_output_set_title(​struct wlr_output *output, const char *title);

Sets the title of a wlr_output which is an X11 window.

struct wlr_xcursor

struct wlr_xcursor {
	unsigned int image_count;
	struct wlr_xcursor_image **images;
	char *name;
	uint32_t total_delay;
};

A cursor.

If the cursor is animated, it may contain more than a single image.

wlr_xcursor_frame()

int wlr_xcursor_frame(​struct wlr_xcursor *cursor, uint32_t time);

Find the frame for a given elapsed time in a cursor animation.

This function converts a timestamp (in ms) to a cursor image index.

struct wlr_xcursor_image

struct wlr_xcursor_image {
	uint32_t width;
	uint32_t height;
	uint32_t hotspot_x;
	uint32_t hotspot_y;
	uint32_t delay;
	uint8_t *buffer;
};

A still cursor image.

The buffer contains pixels layed out in a packed DRM_FORMAT_ARGB8888 format.

struct wlr_xcursor_manager

struct wlr_xcursor_manager {
	char *name;
	uint32_t size;
	struct wl_list scaled_themes;
};

wlr_xcursor_manager dynamically loads xcursor themes at sizes necessary for use on outputs at arbitrary scale factors. You should call wlr_xcursor_manager_load for each output you will show your cursor on, with the scale factor parameter set to that output's scale factor.

wlr_xcursor_manager_create()

struct wlr_xcursor_manager *wlr_xcursor_manager_create(​const char *name, uint32_t size);

Creates a new XCursor manager with the given xcursor theme name and base size (for use when scale=1).

wlr_xcursor_manager_destroy()

void wlr_xcursor_manager_destroy(​struct wlr_xcursor_manager *manager);

wlr_xcursor_manager_get_xcursor()

struct wlr_xcursor *wlr_xcursor_manager_get_xcursor(​struct wlr_xcursor_manager *manager, const char *name, float scale);

Retrieves a wlr_xcursor reference for the given cursor name at the given scale factor, or NULL if this wlr_xcursor_manager has not loaded a cursor theme at the requested scale.

wlr_xcursor_manager_load()

bool wlr_xcursor_manager_load(​struct wlr_xcursor_manager *manager, float scale);

Ensures an xcursor theme at the given scale factor is loaded in the manager.

wlr_xcursor_manager_set_cursor_image()

void wlr_xcursor_manager_set_cursor_image(​struct wlr_xcursor_manager *manager, const char *name, struct wlr_cursor *cursor);

Set a wlr_cursor's cursor image to the specified cursor name for all scale factors. wlr_cursor will take over from this point and ensure the correct cursor is used on each output, assuming a wlr_output_layout is attached to it.

struct wlr_xcursor_manager_theme

struct wlr_xcursor_manager_theme {
	float scale;
	struct wlr_xcursor_theme *theme;
	struct wl_list link;
};

An XCursor theme at a particular scale factor of the base size.

struct wlr_xcursor_theme

struct wlr_xcursor_theme {
	unsigned int cursor_count;
	struct wlr_xcursor **cursors;
	char *name;
	int size;
};

Container for an Xcursor theme.

wlr_xcursor_theme_destroy()

void wlr_xcursor_theme_destroy(​struct wlr_xcursor_theme *theme);

Destroy a cursor theme.

This implicitly destroys all child cursors and cursor images.

wlr_xcursor_theme_get_cursor()

struct wlr_xcursor *wlr_xcursor_theme_get_cursor(​struct wlr_xcursor_theme *theme, const char *name);

Obtain a cursor for the specified name (e.g. "left_ptr").

If the cursor could not be found, NULL is returned.

wlr_xcursor_theme_load()

struct wlr_xcursor_theme *wlr_xcursor_theme_load(​const char *name, int size);

Loads the named Xcursor theme.

This is useful if you need cursor images for your compositor to use when a client-side cursor is not available or you wish to override client-side cursors for a particular UI interaction (such as using a grab cursor when moving a window around).

The size is given in pixels.

If a cursor theme with the given name couldn't be loaded, a fallback theme is loaded.

On error, NULL is returned.

struct wlr_xdg_activation_token_v1

struct wlr_xdg_activation_token_v1 {
	struct wlr_xdg_activation_v1 *activation;
	struct wlr_surface *surface;
	struct wlr_seat *seat;
	uint32_t serial;
	char *app_id;
	struct wl_list link;
	void *data;
	struct {
		struct wl_signal destroy;
	} events;
	char *token;
	struct wl_resource *resource;
	struct wl_event_source *timeout;
	struct wl_listener seat_destroy;
	struct wl_listener surface_destroy;
};

wlr_xdg_activation_token_v1_create()

struct wlr_xdg_activation_token_v1 *wlr_xdg_activation_token_v1_create(​struct wlr_xdg_activation_v1 *activation);

wlr_xdg_activation_token_v1_destroy()

void wlr_xdg_activation_token_v1_destroy(​struct wlr_xdg_activation_token_v1 *token);

struct wlr_xdg_activation_v1

struct wlr_xdg_activation_v1 {
	uint32_t token_timeout_msec;
	struct wl_list tokens;
	struct {
		struct wl_signal destroy;
		struct wl_signal request_activate;
	} events;
	struct wl_display *display;
	struct wl_global *global;
	struct wl_listener display_destroy;
};

wlr_xdg_activation_v1_add_token()

struct wlr_xdg_activation_token_v1 *wlr_xdg_activation_v1_add_token(​struct wlr_xdg_activation_v1 *activation, const char *token_str);

wlr_xdg_activation_v1_create()

struct wlr_xdg_activation_v1 *wlr_xdg_activation_v1_create(​struct wl_display *display);

wlr_xdg_activation_v1_find_token()

struct wlr_xdg_activation_token_v1 *wlr_xdg_activation_v1_find_token(​struct wlr_xdg_activation_v1 *activation, const char *token_str);

struct wlr_xdg_activation_v1_request_activate_event

struct wlr_xdg_activation_v1_request_activate_event {
	struct wlr_xdg_activation_v1 *activation;
	struct wlr_xdg_activation_token_v1 *token;
	struct wlr_surface *surface;
};

struct wlr_xdg_decoration_manager_v1

struct wlr_xdg_decoration_manager_v1 {
	struct wl_global *global;
	struct wl_list decorations;
	struct wl_listener display_destroy;
	struct {
		struct wl_signal new_toplevel_decoration;
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_xdg_decoration_manager_v1_create()

struct wlr_xdg_decoration_manager_v1 *wlr_xdg_decoration_manager_v1_create(​struct wl_display *display);

struct wlr_xdg_exported_v1

struct wlr_xdg_exported_v1 {
	struct wlr_xdg_foreign_exported base;
	struct wl_resource *resource;
	struct wl_listener xdg_surface_destroy;
	struct wl_list link;
};

struct wlr_xdg_exported_v2

struct wlr_xdg_exported_v2 {
	struct wlr_xdg_foreign_exported base;
	struct wl_resource *resource;
	struct wl_listener xdg_surface_destroy;
	struct wl_list link;
};

struct wlr_xdg_foreign_v1

struct wlr_xdg_foreign_v1 {
	struct {
		struct wl_global *global;
		struct wl_list objects;
	} exporter, importer;
	struct wl_listener foreign_registry_destroy;
	struct wl_listener display_destroy;
	struct wlr_xdg_foreign_registry *registry;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_xdg_foreign_v1_create()

struct wlr_xdg_foreign_v1 *wlr_xdg_foreign_v1_create(​struct wl_display *display, struct wlr_xdg_foreign_registry *registry);

struct wlr_xdg_foreign_v2

struct wlr_xdg_foreign_v2 {
	struct {
		struct wl_global *global;
		struct wl_list objects;
	} exporter, importer;
	struct wl_listener foreign_registry_destroy;
	struct wl_listener display_destroy;
	struct wlr_xdg_foreign_registry *registry;
	struct {
		struct wl_signal destroy;
	} events;
	void *data;
};

wlr_xdg_foreign_v2_create()

struct wlr_xdg_foreign_v2 *wlr_xdg_foreign_v2_create(​struct wl_display *display, struct wlr_xdg_foreign_registry *registry);

struct wlr_xdg_imported_child_v1

struct wlr_xdg_imported_child_v1 {
	struct wlr_xdg_imported_v1 *imported;
	struct wlr_surface *surface;
	struct wl_list link;
	struct wl_listener xdg_surface_unmap;
	struct wl_listener xdg_toplevel_set_parent;
};

struct wlr_xdg_imported_child_v2

struct wlr_xdg_imported_child_v2 {
	struct wlr_xdg_imported_v2 *imported;
	struct wlr_surface *surface;
	struct wl_list link;
	struct wl_listener xdg_surface_unmap;
	struct wl_listener xdg_toplevel_set_parent;
};

struct wlr_xdg_imported_v1

struct wlr_xdg_imported_v1 {
	struct wlr_xdg_foreign_exported *exported;
	struct wl_listener exported_destroyed;
	struct wl_resource *resource;
	struct wl_list link;
	struct wl_list children;
};

struct wlr_xdg_imported_v2

struct wlr_xdg_imported_v2 {
	struct wlr_xdg_foreign_exported *exported;
	struct wl_listener exported_destroyed;
	struct wl_resource *resource;
	struct wl_list link;
	struct wl_list children;
};

struct wlr_xdg_output_manager_v1

struct wlr_xdg_output_manager_v1 {
	struct wl_global *global;
	struct wlr_output_layout *layout;
	struct wl_list outputs;
	struct {
		struct wl_signal destroy;
	} events;
	struct wl_listener display_destroy;
	struct wl_listener layout_add;
	struct wl_listener layout_change;
	struct wl_listener layout_destroy;
};

wlr_xdg_output_manager_v1_create()

struct wlr_xdg_output_manager_v1 *wlr_xdg_output_manager_v1_create(​struct wl_display *display, struct wlr_output_layout *layout);

struct wlr_xdg_output_v1

struct wlr_xdg_output_v1 {
	struct wlr_xdg_output_manager_v1 *manager;
	struct wl_list resources;
	struct wl_list link;
	struct wlr_output_layout_output *layout_output;
	int32_t x, y;
	int32_t width, height;
	struct wl_listener destroy;
	struct wl_listener description;
};

struct wlr_xdg_surface

struct wlr_xdg_surface;

struct wlr_xdg_toplevel_decoration_v1

struct wlr_xdg_toplevel_decoration_v1 {
	struct wl_resource *resource;
	struct wlr_xdg_surface *surface;
	struct wlr_xdg_decoration_manager_v1 *manager;
	struct wl_list link;
	struct wlr_xdg_toplevel_decoration_v1_state current, pending;
	enum wlr_xdg_toplevel_decoration_v1_mode scheduled_mode;
	enum wlr_xdg_toplevel_decoration_v1_mode requested_mode;
	bool added;
	struct wl_list configure_list;
	struct {
		struct wl_signal destroy;
		struct wl_signal request_mode;
	} events;
	struct wl_listener surface_destroy;
	struct wl_listener surface_configure;
	struct wl_listener surface_ack_configure;
	struct wl_listener surface_commit;
	void *data;
};

struct wlr_xdg_toplevel_decoration_v1_configure

struct wlr_xdg_toplevel_decoration_v1_configure {
	struct wl_list link;
	struct wlr_xdg_surface_configure *surface_configure;
	enum wlr_xdg_toplevel_decoration_v1_mode mode;
};

enum wlr_xdg_toplevel_decoration_v1_mode

enum wlr_xdg_toplevel_decoration_v1_mode {
	WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_NONE,
	WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE,
	WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE,
};

wlr_xdg_toplevel_decoration_v1_set_mode()

uint32_t wlr_xdg_toplevel_decoration_v1_set_mode(​struct wlr_xdg_toplevel_decoration_v1 *decoration, enum wlr_xdg_toplevel_decoration_v1_mode mode);

struct wlr_xdg_toplevel_decoration_v1_state

struct wlr_xdg_toplevel_decoration_v1_state {
	enum wlr_xdg_toplevel_decoration_v1_mode mode;
};

struct wlr_xwayland

struct wlr_xwayland {
	struct wlr_xwayland_server *server;
	struct wlr_xwm *xwm;
	struct wlr_xwayland_cursor *cursor;
	const char *display_name;
	struct wl_display *wl_display;
	struct wlr_compositor *compositor;
	struct wlr_seat *seat;
	struct {
		struct wl_signal ready;
		struct wl_signal new_surface;
		struct wl_signal remove_startup_info;
	} events;
	int (*user_event_handler)(​struct wlr_xwm *xwm, xcb_generic_event_t *event);
	struct wl_listener server_ready;
	struct wl_listener server_destroy;
	struct wl_listener seat_destroy;
	void *data;
};

wlr_xwayland_create()

struct wlr_xwayland *wlr_xwayland_create(​struct wl_display *wl_display, struct wlr_compositor *compositor, bool lazy);

Create an Xwayland server and XWM.

The server supports a lazy mode in which Xwayland is only started when a client tries to connect.

struct wlr_xwayland_cursor

struct wlr_xwayland_cursor;

wlr_xwayland_destroy()

void wlr_xwayland_destroy(​struct wlr_xwayland *wlr_xwayland);

wlr_xwayland_icccm_input_model()

enum wlr_xwayland_icccm_input_model wlr_xwayland_icccm_input_model(​const struct wlr_xwayland_surface *xsurface);

enum wlr_xwayland_icccm_input_model

enum wlr_xwayland_icccm_input_model {
	WLR_ICCCM_INPUT_MODEL_NONE,
	WLR_ICCCM_INPUT_MODEL_PASSIVE,
	WLR_ICCCM_INPUT_MODEL_LOCAL,
	WLR_ICCCM_INPUT_MODEL_GLOBAL,
};

This represents the input focus described as follows:

https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#input_focus

struct wlr_xwayland_minimize_event

struct wlr_xwayland_minimize_event {
	struct wlr_xwayland_surface *surface;
	bool minimize;
};

struct wlr_xwayland_move_event

struct wlr_xwayland_move_event {
	struct wlr_xwayland_surface *surface;
};

wlr_xwayland_or_surface_wants_focus()

bool wlr_xwayland_or_surface_wants_focus(​const struct wlr_xwayland_surface *xsurface);

Metric to guess if an OR window should "receive" focus

In the pure X setups, window managers usually straight up ignore override redirect windows, and never touch them. (we have to handle them for mapping)

When such a window wants to receive keyboard input (e.g. rofi/dzen) it will use mechanics we don't support (sniffing/grabbing input). [Sadly this is unrelated to xwayland-keyboard-grab]

To still support these windows, while keeping general OR semantics as is, we need to hand a subset of windows focus. The dirty truth is, we need to hand focus to any Xwayland window, though pretending this window has focus makes it easier to handle unmap.

This function provides a handy metric based on the window type to guess if the OR window wants focus. It's probably not perfect, nor exactly intended but works in practice.

Returns: true if the window should receive focus false if it should be ignored

struct wlr_xwayland_remove_startup_info_event

struct wlr_xwayland_remove_startup_info_event {
	const char *id;
	xcb_window_t window;
};

struct wlr_xwayland_resize_event

struct wlr_xwayland_resize_event {
	struct wlr_xwayland_surface *surface;
	uint32_t edges;
};

struct wlr_xwayland_server

struct wlr_xwayland_server {
	pid_t pid;
	struct wl_client *client;
	struct wl_event_source *pipe_source;
	int wm_fd[], wl_fd[];
	time_t server_start;
	int display;
	char display_name[];
	int x_fd[];
	struct wl_event_source *x_fd_read_event[];
	struct wlr_xwayland_server_options options;
	struct wl_display *wl_display;
	struct {
		struct wl_signal ready;
		struct wl_signal destroy;
	} events;
	struct wl_listener client_destroy;
	struct wl_listener display_destroy;
	void *data;
};

wlr_xwayland_server_create()

struct wlr_xwayland_server *wlr_xwayland_server_create(​struct wl_display *display, struct wlr_xwayland_server_options *options);

wlr_xwayland_server_destroy()

void wlr_xwayland_server_destroy(​struct wlr_xwayland_server *server);

struct wlr_xwayland_server_options

struct wlr_xwayland_server_options {
	bool lazy;
	bool enable_wm;
	bool no_touch_pointer_emulation;
};

struct wlr_xwayland_server_ready_event

struct wlr_xwayland_server_ready_event {
	struct wlr_xwayland_server *server;
	int wm_fd;
};

wlr_xwayland_set_cursor()

void wlr_xwayland_set_cursor(​struct wlr_xwayland *wlr_xwayland, uint8_t *pixels, uint32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y);

wlr_xwayland_set_seat()

void wlr_xwayland_set_seat(​struct wlr_xwayland *xwayland, struct wlr_seat *seat);

struct wlr_xwayland_surface

struct wlr_xwayland_surface {
	xcb_window_t window_id;
	struct wlr_xwm *xwm;
	uint32_t surface_id;
	struct wl_list link;
	struct wl_list stack_link;
	struct wl_list unpaired_link;
	struct wlr_surface *surface;
	int16_t x, y;
	uint16_t width, height;
	uint16_t saved_width, saved_height;
	bool override_redirect;
	bool mapped;
	char *title;
	char *class;
	char *instance;
	char *role;
	char *startup_id;
	pid_t pid;
	bool has_utf8_title;
	struct wl_list children;
	struct wlr_xwayland_surface *parent;
	struct wl_list parent_link;
	xcb_atom_t *window_type;
	size_t window_type_len;
	xcb_atom_t *protocols;
	size_t protocols_len;
	uint32_t decorations;
	struct wlr_xwayland_surface_hints *hints;
	uint32_t hints_urgency;
	struct wlr_xwayland_surface_size_hints *size_hints;
	bool pinging;
	struct wl_event_source *ping_timer;
	bool modal;
	bool fullscreen;
	bool maximized_vert, maximized_horz;
	bool minimized;
	bool has_alpha;
	struct {
		struct wl_signal destroy;
		struct wl_signal request_configure;
		struct wl_signal request_move;
		struct wl_signal request_resize;
		struct wl_signal request_minimize;
		struct wl_signal request_maximize;
		struct wl_signal request_fullscreen;
		struct wl_signal request_activate;
		struct wl_signal map;
		struct wl_signal unmap;
		struct wl_signal set_title;
		struct wl_signal set_class;
		struct wl_signal set_role;
		struct wl_signal set_parent;
		struct wl_signal set_pid;
		struct wl_signal set_startup_id;
		struct wl_signal set_window_type;
		struct wl_signal set_hints;
		struct wl_signal set_decorations;
		struct wl_signal set_override_redirect;
		struct wl_signal set_geometry;
		struct wl_signal ping_timeout;
	} events;
	struct wl_listener surface_destroy;
	void *data;
};

An Xwayland user interface component. It has an absolute position in layout-local coordinates.

When a surface is ready to be displayed, the `map` event is emitted. When a surface should no longer be displayed, the `unmap` event is emitted. The `unmap` event is guaranteed to be emitted before the `destroy` event if the view is destroyed when mapped.

wlr_xwayland_surface_activate()

void wlr_xwayland_surface_activate(​struct wlr_xwayland_surface *surface, bool activated);

wlr_xwayland_surface_close()

void wlr_xwayland_surface_close(​struct wlr_xwayland_surface *surface);

wlr_xwayland_surface_configure()

void wlr_xwayland_surface_configure(​struct wlr_xwayland_surface *surface, int16_t x, int16_t y, uint16_t width, uint16_t height);

struct wlr_xwayland_surface_configure_event

struct wlr_xwayland_surface_configure_event {
	struct wlr_xwayland_surface *surface;
	int16_t x, y;
	uint16_t width, height;
	uint16_t mask;
};

enum wlr_xwayland_surface_decorations

enum wlr_xwayland_surface_decorations {
	WLR_XWAYLAND_SURFACE_DECORATIONS_ALL,
	WLR_XWAYLAND_SURFACE_DECORATIONS_NO_BORDER,
	WLR_XWAYLAND_SURFACE_DECORATIONS_NO_TITLE,
};

wlr_xwayland_surface_from_wlr_surface()

struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface(​struct wlr_surface *surface);

struct wlr_xwayland_surface_hints

struct wlr_xwayland_surface_hints {
	uint32_t flags;
	uint32_t input;
	int32_t initial_state;
	xcb_pixmap_t icon_pixmap;
	xcb_window_t icon_window;
	int32_t icon_x, icon_y;
	xcb_pixmap_t icon_mask;
	xcb_window_t window_group;
};

wlr_xwayland_surface_ping()

void wlr_xwayland_surface_ping(​struct wlr_xwayland_surface *surface);

wlr_xwayland_surface_restack()

void wlr_xwayland_surface_restack(​struct wlr_xwayland_surface *surface, struct wlr_xwayland_surface *sibling, enum xcb_stack_mode_t mode);

Restack surface relative to sibling. If sibling is NULL, then the surface is moved to the top or the bottom of the stack (depending on the mode).

wlr_xwayland_surface_set_fullscreen()

void wlr_xwayland_surface_set_fullscreen(​struct wlr_xwayland_surface *surface, bool fullscreen);

wlr_xwayland_surface_set_maximized()

void wlr_xwayland_surface_set_maximized(​struct wlr_xwayland_surface *surface, bool maximized);

wlr_xwayland_surface_set_minimized()

void wlr_xwayland_surface_set_minimized(​struct wlr_xwayland_surface *surface, bool minimized);

struct wlr_xwayland_surface_size_hints

struct wlr_xwayland_surface_size_hints {
	uint32_t flags;
	int32_t x, y;
	int32_t width, height;
	int32_t min_width, min_height;
	int32_t max_width, max_height;
	int32_t width_inc, height_inc;
	int32_t base_width, base_height;
	int32_t min_aspect_num, min_aspect_den;
	int32_t max_aspect_num, max_aspect_den;
	uint32_t win_gravity;
};

struct wlr_xwm

struct wlr_xwm;