Subject: bad window title encoding for Unicode (Cyrillic) session names

From: Ivan Zakharyaschev <[email-masked]>
Date: Fri, 15 Jun 2018 22:21:35 +0300 (MSK)

Package: x2goclient
Version: 4.1.1.1
Tag: patch

If the session name is written in Cyrillic (I guess, any Unicode), the 
window title is displayed incorrectly (as if Unicode was not understood, 
with strange symbols) in the task bar in the KDE panel.

See the attached screenshot (made by mcpain@).

Patch (by mcpain@ and zerg@) is attached, too: 
x2goclient-4.1.1.1-window-title-encoding.patch

The client and server OS are: ALT Linux (Sisyphus or p8).
The window manager is KDE.

From 877cc06728efac1ccd7c01d47c25df0166de42e8 Mon Sep 17 00:00:00 2001
From: Oleg Solovyov <[email-masked]>
Date: Fri, 15 Jun 2018 20:55:26 +0300
Subject: [PATCH] fix window title encoding for Unicode (Cyrillic) session
 names

If the session name was written in Cyrillic, the window title would be
displayed incorrectly (as if Unicode was not understood, with strange
symbols) in the task bar in the KDE panel.

Co-authored-by: Sergey V Turchin <[email-masked]>
---
 src/onmainwindow.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index fdc043b..7b2c283 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -11233,6 +11233,12 @@ void ONMainWindow::setProxyWinTitle()
 #ifdef Q_OS_LINUX
 
     XStoreName(QX11Info::display(), proxyWinId, title.toLocal8Bit().data());
+    XChangeProperty(QX11Info::display(), proxyWinId,
+                    XInternAtom(QX11Info::display(), "_NET_WM_NAME", 0),
+                    XInternAtom(QX11Info::display(), "UTF8_STRING", 0), 8,
+                    PropModeReplace,
+                    (unsigned char*) title.toUtf8().data(),
+                    strlen(title.toUtf8().data()));
 
     XWMHints* win_hints;
 
-- 
2.10.4

---

From: Mike Gabriel <[email-masked]>
Date: Wed, 15 Aug 2018 21:06:54 +0000

Hi Ionic,

> The window manager is KDE.

any opinion on this already. Looks ok to me. For nx-libs we have a  
similar issue which I consider fixing by merging the open PR.

Mike
-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: [email-masked], http://das-netzwerkteam.de

---

From: Ivan Zakharyaschev <[email-masked]>
Date: Tue, 24 Dec 2019 03:00:00 +0300 (MSK)

Hi!

ping

> x2goclient-4.1.1.1-window-title-encoding.patch

The patch still applies to 4.1.2.1; like this:

Patch #4 (x2goclient-encoding.patch):
+ /usr/bin/patch -p1
patching file src/onmainwindow.cpp
Hunk #1 succeeded at 10990 (offset -235 lines).

-- 
Best regards,
Ivan

---

From: Юрий Ващенко <[email-masked]>
Date: Fri, 19 Aug 2022 14:10:10 +0300

Hi all

Debian OS, version x2go 4.1.2.2, the problem with Cyrillic remained

The patch helps perfectly.

Why developers have not yet applied it in versions :(