aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-22 12:35:03 (GMT)
committerfluxgen <fluxgen>2003-06-22 12:35:03 (GMT)
commit95193fd598968fc0ad5ea113410c6fd6e6042629 (patch)
treeef56dc5e04fe0cced90bf4d7fec29cb0ec149d51 /src/WinClient.cc
parent01a3274e357279c3644b39a5838e48690f7c8746 (diff)
downloadfluxbox-95193fd598968fc0ad5ea113410c6fd6e6042629.zip
fluxbox-95193fd598968fc0ad5ea113410c6fd6e6042629.tar.bz2
moved getWMName to Xutil
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc44
1 files changed, 7 insertions, 37 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index ea29bc2..88be980 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.12 2003/06/15 18:36:16 fluxgen Exp $ 22// $Id: WinClient.cc,v 1.13 2003/06/22 12:35:03 fluxgen Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -29,6 +29,7 @@
29#include "I18n.hh" 29#include "I18n.hh"
30#include "FbAtoms.hh" 30#include "FbAtoms.hh"
31#include "EventManager.hh" 31#include "EventManager.hh"
32#include "Xutil.hh"
32 33
33#include <iostream> 34#include <iostream>
34#include <algorithm> 35#include <algorithm>
@@ -256,39 +257,7 @@ void WinClient::updateTransientInfo() {
256 257
257 258
258void WinClient::updateTitle() { 259void WinClient::updateTitle() {
259 XTextProperty text_prop; 260 m_title = Xutil::getWMName(window());
260 char **list = 0;
261 int num = 0;
262 I18n *i18n = I18n::instance();
263
264 if (getWMName(text_prop)) {
265 if (text_prop.value && text_prop.nitems > 0) {
266 if (text_prop.encoding != XA_STRING) {
267
268 text_prop.nitems = strlen((char *) text_prop.value);
269
270 if (XmbTextPropertyToTextList(FbTk::App::instance()->display(), &text_prop,
271 &list, &num) == Success &&
272 num > 0 && *list) {
273 m_title = static_cast<char *>(*list);
274 XFreeStringList(list);
275 } else
276 m_title = (char *)text_prop.value;
277
278 } else
279 m_title = (char *)text_prop.value;
280 XFree((char *) text_prop.value);
281 } else { // ok, we don't have a name, set default name
282 m_title = i18n->getMessage(
283 FBNLS::WindowSet, FBNLS::WindowUnnamed,
284 "Unnamed");
285 }
286 } else {
287 m_title = i18n->getMessage(
288 FBNLS::WindowSet, FBNLS::WindowUnnamed,
289 "Unnamed");
290 }
291
292} 261}
293 262
294void WinClient::updateIconTitle() { 263void WinClient::updateIconTitle() {
@@ -307,11 +276,12 @@ void WinClient::updateIconTitle() {
307 m_icon_title = (char *)*list; 276 m_icon_title = (char *)*list;
308 XFreeStringList(list); 277 XFreeStringList(list);
309 } else 278 } else
310 m_icon_title = (char *)text_prop.value; 279 m_icon_title = text_prop.value ? (char *)text_prop.value : "";
311 } else 280 } else
312 m_icon_title = (char *)text_prop.value; 281 m_icon_title = text_prop.value ? (char *)text_prop.value : "";
313 282
314 XFree((char *) text_prop.value); 283 if (text_prop.value)
284 XFree((char *) text_prop.value);
315 } else 285 } else
316 m_icon_title = title(); 286 m_icon_title = title();
317 } else 287 } else