build: drop xwayland option

Instead of having a build-time option to enable/disable xwayland
support, just use the wlroots build config: enable xwayland in
Sway if it was enabled when building wlroots. I don't see any
use-case for disabling xwayland in Sway when enabled in wlroots:
Sway doesn't pull in any additional dependency (just pulls in
dependencies that wlroots already needs). We have a config command
to disable xwayland at runtime anyways.

This makes it so xwayland behaves the same way as other features
such as libinput backend and session support. This also reduces
the build matrix (less combinations of build options).

I think we originally introduced the xwayland option when we didn't
have a good way to figure out the wlroots build config from the
Sway build system.
This commit is contained in:
Simon Ser 2024-05-18 14:02:14 +02:00 committed by Simon Zeni
parent fd3b643d15
commit 9704152414
19 changed files with 56 additions and 59 deletions

View file

@ -22,7 +22,7 @@ bool criteria_is_empty(struct criteria *criteria) {
&& !criteria->app_id
&& !criteria->con_mark
&& !criteria->con_id
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
&& !criteria->class
&& !criteria->id
&& !criteria->instance
@ -90,7 +90,7 @@ void criteria_destroy(struct criteria *criteria) {
pattern_destroy(criteria->title);
pattern_destroy(criteria->shell);
pattern_destroy(criteria->app_id);
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
pattern_destroy(criteria->class);
pattern_destroy(criteria->instance);
pattern_destroy(criteria->window_role);
@ -110,7 +110,7 @@ static int regex_cmp(const char *item, const pcre2_code *regex) {
return result;
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
static bool view_has_window_type(struct sway_view *view, enum atom_name name) {
if (view->type != SWAY_VIEW_XWAYLAND) {
return false;
@ -251,7 +251,7 @@ static bool criteria_matches_view(struct criteria *criteria,
return false;
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
if (criteria->id) { // X11 window ID
uint32_t x11_window_id = view_get_x11_window_id(view);
if (!x11_window_id || x11_window_id != criteria->id) {
@ -428,7 +428,7 @@ list_t *criteria_get_containers(struct criteria *criteria) {
return matches;
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
static enum atom_name parse_window_type(const char *type) {
if (strcasecmp(type, "normal") == 0) {
return NET_WM_WINDOW_TYPE_NORMAL;
@ -461,7 +461,7 @@ enum criteria_token {
T_CON_ID,
T_CON_MARK,
T_FLOATING,
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
T_CLASS,
T_ID,
T_INSTANCE,
@ -487,7 +487,7 @@ static enum criteria_token token_from_name(char *name) {
return T_CON_ID;
} else if (strcmp(name, "con_mark") == 0) {
return T_CON_MARK;
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
} else if (strcmp(name, "class") == 0) {
return T_CLASS;
} else if (strcmp(name, "id") == 0) {
@ -566,7 +566,7 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) {
case T_CON_MARK:
pattern_create(&criteria->con_mark, value);
break;
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
case T_CLASS:
pattern_create(&criteria->class, value);
break;
@ -674,7 +674,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
++head;
struct criteria *criteria = calloc(1, sizeof(struct criteria));
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
criteria->window_type = ATOM_LAST; // default value
#endif
char *name = NULL, *value = NULL;