xkb - make basic variant null now and handle in wl too the same as x

now russian works for me. :)

fixes T7979

@fix
This commit is contained in:
Carsten Haitzler 2019-08-09 09:50:33 +01:00
parent 855c7028c4
commit fdd472879b
3 changed files with 46 additions and 20 deletions

View File

@ -308,23 +308,27 @@ _e_wl_xkb_reconfig(void)
eina_strbuf_append(layouts, cl->name);
eina_strbuf_append_char(layouts, ',');
}
else
eina_strbuf_append_char(layouts, ',');
if (cl->variant)
if ((cl->variant) && (strcmp(cl->variant, "basic")))
{
eina_strbuf_append(variants, cl->variant);
eina_strbuf_append_char(variants, ',');
}
else
eina_strbuf_append_char(variants, ',');
}
/* collect model to use */
/* set keymap to the compositor */
e_comp_wl_input_keymap_set(NULL,
e_config->xkb.default_model,
eina_strbuf_string_get(layouts), //pool of layouts to use
eina_strbuf_string_get(variants), //pool of variants to use
eina_strbuf_string_get(options) //list of options
);
e_config->xkb.default_model,
eina_strbuf_string_get(layouts), //pool of layouts to use
eina_strbuf_string_get(variants), //pool of variants to use
eina_strbuf_string_get(options) //list of options
);
eina_strbuf_free(variants);
eina_strbuf_free(layouts);

View File

@ -521,8 +521,14 @@ _basic_create_fill(E_Config_Dialog_Data *cfdata)
e_xkb_flag_file_get(buf, sizeof(buf), name);
elm_image_file_set(ic, buf, NULL);
snprintf(buf, sizeof(buf), "%s (%s, %s)",
cl->name, cl->model, cl->variant);
snprintf(buf, sizeof(buf), "%s%s%s%s%s%s",
cl->name ? cl->name : _("No Name"),
cl->model || cl->variant ? " (" : "",
cl->model ? cl->model : "",
cl->model && cl->variant ? ", " : "",
cl->variant ? cl->variant : "",
cl->model || cl->variant ? ")" : ""
);
evas_object_show(ic);
it = elm_list_item_append(cfdata->used_list, buf, ic,
NULL, NULL, cl);
@ -1451,7 +1457,7 @@ _dlg_add_cb_ok(void *data, E_Dialog *dlg)
E_XKB_Model *m;
E_XKB_Variant *v;
E_Config_XKB_Layout *cl;
char buf[PATH_MAX], icon_buf[PATH_MAX];
char buf[512], icon_buf[PATH_MAX];
Evas_Object *ic;
Elm_Object_Item *it;
/* Configuration information */
@ -1480,8 +1486,14 @@ _dlg_add_cb_ok(void *data, E_Dialog *dlg)
ic = elm_icon_add(cfdata->used_list);
e_xkb_flag_file_get(icon_buf, sizeof(icon_buf), cl->name);
elm_image_file_set(ic, icon_buf, NULL);
snprintf(buf, sizeof(buf), "%s (%s, %s)",
cl->name, cl->model, cl->variant);
snprintf(buf, sizeof(buf), "%s%s%s%s%s%s",
cl->name ? cl->name : _("No Name"),
cl->model || cl->variant ? " (" : "",
cl->model ? cl->model : "",
cl->model && cl->variant ? ", " : "",
cl->variant ? cl->variant : "",
cl->model || cl->variant ? ")" : ""
);
elm_list_item_append(cfdata->used_list, buf, ic, NULL, NULL, cl);
elm_list_go(cfdata->used_list);
@ -1499,9 +1511,13 @@ static char *
_layout_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
{
E_XKB_Layout *layout = data;
char buf[PATH_MAX];
char buf[512];
snprintf(buf, sizeof(buf), "%s (%s)", layout->description, layout->name);
snprintf(buf, sizeof(buf), "%s%s%s%s",
layout->description ? layout->description : _("No Description"),
layout->name ? " (" : "",
layout->name ? layout->name : "",
layout->name ? ")" : "");
return strdup(buf);
}
@ -1580,10 +1596,13 @@ static char *
_model_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
{
E_XKB_Model *model = data;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s (%s)", model->description, model->name);
char buf[512];
snprintf(buf, sizeof(buf), "%s%s%s%s",
model->description ? model->description : _("No Description"),
model->name ? " (" : "",
model->name ? model->name : "",
model->name ? ")" : "");
return strdup(buf);
}
@ -1591,10 +1610,13 @@ static char *
_variant_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
{
E_XKB_Variant *variant = data;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s (%s)", variant->name, variant->description);
char buf[512];
snprintf(buf, sizeof(buf), "%s%s%s%s",
variant->name ? variant->name : _("No Name"),
variant->description ? " (" : "",
variant->description ? variant->description : "",
variant->description ? ")" : "");
return strdup(buf);
}

View File

@ -193,7 +193,7 @@ parse_rules(void)
++p;
variant = E_NEW(E_XKB_Variant, 1);
variant->name = eina_stringshare_add("basic");
variant->name = NULL; // used to be "basic" but now NULL will do
variant->description = eina_stringshare_add("Default layout variant");
txt = evas_textblock_text_markup_to_utf8(NULL, p);