Monado OpenXR Runtime
comp_window_wayland.c File Reference

Wayland window code. More...

#include <errno.h>
#include <linux/input.h>
#include <poll.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client.h>
#include "xdg-shell-client-protocol.h"
#include "xrt/xrt_compiler.h"
#include "main/comp_window.h"
#include "util/u_misc.h"
Include dependency graph for comp_window_wayland.c:

Data Structures

struct  comp_window_wayland
 A Wayland connection and window. More...
 

Functions

static void comp_window_wayland_destroy (struct comp_target *ct)
 
static bool comp_window_wayland_init (struct comp_target *ct)
 
static void comp_window_wayland_update_window_title (struct comp_target *ct, const char *title)
 
static void comp_window_wayland_registry_global (struct comp_window_wayland *w, struct wl_registry *registry, uint32_t name, const char *interface)
 
static void comp_window_wayland_fullscreen (struct comp_window_wayland *w)
 
static bool comp_window_wayland_init_swapchain (struct comp_target *ct, uint32_t width, uint32_t height)
 
static VkResult comp_window_wayland_create_surface (struct comp_window_wayland *w, VkSurfaceKHR *out_surface)
 
static void comp_window_wayland_flush (struct comp_target *ct)
 
static void comp_window_wayland_configure (struct comp_window_wayland *w, int32_t width, int32_t height)
 
static struct vk_bundleget_vk (struct comp_window_wayland *cww)
 
struct comp_targetcomp_window_wayland_create (struct comp_compositor *c)
 
static void _xdg_surface_configure_cb (void *data, struct xdg_surface *surface, uint32_t serial)
 
static void _xdg_toplevel_configure_cb (void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height, struct wl_array *states)
 
static void _xdg_toplevel_close_cb (void *data, struct xdg_toplevel *toplevel)
 
static void _xdg_wm_base_ping_cb (void *data, struct xdg_wm_base *wm_base, uint32_t serial)
 
static void _registry_global_remove_cb (void *data, struct wl_registry *registry, uint32_t name)
 
static void _registry_global_cb (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
 
static bool detect (const struct comp_target_factory *ctf, struct comp_compositor *c)
 
static bool create_target (const struct comp_target_factory *ctf, struct comp_compositor *c, struct comp_target **out_ct)
 

Variables

static const struct xdg_surface_listener xdg_surface_listener
 
static const struct xdg_toplevel_listener xdg_toplevel_listener
 
static const struct xdg_wm_base_listener xdg_wm_base_listener
 
static const struct wl_registry_listener registry_listener
 
static const char * instance_extensions []
 
const struct comp_target_factory comp_target_factory_wayland
 

Detailed Description

Variable Documentation

◆ comp_target_factory_wayland

const struct comp_target_factory comp_target_factory_wayland
Initial value:
= {
.name = "Wayland Windowed",
.identifier = "wayland",
.requires_vulkan_for_create = false,
.is_deferred = false,
.required_instance_version = 0,
.required_instance_extensions = instance_extensions,
.required_instance_extension_count = ARRAY_SIZE(instance_extensions),
.optional_device_extensions = NULL,
.optional_device_extension_count = 0,
.detect = detect,
.create_target = create_target,
}
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:30

◆ instance_extensions

const char* instance_extensions[]
static
Initial value:
= {
VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME,
}

◆ registry_listener

const struct wl_registry_listener registry_listener
static
Initial value:
= {
_registry_global_cb,
_registry_global_remove_cb,
}

◆ xdg_surface_listener

const struct xdg_surface_listener xdg_surface_listener
static
Initial value:
= {
_xdg_surface_configure_cb,
}

◆ xdg_toplevel_listener

const struct xdg_toplevel_listener xdg_toplevel_listener
static
Initial value:
= {
_xdg_toplevel_configure_cb,
_xdg_toplevel_close_cb,
}

◆ xdg_wm_base_listener

const struct xdg_wm_base_listener xdg_wm_base_listener
static
Initial value:
= {
_xdg_wm_base_ping_cb,
}