From 5082a158f2da38fcbb47b23afc37361c275945ba Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 2 May 2012 02:50:48 +0000 Subject: [PATCH] try get xkb to work around bugs in x11. SVN revision: 70591 --- src/bin/e_xkb.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/bin/e_xkb.c b/src/bin/e_xkb.c index c7ce217e1..2a2679780 100644 --- a/src/bin/e_xkb.c +++ b/src/bin/e_xkb.c @@ -35,24 +35,20 @@ e_xkb_update(void) buf = eina_strbuf_new(); eina_strbuf_append(buf, "setxkbmap '"); - EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, cl) - { - eina_strbuf_append(buf, cl->name); - break; - //if (l->next) eina_strbuf_append(buf, ","); - } + + /* use first entry in used layouts */ + cl = e_config->xkb.used_layouts->data; + + eina_strbuf_append(buf, cl->name); eina_strbuf_append(buf, "'"); eina_strbuf_append(buf, " -variant '"); - EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, cl) - { - eina_strbuf_append(buf, cl->variant); - eina_strbuf_append(buf, ","); - break; - } + eina_strbuf_append(buf, cl->variant); + /* workaround xkb bug where japanese (only one with a / in name) + * doesnt work without a , at the end */ + if ((cl->name) && (strchr(cl->name, '/'))) eina_strbuf_append(buf, ","); eina_strbuf_append(buf, "'"); - cl = eina_list_data_get(e_config->xkb.used_layouts); if (cl->model) { eina_strbuf_append(buf, " -model '"); @@ -74,9 +70,8 @@ e_xkb_update(void) eina_strbuf_append(buf, op->name); eina_strbuf_append(buf, "'"); } - break; } - printf("SEWT XKB RUN:\ %s\n", eina_strbuf_string_get(buf)); + printf("SET XKB RUN:\n %s\n", eina_strbuf_string_get(buf)); ecore_exe_run(eina_strbuf_string_get(buf), NULL); eina_strbuf_free(buf); }