Skip to content

Commit 9456e2c

Browse files
btw616jmberg-intel
authored andcommitted
um: xterm: Add Wayland support
Under Wayland, we should check WAYLAND_DISPLAY instead. Signed-off-by: Tiwei Bie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 92a09c4 commit 9456e2c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/um/drivers/xterm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,9 @@ static int xterm_open(int input, int output, int primary, void *d,
9797
if (access(argv[4], X_OK) < 0)
9898
argv[4] = "port-helper";
9999

100-
/*
101-
* Check that DISPLAY is set, this doesn't guarantee the xterm
102-
* will work but w/o it we can be pretty sure it won't.
103-
*/
104-
if (getenv("DISPLAY") == NULL) {
105-
printk(UM_KERN_ERR "xterm_open: $DISPLAY not set.\n");
100+
/* Ensure we are running on Xorg or Wayland. */
101+
if (!getenv("DISPLAY") && !getenv("WAYLAND_DISPLAY")) {
102+
printk(UM_KERN_ERR "xterm_open : neither $DISPLAY nor $WAYLAND_DISPLAY is set.\n");
106103
return -ENODEV;
107104
}
108105

0 commit comments

Comments
 (0)