diff options
author | Ilya Fedin <fedin-ilja2010@ya.ru> | 2023-01-25 17:07:07 +0400 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-01-26 10:43:45 +0000 |
commit | 8113bd6d0dca0d9fcb38ea6a84a4a1bad660cd5a (patch) | |
tree | 6106595d89e821b7f60c8dc9ed7f1cca889e4b5d | |
parent | 4e302cecde9c84e7b2e558ef7772d17179b22488 (diff) |
Don't change process locale while initializing QWaylandInputContext
This was overriding the locale previously set in
QCoreApplicationPrivate::initLocale and can switch the process to
non-UTF8 codepage
Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a3896c8a036c6a9b19d889c212769d72e70257c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylandinputcontext.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index cb94005b3..8c023d495 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -222,9 +222,7 @@ void QWaylandInputContext::ensureInitialized() } m_initialized = true; - const char *locale = setlocale(LC_CTYPE, ""); - if (!locale) - locale = setlocale(LC_CTYPE, nullptr); + const char *const locale = setlocale(LC_CTYPE, nullptr); qCDebug(qLcQpaInputMethods) << "detected locale (LC_CTYPE):" << locale; m_composeTable = xkb_compose_table_new_from_locale(m_XkbContext, locale, XKB_COMPOSE_COMPILE_NO_FLAGS); |