diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-08-11 22:41:53 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-08-11 22:41:53 +0200 |
commit | f4b4bc2ee4e3805d04f85f11900e4642de902001 (patch) | |
tree | a16f269c76a1d64c391bee16608c7fab615c560e /src/uterm_input.c | |
parent | c9ccc70fcbbe6631248e74d0361aa92dc9c1ea30 (diff) |
uterm: input: pass xkb parameters from outside
Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/uterm_input.c')
-rw-r--r-- | src/uterm_input.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/uterm_input.c b/src/uterm_input.c index b6730dd..4360073 100644 --- a/src/uterm_input.c +++ b/src/uterm_input.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include "main.h" #include "eloop.h" #include "log.h" #include "main.h" @@ -234,7 +233,10 @@ static void input_free_dev(struct uterm_input_dev *dev) } int uterm_input_new(struct uterm_input **out, - struct ev_eloop *eloop) + struct ev_eloop *eloop, + const char *layout, + const char *variant, + const char *options) { struct uterm_input *input; int ret; @@ -255,16 +257,16 @@ int uterm_input_new(struct uterm_input **out, goto err_free; ret = kbd_desc_new(&input->desc, - kmscon_conf.xkb_layout, - kmscon_conf.xkb_variant, - kmscon_conf.xkb_options, + layout, + variant, + options, KBD_UXKB); if (ret == -EOPNOTSUPP) { log_info("XKB keyboard backend not available, trying plain backend"); ret = kbd_desc_new(&input->desc, - kmscon_conf.xkb_layout, - kmscon_conf.xkb_variant, - kmscon_conf.xkb_options, + layout, + variant, + options, KBD_PLAIN); if (ret) goto err_hook; |