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 11:28:45 +0000 |
commit | 56104817364afb36eb1c5e4199beb71e61ec2cd4 (patch) | |
tree | 7b3fcba2e862515ab527ac7579feaaf17dfc2f35 | |
parent | 92e35edc81cebc61e5f9f4bd7bd111120cad9d26 (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 4420bb189..db897be9a 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -591,9 +591,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); |