From c9753b78854a188ffeeced8fd997e6e5ff7fde70 Mon Sep 17 00:00:00 2001
From: Jeremy Tan <jtanx@outlook.com>
Date: Fri, 9 Jul 2021 12:35:44 +0800
Subject: [PATCH] gdkkeys-win32.c: fix initialisation of key_state in
 update_keymap

It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.
---
 gdk/win32/gdkkeys-win32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdk/win32/gdkkeys-win32.c b/gdk/win32/gdkkeys-win32.c
index 1dcc0f67e6..6f9573d683 100644
--- a/gdk/win32/gdkkeys-win32.c
+++ b/gdk/win32/gdkkeys-win32.c
@@ -692,6 +692,7 @@ update_keymap (GdkKeymap *gdk_keymap)
   if (hkls_len != keymap->layout_handles->len)
     keymap->keysym_tab = g_renew (guint, keymap->keysym_tab, keysym_tab_size);
 
+  memset (key_state, 0, sizeof(key_state));
   memset (keymap->keysym_tab, 0, keysym_tab_size);
   g_array_set_size (keymap->layout_handles, hkls_len);
   g_array_set_size (keymap->options, hkls_len);
-- 
2.32.0

