Otherwise strange thing might ensue.
Signed-off-by: Ran Benita <ran234@gmail.com>
HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap, VModInfo *info)
{
xkb_mod_index_t i;
HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap, VModInfo *info)
{
xkb_mod_index_t i;
const struct xkb_vmod *vmod;
struct xkb_vmod new;
const struct xkb_vmod *vmod;
struct xkb_vmod new;
"Support for setting a value in a virtual_modifiers statement has been removed; "
"Value ignored\n");
"Support for setting a value in a virtual_modifiers statement has been removed; "
"Value ignored\n");
+ name = xkb_atom_text(keymap->ctx, stmt->name);
+ if (ModNameToIndex(name) != XKB_MOD_INVALID) {
+ log_err(keymap->ctx,
+ "Can't add a virtual modifier named \"%s\"; "
+ "there is already a non-virtual modifier with this name! Ignored\n",
+ name);
+ return false;
+ }
+
darray_enumerate(i, vmod, keymap->vmods) {
if (vmod->name == stmt->name) {
info->available |= 1 << i;
darray_enumerate(i, vmod, keymap->vmods) {
if (vmod->name == stmt->name) {
info->available |= 1 << i;