aboutsummaryrefslogtreecommitdiff
path: root/xwayland/server.c
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2020-10-03 14:16:54 -0400
committerSimon Ser <contact@emersion.fr>2020-10-11 09:00:52 +0200
commit1b0e4c7e6e0bf02b3c41962b669c00280ecc7712 (patch)
treef8b7d866721700d5458483a1f2a1469943c83979 /xwayland/server.c
parentfeb0e1c74d13c44c4c0b8c8db360039846bc9617 (diff)
xwayland: introduce WLR_XWAYLAND for specifying which Xwayland to use
When debugging Xwayland-related issues, a common first step in debugging has been to ask the reporter to move their real Xwayland to /usr/bin/Xwayland.bin, and create a shell script starting Xwayland with extra arguments under the original /usr/bin/Xwayland location. Introducing a `WLR_XWAYLAND` environment variable makes this less invasive, by allowing the user to swap out Xwayland without resorting to global system changes (or source patches).
Diffstat (limited to 'xwayland/server.c')
-rw-r--r--xwayland/server.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xwayland/server.c b/xwayland/server.c
index 27e9861a..24b435aa 100644
--- a/xwayland/server.c
+++ b/xwayland/server.c
@@ -107,8 +107,16 @@ noreturn static void exec_xwayland(struct wlr_xwayland_server *server) {
dup2(devnull, STDERR_FILENO);
}
+ const char *xwayland_path = getenv("WLR_XWAYLAND");
+ if (xwayland_path) {
+ wlr_log(WLR_INFO, "Using Xwayland binary to '%s' due to WLR_XWAYLAND",
+ xwayland_path);
+ } else {
+ xwayland_path = "Xwayland";
+ }
+
// This returns if and only if the call fails
- execvp("Xwayland", argv);
+ execvp(xwayland_path, argv);
wlr_log_errno(WLR_ERROR, "failed to exec Xwayland");
close(devnull);