5
0
mirror of git://git.proxmox.com/git/spiceterm.git synced 2025-03-11 16:58:29 +03:00

fix add_keymap_entry for non us keymaps

the only difference between
g_hash_table_insert and g_hash_table_replace is which key gets
freed/used

insert reuses the old key while replace used the new key
both insert the value or replace the value if it already exists

since the key is in the structure we allocate, we always
want to use the new key, and the old structure to be freed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-11-30 14:46:05 +01:00 committed by Fabian Grünbichler
parent 93de628d10
commit 995ba329be

View File

@ -713,7 +713,7 @@ add_keymap_entry(guint8 mask, guint8 keycode, guint keysym, guint unicode)
e->keycode = keycode;
e->hkey = mask << 8 | (keycode & 255);
g_hash_table_insert(keymap, &e->hkey, e);
g_hash_table_replace(keymap, &e->hkey, e);
}