]> git.proxmox.com Git - spiceterm.git/commitdiff
fix add_keymap_entry for non us keymaps
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 30 Nov 2017 13:46:05 +0000 (14:46 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Dec 2017 09:19:09 +0000 (10:19 +0100)
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>
input.c

diff --git a/input.c b/input.c
index 5ee82de3dc6b9b09308f484bfd7a811d8ec406cd..71c9dacf794a40593c2c684db953df5e928d827a 100644 (file)
--- a/input.c
+++ b/input.c
@@ -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);
 }