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

@ -107,7 +107,7 @@ struct sway_node *node_at_coords(
return NULL;
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
if (scene_descriptor_try_get(current, SWAY_SCENE_DESC_XWAYLAND_UNMANAGED)) {
return NULL;
}

View file

@ -190,7 +190,7 @@ static void seat_send_focus(struct sway_node *node, struct sway_seat *seat) {
node->sway_container->view : NULL;
if (view && seat_is_input_allowed(seat, view->surface)) {
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
if (view->type == SWAY_VIEW_XWAYLAND) {
struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
@ -1002,7 +1002,7 @@ void seat_configure_xcursor(struct sway_seat *seat) {
setenv("XCURSOR_THEME", cursor_theme, 1);
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
if (server.xwayland.wlr_xwayland && (!server.xwayland.xcursor_manager ||
!xcursor_manager_is_named(server.xwayland.xcursor_manager,
cursor_theme) ||

View file

@ -15,7 +15,7 @@
#include "sway/tree/view.h"
#include "sway/tree/workspace.h"
#include "log.h"
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
#include "sway/xwayland.h"
#endif
@ -234,7 +234,7 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
node->sway_container : NULL;
struct wlr_layer_surface_v1 *layer;
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
struct wlr_xwayland_surface *xsurface;
#endif
if ((layer = wlr_layer_surface_v1_try_from_wlr_surface(surface)) &&
@ -268,7 +268,7 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
seat_set_focus_container(seat, cont);
seatop_begin_down(seat, node->sway_container, sx, sy);
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
// Handle tapping on an xwayland unmanaged view
else if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(surface)) &&
xsurface->override_redirect &&
@ -514,7 +514,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
return;
}
#if HAVE_XWAYLAND
#if WLR_HAS_XWAYLAND
// Handle clicking on xwayland unmanaged view
struct wlr_xwayland_surface *xsurface;
if (surface &&