XCB/libxkbcommon input context: Fix crash when invalid local is set
Fall back to querying the locale. Fixes: QTBUG-74216 Change-Id: Ibd60572454741e64f649ecc3e37f593a8e2b2bda Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
1b5dbebb93
commit
f792fed2ff
@ -70,7 +70,9 @@ void QComposeInputContext::ensureInitialized()
|
||||
}
|
||||
|
||||
m_initialized = true;
|
||||
const char *const locale = setlocale(LC_CTYPE, "");
|
||||
const char *locale = setlocale(LC_CTYPE, "");
|
||||
if (!locale)
|
||||
locale = setlocale(LC_CTYPE, nullptr);
|
||||
qCDebug(lcXkbCompose) << "detected locale (LC_CTYPE):" << locale;
|
||||
|
||||
m_composeTable = xkb_compose_table_new_from_locale(m_XkbContext, locale, XKB_COMPOSE_COMPILE_NO_FLAGS);
|
||||
|
Loading…
Reference in New Issue
Block a user