make xwayland optional

This commit is contained in:
armtux 2018-06-06 14:47:04 -04:00
parent b1e72461cf
commit e8b9c5208e
16 changed files with 75 additions and 2 deletions

View file

@ -24,7 +24,9 @@ struct criteria {
pcre *instance;
pcre *con_mark;
uint32_t con_id; // internal ID
#ifdef HAVE_XWAYLAND
uint32_t id; // X11 window ID
#endif
pcre *window_role;
uint32_t window_type;
bool floating;

View file

@ -11,7 +11,9 @@
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/render/wlr_renderer.h>
// TODO WLR: make Xwayland optional
#ifdef HAVE_XWAYLAND
#include <wlr/xwayland.h>
#endif
struct sway_server {
struct wl_display *wl_display;
@ -37,9 +39,13 @@ struct sway_server {
struct wlr_xdg_shell *xdg_shell;
struct wl_listener xdg_shell_surface;
#ifdef HAVE_XWAYLAND
struct wlr_xwayland *xwayland;
#endif
struct wlr_xcursor_manager *xcursor_manager;
#ifdef HAVE_XWAYLAND
struct wl_listener xwayland_surface;
#endif
struct wlr_wl_shell *wl_shell;
struct wl_listener wl_shell_surface;
@ -56,6 +62,8 @@ void handle_new_output(struct wl_listener *listener, void *data);
void handle_layer_shell_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_surface(struct wl_listener *listener, void *data);
#ifdef HAVE_XWAYLAND
void handle_xwayland_surface(struct wl_listener *listener, void *data);
#endif
#endif

View file

@ -27,7 +27,9 @@ struct sway_root {
struct wl_listener output_layout_change;
#ifdef HAVE_XWAYLAND
struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
#endif
struct wlr_texture *debug_tree;

View file

@ -3,7 +3,9 @@
#include <wayland-server.h>
#include <wlr/types/wlr_surface.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#ifdef HAVE_XWAYLAND
#include <wlr/xwayland.h>
#endif
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
@ -12,7 +14,9 @@ struct sway_container;
enum sway_view_type {
SWAY_VIEW_XDG_SHELL_V6,
SWAY_VIEW_XDG_SHELL,
#ifdef HAVE_XWAYLAND
SWAY_VIEW_XWAYLAND,
#endif
};
enum sway_view_prop {
@ -22,7 +26,9 @@ enum sway_view_prop {
VIEW_PROP_INSTANCE,
VIEW_PROP_WINDOW_TYPE,
VIEW_PROP_WINDOW_ROLE,
#ifdef HAVE_XWAYLAND
VIEW_PROP_X11_WINDOW_ID,
#endif
};
struct sway_view_impl {
@ -79,7 +85,9 @@ struct sway_view {
union {
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6;
struct wlr_xdg_surface *wlr_xdg_surface;
#ifdef HAVE_XWAYLAND
struct wlr_xwayland_surface *wlr_xwayland_surface;
#endif
struct wlr_wl_shell_surface *wlr_wl_shell_surface;
};
@ -123,6 +131,7 @@ struct sway_xdg_shell_view {
int pending_width, pending_height;
};
#ifdef HAVE_XWAYLAND
struct sway_xwayland_view {
struct sway_view view;
@ -156,6 +165,7 @@ struct sway_xwayland_unmanaged {
struct wl_listener unmap;
struct wl_listener destroy;
};
#endif
struct sway_view_child;
@ -204,7 +214,9 @@ const char *view_get_class(struct sway_view *view);
const char *view_get_instance(struct sway_view *view);
#ifdef HAVE_XWAYLAND
uint32_t view_get_x11_window_id(struct sway_view *view);
#endif
const char *view_get_window_role(struct sway_view *view);