From 9a14b8f4fa771368fc756bd1e49308dcf21ddd07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 30 Apr 2014 10:40:39 -0700 Subject: [PATCH] launcher-util: Initialize kb_mode also when weston-launch sets up tty We need a valid kb_mode to restore to in case weston-launch dies and weston has to clean up the tty. We don't get a chance to read out the kb mode before weston-launch changes it, but it's safe to assume that it's always K_UNICODE. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77455 --- src/launcher-util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/launcher-util.c b/src/launcher-util.c index 1b63458..ac764dc 100644 --- a/src/launcher-util.c +++ b/src/launcher-util.c @@ -390,6 +390,11 @@ weston_launcher_connect(struct weston_compositor *compositor, int tty, launcher->fd = weston_environment_get_fd("WESTON_LAUNCHER_SOCK"); if (launcher->fd != -1) { launcher->tty = weston_environment_get_fd("WESTON_TTY_FD"); + /* We don't get a chance to read out the original kb + * mode for the tty, so just hard code K_UNICODE here + * in case we have to clean if weston-launch dies. */ + launcher->kb_mode = K_UNICODE; + loop = wl_display_get_event_loop(compositor->wl_display); launcher->source = wl_event_loop_add_fd(loop, launcher->fd, WL_EVENT_READABLE, -- 2.7.4