Commit c6f818a0 authored by Stefan Agner's avatar Stefan Agner Committed by Pekka Paalanen

weston-launch: make sure weston-launch activates the VT

Currently weston-launch does not activate the VT when opening the
terminal directly (e.g. using --tty=/dev/tty7). Weston takes full
control over the terminal by switching it to graphical mode etc.
However, the old VT stays active as can be seen when looking at
sysfs:
  # cat /sys/class/tty/tty0/active
  tty1

Always switch to the new VT to make sure the correct VT is active.
This aligns with how TTY setup is implemented in launcher-direct.c.
Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
parent cb24a7d1
......@@ -605,6 +605,20 @@ setup_tty(struct weston_launch *wl, const char *tty)
wl->ttynr = minor(buf.st_rdev);
}
if (ioctl(wl->tty, VT_ACTIVATE, wl->ttynr) < 0) {
fprintf(stderr,
"weston: failed to activate VT: %s\n",
strerror(errno));
return -1;
}
if (ioctl(wl->tty, VT_WAITACTIVE, wl->ttynr) < 0) {
fprintf(stderr,
"weston: failed to wait for VT to be active: %s\n",
strerror(errno));
return -1;
}
if (ioctl(wl->tty, KDGKBMODE, &wl->kb_mode)) {
fprintf(stderr,
"weston: failed to get current keyboard mode: %s\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment