OSDN Git Service

call setlocale() to set the characters classification before attempting to open X11...
authorIvailo Monev <xakepa10@gmail.com>
Wed, 2 Nov 2022 05:49:54 +0000 (07:49 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 2 Nov 2022 05:49:54 +0000 (07:49 +0200)
due to the recent change in KCatalog I found out setlocale() is not called
by many programs unless there are specific requirements and X11 apparently
requires it to function properly

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/kernel/qkeymapper_x11.cpp

index a68266e..8c067de 100644 (file)
@@ -45,6 +45,10 @@ QKeyMapper::~QKeyMapper()
 
 void QKeyMapper::clearMappings()
 {
+    // NOTE: if nothing called setlocale() it has to be done here for XOpenIM()
+    // to return the locale set via environment variable
+    setlocale(LC_CTYPE, "");
+
     XIM im = XOpenIM(qt_x11Data->display, NULL, NULL, NULL);
     if (!im) {
         keyMapperCodec = QTextCodec::codecForLocale();