Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
0509526f
Commit
0509526f
authored
Jan 25, 2018
by
dimbor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nxagent: add setlocale for nxwin windows titles recoding (UTF8_STRING <-> COMPOUND_TEXT)
parent
949b91c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
1 deletion
+65
-1
host.def
nx-X11/config/cf/host.def
+5
-0
Init.c
nx-X11/programs/Xserver/hw/nxagent/Init.c
+17
-0
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+43
-1
No files found.
nx-X11/config/cf/host.def
View file @
0509526f
...
@@ -551,3 +551,8 @@
...
@@ -551,3 +551,8 @@
*
*
#define X86EMU_LIBPATH /usr/local/lib
#define X86EMU_LIBPATH /usr/local/lib
*/
*/
/* Build locales for nxagent */
#define MotifDir $(LIBDIR)
#define XLocaleDir /usr/share/locale
#define XLocaleLibDir $(LIBDIR)
nx-X11/programs/Xserver/hw/nxagent/Init.c
View file @
0509526f
...
@@ -88,6 +88,9 @@ is" without express or implied warranty.
...
@@ -88,6 +88,9 @@ is" without express or implied warranty.
#define NXAGENT_VERSION NX_VERSION_CURRENT
#define NXAGENT_VERSION NX_VERSION_CURRENT
#define NXAGENT_VERSION_STRING NX_VERSION_CURRENT_STRING
#define NXAGENT_VERSION_STRING NX_VERSION_CURRENT_STRING
/* by dimbor */
#include <X11/Xlocale.h>
/*
/*
* ProcVector array defined in tables.c.
* ProcVector array defined in tables.c.
*/
*/
...
@@ -413,6 +416,20 @@ FIXME: These variables, if not removed at all because have probably
...
@@ -413,6 +416,20 @@ FIXME: These variables, if not removed at all because have probably
blackRoot
=
TRUE
;
blackRoot
=
TRUE
;
/* by dimbor */
char
*
locale
=
setlocale
(
LC_ALL
,
""
);
if
(
!
locale
)
fprintf
(
stderr
,
"InitOutput: failed to set locale, reverting to
\"
C
\"\n
"
);
else
{
if
(
!
XSupportsLocale
())
fprintf
(
stderr
,
"InitOutput: Locale %s not supported by X
\n
"
,
locale
);
else
fprintf
(
stderr
,
"InitOutput: Set %s locale
\n
"
,
locale
);
}
if
(
!
XSetLocaleModifiers
(
""
))
fprintf
(
stderr
,
"InitOutput: cannot set locale modifiers.
\n
"
);
nxagentInitKeystrokes
(
False
);
nxagentInitKeystrokes
(
False
);
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
0509526f
...
@@ -42,6 +42,10 @@
...
@@ -42,6 +42,10 @@
#include "compext/Compext.h"
#include "compext/Compext.h"
/* by dimbor */
#include "Xatom.h"
#include <X11/Xlocale.h>
/*
/*
* Set here the required log level.
* Set here the required log level.
*/
*/
...
@@ -110,6 +114,10 @@ static TopLevelParentMap topLevelParentMap = { NULL, 0, 0 };
...
@@ -110,6 +114,10 @@ static TopLevelParentMap topLevelParentMap = { NULL, 0, 0 };
static
void
nxagentRemovePropertyFromList
(
void
);
static
void
nxagentRemovePropertyFromList
(
void
);
/* by dimbor */
static
char
szAgentUTF8_STRING
[]
=
"UTF8_STRING"
;
static
Atom
agentUTF8_STRING
;
/*
/*
* This is currently unused.
* This is currently unused.
*/
*/
...
@@ -436,6 +444,28 @@ Window nxagentRootlessWindowParent(WindowPtr pWin)
...
@@ -436,6 +444,28 @@ Window nxagentRootlessWindowParent(WindowPtr pWin)
}
}
}
}
/* by dimbor */
char
*
textToUTF8String
(
char
*
text
,
int
nitems
)
{
XTextProperty
t_prop
;
char
*
ret
=
NULL
;
t_prop
.
value
=
((
unsigned
char
*
)
text
);
t_prop
.
nitems
=
nitems
;
if
(
!
t_prop
.
nitems
)
return
ret
;
t_prop
.
format
=
8
;
t_prop
.
encoding
=
XInternAtom
(
nxagentDisplay
,
"COMPOUND_TEXT"
,
0
);
char
**
list
;
int
num
;
int
r
=
XmbTextPropertyToTextList
(
nxagentDisplay
,
&
t_prop
,
&
list
,
&
num
);
if
((
r
==
Success
||
r
>
0
)
&&
num
>
0
&&
*
list
)
{
ret
=
(
char
*
)
strdup
(
*
list
);
XFreeStringList
(
list
);
}
return
ret
;
}
int
nxagentExportAllProperty
(
pWin
)
int
nxagentExportAllProperty
(
pWin
)
WindowPtr
pWin
;
WindowPtr
pWin
;
{
{
...
@@ -481,6 +511,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -481,6 +511,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if
(
strncmp
(
propertyS
,
"WM_"
,
3
)
!=
0
&&
if
(
strncmp
(
propertyS
,
"WM_"
,
3
)
!=
0
&&
strncmp
(
propertyS
,
"_NET_"
,
5
)
!=
0
&&
strncmp
(
propertyS
,
"_NET_"
,
5
)
!=
0
&&
strncmp
(
propertyS
,
"_MOTIF_"
,
7
)
!=
0
&&
strcmp
(
propertyS
,
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"
)
!=
0
)
strcmp
(
propertyS
,
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"
)
!=
0
)
{
{
#ifdef TEST
#ifdef TEST
...
@@ -492,6 +523,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -492,6 +523,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
}
}
else
if
(
strcmp
(
typeS
,
"STRING"
)
==
0
||
else
if
(
strcmp
(
typeS
,
"STRING"
)
==
0
||
#ifndef _XSERVER64
#ifndef _XSERVER64
strcmp
(
typeS
,
"_MOTIF_WM_HINTS"
)
==
0
||
strcmp
(
typeS
,
"CARDINAL"
)
==
0
||
strcmp
(
typeS
,
"CARDINAL"
)
==
0
||
strcmp
(
typeS
,
"WM_SIZE_HINTS"
)
==
0
||
strcmp
(
typeS
,
"WM_SIZE_HINTS"
)
==
0
||
#endif
#endif
...
@@ -500,8 +532,18 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -500,8 +532,18 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
output
=
value
;
output
=
value
;
export
=
True
;
export
=
True
;
}
}
/* add by dimbor */
else
if
(
strcmp
(
typeS
,
"COMPOUND_TEXT"
)
==
0
)
{
output
=
textToUTF8String
(
value
,
nUnits
);
nUnits
=
strlen
((
char
*
)
output
);
type
=
MakeAtom
(
szAgentUTF8_STRING
,
strlen
(
szAgentUTF8_STRING
),
True
);
freeMem
=
True
;
export
=
True
;
}
#ifdef _XSERVER64
#ifdef _XSERVER64
else
if
(
strcmp
(
typeS
,
"CARDINAL"
)
==
0
||
strcmp
(
typeS
,
"WM_SIZE_HINTS"
)
==
0
)
else
if
(
strcmp
(
typeS
,
"CARDINAL"
)
==
0
||
strcmp
(
typeS
,
"WM_SIZE_HINTS"
)
==
0
||
strcmp
(
typeS
,
"_MOTIF_WM_HINTS"
)
==
0
)
{
{
/* FIXME: is it okay here to ignore malloc fails? */
/* FIXME: is it okay here to ignore malloc fails? */
unsigned
long
*
buffer
=
malloc
(
nUnits
*
sizeof
(
*
buffer
));
unsigned
long
*
buffer
=
malloc
(
nUnits
*
sizeof
(
*
buffer
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment