From 23fc0746e818597a9a070c8113c6905804f1849f Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 18 May 2007 18:20:39 +0000 Subject: some minor changes --- src/WinClient.cc | 11 ++++++----- src/Window.cc | 5 ++--- src/Xutil.cc | 15 ++++++++------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/WinClient.cc b/src/WinClient.cc index 8877a2a..da4810d 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -389,14 +389,15 @@ void WinClient::updateIconTitle() { if (text_prop.value && text_prop.nitems > 0) { if (text_prop.encoding != XA_STRING) { text_prop.nitems = strlen((char *) text_prop.value); + XmbTextPropertyToTextList(display(), &text_prop, &list, &num); - if (XmbTextPropertyToTextList(display(), &text_prop, - &list, &num) == Success && - num > 0 && *list) { + if (num > 0 && list) m_icon_title = (char *)*list; - XFreeStringList(list); - } else + else m_icon_title = text_prop.value ? (char *)text_prop.value : ""; + if (list) + XFreeStringList(list); + } else m_icon_title = text_prop.value ? (char *)text_prop.value : ""; diff --git a/src/Window.cc b/src/Window.cc index b9dd4a6..41cc07d 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -542,10 +542,9 @@ void FluxboxWindow::init() { if (iconic) { iconic = false; iconify(); - } else { + } else if (m_workspace_number == screen().currentWorkspaceID()) { iconic = true; - if (m_workspace_number == screen().currentWorkspaceID()) - deiconify(false); + deiconify(false); } sendConfigureNotify(); diff --git a/src/Xutil.cc b/src/Xutil.cc index c138142..4d4dbc2 100644 --- a/src/Xutil.cc +++ b/src/Xutil.cc @@ -51,8 +51,8 @@ FbTk::FbString getWMName(Window window) { XTextProperty text_prop; text_prop.value = 0; - char **list; - int num; + char **list = 0; + int num = 0; _FB_USES_NLS; string name; @@ -61,15 +61,16 @@ FbTk::FbString getWMName(Window window) { if (text_prop.encoding != XA_STRING) { text_prop.nitems = strlen((char *) text_prop.value); + XmbTextPropertyToTextList(display, &text_prop, &list, &num); - if ((XmbTextPropertyToTextList(display, &text_prop, - &list, &num) == Success) && - (num > 0) && *list) { + if (num > 0 && list != 0) name = FbTk::FbStringUtil::LocaleStrToFb(static_cast(*list)); - XFreeStringList(list); - } else + else name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; + if (list) + XFreeStringList(list); + } else name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; -- cgit v0.11.2