On Thu Apr 30 09:14:27 2026 +0000, Rémi Bernon wrote:
Does this fix or help anything? Sure we can make layout ids more compatible but if it doesn't matter so much (and as far as I know it doesn't), we should work on the meaningful bits first. Especially if this is only temporary. It's temporary until we add the full "Keyboard Layouts" DB to the registry and make the (already existing) real implementation of `NtUserGetKeyboardLayoutName()`, a few lines below, work. Otherwise, yes, the bug I'm attempting to fix with this rework very much depends on getting this right (or right enough). We want to use the detected keyboard layout LANGID for the layout name (i.e. usually the high WORD of the HKL), specifically when the locale doesn't match with the keyboard layout. The game uses the layout name alone to show proper key labels in the interface.
Using the low WORD of the HKL to store the LANGID of the keyboard layout, at least in the case of layout variants (0xfxxxxxxx HKL), is another option, although that requires tweaking the "changing user locale" FIXME() and early exit in `NtUserActivateKeyboardLayout()` accordingly, and it's arguably a (temporary) step in the opposite direction to where we want to end up. Otherwise I could push the addition of the registry data (and updating all the drivers to make use of that, or at least not break in the new world) towards the front of the patch sequence, moving the fix I want to get to a bit further, so that this becomes "temporary" enough that I can drop this change. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10779#note_138345