Add XWayland support

With Cage becoming more popular since its mention on Phoronix and
therefore getting more use-cases than just my own project, add XWayland
support. The refactoring of 2cf40f7 makes this much easier. Note that
this is a no-cost addition for those of us not using XWayland as it is a
compile-time option that needs to be explicitly enabled by adding
`-Dxwayland=true` to your meson command.
This commit is contained in:
Jente Hidskes 2018-12-31 17:24:21 +01:00
parent 48f8f69556
commit a34c726a1c
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA
10 changed files with 213 additions and 3 deletions

8
view.h
View file

@ -1,6 +1,8 @@
#ifndef CG_VIEW_H
#define CG_VIEW_H
#include "config.h"
#include <stdbool.h>
#include <wayland-server.h>
#include <wlr/types/wlr_box.h>
@ -11,6 +13,9 @@
enum cg_view_type {
CAGE_XDG_SHELL_VIEW,
#ifdef CAGE_HAS_XWAYLAND
CAGE_XWAYLAND_VIEW,
#endif
};
struct cg_view {
@ -22,6 +27,9 @@ struct cg_view {
enum cg_view_type type;
union {
struct wlr_xdg_surface *xdg_surface;
#ifdef CAGE_HAS_XWAYLAND
struct wlr_xwayland_surface *xwayland_surface;
#endif
};
struct wl_listener destroy;