From 643e13bf3de6704f634d60342b738e0002f057b9 Mon Sep 17 00:00:00 2001
From: Pavel Vaynerman <pv@etersoft.ru>
Date: Sat, 9 Jun 2018 14:11:34 +0300
Subject: fix window title encoding (use utf8) for nxagent

---
 nx-X11/programs/Xserver/hw/nxagent/Screen.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'nx-X11/programs/Xserver')

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 6eae711f5..26d46b5cc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -441,8 +441,8 @@ Window nxagentCreateIconWindow(void)
     }
   }
 
-  XSetWMProperties(nxagentDisplay, w,
-                      &windowName, &windowName,
+  Xutf8SetWMProperties(nxagentDisplay, w,
+                      window_name, window_name,
                           NULL , 0 , sizeHints, wmHints, NULL);
 
   if (sizeHints)
@@ -867,6 +867,9 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
 
   int defaultVisualIndex = 0;
 
+  XTextProperty  xtpWmName;
+  char* wmName = nxagentWindowName;
+
   #ifdef TEST
   fprintf(stderr, "nxagentOpenScreen: Called for screen index [%d].\n",
               pScreen->myNum);
@@ -1910,6 +1913,9 @@ N/A
                            nxagentIconPixmap,
                            argv, argc, sizeHints);
 
+    if (Xutf8TextListToTextProperty(nxagentDisplay, &wmName, 1, XCompoundTextStyle, &xtpWmName) >= Success)
+       XSetWMName(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &xtpWmName);
+
     if (sizeHints)
       XFree(sizeHints);
 
-- 
cgit v1.2.3


From 9a7c0b081fad98bfcfcceff9557781f4b39ec572 Mon Sep 17 00:00:00 2001
From: Pavel Vaynerman <pv@etersoft.ru>
Date: Thu, 26 Jul 2018 02:51:00 +0300
Subject: nxagent: Used 'Xutf8SetVMPropertis' instead of
 'XSetStandardProperties' + 'Xutf8SetWMProperties'

---
 nx-X11/programs/Xserver/hw/nxagent/Screen.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

(limited to 'nx-X11/programs/Xserver')

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 26d46b5cc..b7a8f5404 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -867,9 +867,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
 
   int defaultVisualIndex = 0;
 
-  XTextProperty  xtpWmName;
-  char* wmName = nxagentWindowName;
-
   #ifdef TEST
   fprintf(stderr, "nxagentOpenScreen: Called for screen index [%d].\n",
               pScreen->myNum);
@@ -1905,16 +1902,12 @@ N/A
       if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue)
         sizeHints->flags |= USSize;
     }
-    /* FIXME: deprecated, replaced by XSetWmProperties() */
-    XSetStandardProperties(nxagentDisplay,
-                           nxagentDefaultWindows[pScreen->myNum],
-                           nxagentWindowName,
-                           nxagentWindowName,
-                           nxagentIconPixmap,
-                           argv, argc, sizeHints);
-
-    if (Xutf8TextListToTextProperty(nxagentDisplay, &wmName, 1, XCompoundTextStyle, &xtpWmName) >= Success)
-       XSetWMName(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &xtpWmName);
+
+    Xutf8SetWMProperties(nxagentDisplay, 
+                         nxagentDefaultWindows[pScreen->myNum],
+                         nxagentWindowName, 
+                         nxagentWindowName,
+                         argv , argc , &sizeHints, &wmHints, NULL);
 
     if (sizeHints)
       XFree(sizeHints);
-- 
cgit v1.2.3