From 995ba329bea956e04d748d4c9709e931c8ed8710 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 30 Nov 2017 14:46:05 +0100 Subject: [PATCH] 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 --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.c b/input.c index 5ee82de..71c9dac 100644 --- 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); }