diff options
-rw-r--r-- | src/WinClient.cc | 11 | ||||
-rw-r--r-- | src/Window.cc | 5 | ||||
-rw-r--r-- | 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() { | |||
389 | if (text_prop.value && text_prop.nitems > 0) { | 389 | if (text_prop.value && text_prop.nitems > 0) { |
390 | if (text_prop.encoding != XA_STRING) { | 390 | if (text_prop.encoding != XA_STRING) { |
391 | text_prop.nitems = strlen((char *) text_prop.value); | 391 | text_prop.nitems = strlen((char *) text_prop.value); |
392 | XmbTextPropertyToTextList(display(), &text_prop, &list, &num); | ||
392 | 393 | ||
393 | if (XmbTextPropertyToTextList(display(), &text_prop, | 394 | if (num > 0 && list) |
394 | &list, &num) == Success && | ||
395 | num > 0 && *list) { | ||
396 | m_icon_title = (char *)*list; | 395 | m_icon_title = (char *)*list; |
397 | XFreeStringList(list); | 396 | else |
398 | } else | ||
399 | m_icon_title = text_prop.value ? (char *)text_prop.value : ""; | 397 | m_icon_title = text_prop.value ? (char *)text_prop.value : ""; |
398 | if (list) | ||
399 | XFreeStringList(list); | ||
400 | |||
400 | } else | 401 | } else |
401 | m_icon_title = text_prop.value ? (char *)text_prop.value : ""; | 402 | m_icon_title = text_prop.value ? (char *)text_prop.value : ""; |
402 | 403 | ||
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() { | |||
542 | if (iconic) { | 542 | if (iconic) { |
543 | iconic = false; | 543 | iconic = false; |
544 | iconify(); | 544 | iconify(); |
545 | } else { | 545 | } else if (m_workspace_number == screen().currentWorkspaceID()) { |
546 | iconic = true; | 546 | iconic = true; |
547 | if (m_workspace_number == screen().currentWorkspaceID()) | 547 | deiconify(false); |
548 | deiconify(false); | ||
549 | } | 548 | } |
550 | 549 | ||
551 | sendConfigureNotify(); | 550 | 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) { | |||
51 | 51 | ||
52 | XTextProperty text_prop; | 52 | XTextProperty text_prop; |
53 | text_prop.value = 0; | 53 | text_prop.value = 0; |
54 | char **list; | 54 | char **list = 0; |
55 | int num; | 55 | int num = 0; |
56 | _FB_USES_NLS; | 56 | _FB_USES_NLS; |
57 | string name; | 57 | string name; |
58 | 58 | ||
@@ -61,15 +61,16 @@ FbTk::FbString getWMName(Window window) { | |||
61 | if (text_prop.encoding != XA_STRING) { | 61 | if (text_prop.encoding != XA_STRING) { |
62 | 62 | ||
63 | text_prop.nitems = strlen((char *) text_prop.value); | 63 | text_prop.nitems = strlen((char *) text_prop.value); |
64 | XmbTextPropertyToTextList(display, &text_prop, &list, &num); | ||
64 | 65 | ||
65 | if ((XmbTextPropertyToTextList(display, &text_prop, | 66 | if (num > 0 && list != 0) |
66 | &list, &num) == Success) && | ||
67 | (num > 0) && *list) { | ||
68 | name = FbTk::FbStringUtil::LocaleStrToFb(static_cast<char *>(*list)); | 67 | name = FbTk::FbStringUtil::LocaleStrToFb(static_cast<char *>(*list)); |
69 | XFreeStringList(list); | 68 | else |
70 | } else | ||
71 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; | 69 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
72 | 70 | ||
71 | if (list) | ||
72 | XFreeStringList(list); | ||
73 | |||
73 | } else | 74 | } else |
74 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; | 75 | name = text_prop.value ? FbTk::FbStringUtil::XStrToFb((char *)text_prop.value) : ""; |
75 | 76 | ||