diff options
author | Simon Ser <contact@emersion.fr> | 2022-10-14 17:44:49 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-18 15:35:20 +0000 |
commit | 69b0b296a296d6d42607eea6dd82876d00d306fb (patch) | |
tree | c8accde76ae98a1a5bed241a685f0127494fd89f /include/wlr | |
parent | f84f7c771061696b52e39b2d3d994de9db1dbd65 (diff) |
xwayland-shell-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/163
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/xwayland/shell.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/wlr/xwayland/shell.h b/include/wlr/xwayland/shell.h new file mode 100644 index 00000000..50be0aae --- /dev/null +++ b/include/wlr/xwayland/shell.h @@ -0,0 +1,57 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_XWAYLAND_SHELL_H +#define WLR_XWAYLAND_SHELL_H + +#include <stdbool.h> +#include <wayland-server-core.h> + +/** + * The Xwayland shell. + * + * This is a shell only exposed to Xwayland. + */ +struct wlr_xwayland_shell_v1 { + struct wl_global *global; + + struct { + struct wl_signal new_surface; // struct wlr_xwayland_surface_v1 + } events; + + // private state + + struct wl_listener display_destroy; +}; + +/** + * An Xwayland shell surface. + */ +struct wlr_xwayland_surface_v1 { + struct wlr_surface *surface; + uint64_t serial; + + // private state + + struct wl_resource *resource; + struct wlr_xwayland_shell_v1 *shell; + bool added; + + struct wl_listener surface_destroy; +}; + +/** + * Create the xwayland_shell_v1 global. + * + * Compositors should add a global filter (see wl_display_set_global_filter()) + * to only expose this global to Xwayland clients. + */ +struct wlr_xwayland_shell_v1 *wlr_xwayland_shell_v1_create( + struct wl_display *display, uint32_t version); + +#endif |