diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-02-09 02:40:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-02-09 02:40:57 +0100 |
commit | a25d4d0e3ccf0e9bf0b37e5791275fd6ca5eb4ae (patch) | |
tree | 08b6677cec51b335bfe2435977ce261cddbcb8ce /src/vconsole | |
parent | c65eb8365344eeb72ee2c0b333ab54d925263b3f (diff) |
vconsole-setup: don't set the kbd mode to unicode if is is currently in raw/off mode
Let's not confuse X11
Diffstat (limited to 'src/vconsole')
-rw-r--r-- | src/vconsole/vconsole-setup.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 65017055f3..1208aeb524 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -68,9 +68,22 @@ static int disable_utf8(int fd) { static int enable_utf8(int fd) { int r = 0, k; - - if (ioctl(fd, KDSKBMODE, K_UNICODE) < 0) - r = -errno; + long current = 0; + + if (ioctl(fd, KDGKBMODE, ¤t) < 0 || current == K_XLATE) { + /* + * Change the current keyboard to unicode, unless it + * is currently in raw or off mode anyway. We + * shouldn't interfere with X11's processing of the + * key events. + * + * http://lists.freedesktop.org/archives/systemd-devel/2013-February/008573.html + * + */ + + if (ioctl(fd, KDSKBMODE, K_UNICODE) < 0) + r = -errno; + } if (loop_write(fd, "\033%G", 3, false) < 0) r = -errno; |