GdkWin32Keymap: Be more robust against DLL loading failures

Fixes failure on the CI servers when generating GIR files
This commit is contained in:
Philip Zander
2020-07-29 00:12:03 +02:00
parent 4039153ca7
commit aa3e6bb0a3
2 changed files with 10 additions and 6 deletions

View File

@ -18,7 +18,7 @@
* I.e. 32 bits on 32-bit Windows and 64 bits on 64-bit Windows. * I.e. 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.
* *
* This is *not* the same as the the bitness of the application, since it is * This is *not* the same as the the bitness of the application, since it is
* possible to execute 32-bit binaries on either a 32-bit or a 64-bit host. * possible to execute 32-bit binaries on either a 32-bit *or* a 64-bit host.
* On a 64-bit host, KBD_LONG_PTR will be 64-bits, even if the application * On a 64-bit host, KBD_LONG_PTR will be 64-bits, even if the application
* itself is 32-bit. (Whereas on a 32-bit host, it will be 32-bit.) * itself is 32-bit. (Whereas on a 32-bit host, it will be 32-bit.)
* *

View File

@ -595,17 +595,21 @@ update_keymap (GdkWin32Keymap *keymap)
info->file = get_keyboard_layout_file (info->name); info->file = get_keyboard_layout_file (info->name);
info->key_entries = g_array_new (FALSE, FALSE, sizeof (KeyEntry)); if (load_layout_dll (keymap, info->file, info))
{
info->key_entries = g_array_new (FALSE, FALSE,
sizeof (GdkWin32KeymapKeyEntry)); sizeof (GdkWin32KeymapKeyEntry));
info->reverse_lookup_table = g_hash_table_new (g_direct_hash, info->reverse_lookup_table = g_hash_table_new (g_direct_hash,
g_direct_equal); g_direct_equal);
load_layout_dll (info->file, info); init_vk_lookup_table (keymap, info);
init_vk_lookup_table (info); }
} }
if (info->handle == current_layout) if (info->handle == current_layout)
keymap->active_layout = i; keymap->active_layout = i;
} }
if (changed) if (changed)
ActivateKeyboardLayout (current_layout, 0); ActivateKeyboardLayout (current_layout, 0);