Rémi Bernon (@rbernon) commented about dlls/winex11.drv/keyboard.c:
+ { + *layout = p_rxkb_layout_get_name( iter ); + *variant = p_rxkb_layout_get_variant( iter ); + return TRUE; + } + } + + WARN( "Unknown Xkb layout name %s\n", debugstr_a(name) ); + } + else + WARN( "libxkbregistry not available, falling back to fuzzy layout detection\n" ); +#else + WARN( "libxkbregistry support not compiled in, falling back to fuzzy layout detection\n" ); +#endif + return FALSE; +} Fwiw here as well I find the extra nesting level just to handle the uncommon case quite bad to read. It also requires HAVE_XKBCOMMON_XKBREGISTRY_H rather than SONAME_LIBXKBREGISTRY. What about:
```suggestion:-27+0 static BOOL find_xkb_layout_variant( const char *name, const char **layout, const char **variant ) { #ifdef HAVE_XKBCOMMON_XKBREGISTRY_H struct rxkb_layout *iter; if (!rxkb_context) WARN( "libxkbregistry not found, falling back to fuzzy layout detection\n" ); else for (iter = p_rxkb_layout_first( rxkb_context ); iter; iter = p_rxkb_layout_next( iter )) { const char *desc = p_rxkb_layout_get_description( iter ); if (desc && !strcmp( name, desc )) { *layout = p_rxkb_layout_get_name( iter ); *variant = p_rxkb_layout_get_variant( iter ); return TRUE; } } WARN( "Unknown Xkb layout name %s\n", debugstr_a(name) ); #else WARN( "libxkbregistry support not compiled in, falling back to fuzzy layout detection\n" ); #endif return FALSE; } ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10550#note_136794