diff options
author | markt <markt> | 2007-10-13 21:51:37 (GMT) |
---|---|---|
committer | markt <markt> | 2007-10-13 21:51:37 (GMT) |
commit | a59428d67a95a9df16554962f0a6257d6378328a (patch) | |
tree | f856ed9300c34f7a17d499f22d895610cfbc08e5 /src/Xutil.cc | |
parent | 41b5c6dadb1f474675660cef18b812d4c2338ed2 (diff) | |
download | fluxbox_pavel-a59428d67a95a9df16554962f0a6257d6378328a.zip fluxbox_pavel-a59428d67a95a9df16554962f0a6257d6378328a.tar.bz2 |
merged changes from pre-devel
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 c2fb71f..6a12071 100644 --- a/src/Xutil.cc +++ b/src/Xutil.cc | |||
@@ -56,8 +56,8 @@ FbTk::FbString getWMName(Window window) { | |||
56 | 56 | ||
57 | XTextProperty text_prop; | 57 | XTextProperty text_prop; |
58 | text_prop.value = 0; | 58 | text_prop.value = 0; |
59 | char **list; | 59 | char **list = 0; |
60 | int num; | 60 | int num = 0; |
61 | _FB_USES_NLS; | 61 | _FB_USES_NLS; |
62 | string name; | 62 | string name; |
63 | 63 | ||
@@ -66,15 +66,16 @@ FbTk::FbString getWMName(Window window) { | |||
66 | if (text_prop.encoding != XA_STRING) { | 66 | if (text_prop.encoding != XA_STRING) { |
67 | 67 | ||
68 | text_prop.nitems = strlen((char *) text_prop.value); | 68 | text_prop.nitems = strlen((char *) text_prop.value); |
69 | XmbTextPropertyToTextList(display, &text_prop, &list, &num); | ||
69 | 70 | ||
70 | if ((XmbTextPropertyToTextList(display, &text_prop, | 71 | if (num > 0 && list != 0) |
71 | &list, &num) == Success) && | ||
72 | (num > 0) && *list) { | ||
73 | name = FbTk::FbStringUtil::LocaleStrToFb(static_cast<char *>(*list)); | 72 | name = FbTk::FbStringUtil::LocaleStrToFb(static_cast<char *>(*list)); |
74 | XFreeStringList(list); | 73 | else |
75 | } else | ||
76 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; | 74 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
77 | 75 | ||
76 | if (list) | ||
77 | XFreeStringList(list); | ||
78 | |||
78 | } else | 79 | } else |
79 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; | 80 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
80 | 81 | ||