diff options
author | simonb <simonb> | 2006-05-07 03:41:27 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-05-07 03:41:27 (GMT) |
commit | 520f552be79581be50156bb7785e7ef0ce946b07 (patch) | |
tree | 82edcbb794f6b89804a2a7f75e0122afcc074f94 /src/Xutil.cc | |
parent | 0e9fa988ff41cc32a390f70443669a6df45f3e44 (diff) | |
download | fluxbox_pavel-520f552be79581be50156bb7785e7ef0ce946b07.zip fluxbox_pavel-520f552be79581be50156bb7785e7ef0ce946b07.tar.bz2 |
handle utf-8 strings properly.
use utf8 internally
Diffstat (limited to 'src/Xutil.cc')
-rw-r--r-- | src/Xutil.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Xutil.cc b/src/Xutil.cc index 429a9fb..840b106 100644 --- a/src/Xutil.cc +++ b/src/Xutil.cc | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "FbTk/I18n.hh" | 27 | #include "FbTk/I18n.hh" |
28 | #include "FbTk/App.hh" | 28 | #include "FbTk/App.hh" |
29 | #include "FbTk/FbString.hh" | ||
29 | 30 | ||
30 | #include <X11/Xutil.h> | 31 | #include <X11/Xutil.h> |
31 | #include <X11/Xatom.h> | 32 | #include <X11/Xatom.h> |
@@ -35,7 +36,7 @@ using namespace std; | |||
35 | 36 | ||
36 | namespace Xutil { | 37 | namespace Xutil { |
37 | 38 | ||
38 | std::string getWMName(Window window) { | 39 | FbTk::FbString getWMName(Window window) { |
39 | 40 | ||
40 | if (window == None) | 41 | if (window == None) |
41 | return ""; | 42 | return ""; |
@@ -58,22 +59,22 @@ std::string getWMName(Window window) { | |||
58 | if ((XmbTextPropertyToTextList(display, &text_prop, | 59 | if ((XmbTextPropertyToTextList(display, &text_prop, |
59 | &list, &num) == Success) && | 60 | &list, &num) == Success) && |
60 | (num > 0) && *list) { | 61 | (num > 0) && *list) { |
61 | name = static_cast<char *>(*list); | 62 | name = FbTk::FbStringUtil::LocaleStrToFb(static_cast<char *>(*list)); |
62 | XFreeStringList(list); | 63 | XFreeStringList(list); |
63 | } else | 64 | } else |
64 | name = text_prop.value ? (char *)text_prop.value : ""; | 65 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
65 | 66 | ||
66 | } else | 67 | } else |
67 | name = text_prop.value ? (char *)text_prop.value : ""; | 68 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
68 | 69 | ||
69 | XFree(text_prop.value); | 70 | XFree(text_prop.value); |
70 | 71 | ||
71 | } else { // default name | 72 | } else { // default name |
72 | name = _FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"); | 73 | name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME")); |
73 | } | 74 | } |
74 | } else { | 75 | } else { |
75 | // default name | 76 | // default name |
76 | name = _FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"); | 77 | name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME")); |
77 | } | 78 | } |
78 | 79 | ||
79 | return name; | 80 | return name; |