summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2023-01-25 17:07:07 +0400
committerThiago Macieira <thiago.macieira@intel.com>2023-01-26 10:18:47 +0000
commita3896c8a036c6a9b19d889c212769d72e70257c4 (patch)
tree3d6757c4dcf94f2330e6c584f3f525d65098aeab /src
parentf0de6ff9606ea2bf0622f8d8c67e8688be86bf0d (diff)
downloadqtwayland-a3896c8a036c6a9b19d889c212769d72e70257c4.tar.gz
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 Pick-to: 6.5 6.4 6.2 Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandinputcontext.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
index e67311a1..3af55bcc 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);