diff options
author | mathias <mathias> | 2005-05-07 08:06:23 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-05-07 08:06:23 (GMT) |
commit | 64eb8cd6a92f4dfc0caf261b65535b86b3e0f542 (patch) | |
tree | 0b482f87b3c1a18fc50be71a5594dd24a35b2480 /src | |
parent | a65511a32e2fc6e8869ccdcf85c9d6db61ae5f5b (diff) | |
download | fluxbox-64eb8cd6a92f4dfc0caf261b65535b86b3e0f542.zip fluxbox-64eb8cd6a92f4dfc0caf261b65535b86b3e0f542.tar.bz2 |
new code in WinButton was assuming that at ::clear() - time there is always a
valid m_listen_to.winClient() .. which is not true under some circumstance.
i guarded the code accordingly.
Diffstat (limited to 'src')
-rw-r--r-- | src/WinButton.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/WinButton.cc b/src/WinButton.cc index 1a28e8f..33995b4 100644 --- a/src/WinButton.cc +++ b/src/WinButton.cc | |||
@@ -310,8 +310,9 @@ void WinButton::drawType() { | |||
310 | 310 | ||
311 | void WinButton::clear() { | 311 | void WinButton::clear() { |
312 | FbTk::Button::clear(); | 312 | FbTk::Button::clear(); |
313 | 313 | ||
314 | if (m_type == MENUICON && ( | 314 | // ensure the m_listen_to has actually a client |
315 | if (m_type == MENUICON && m_listen_to.numClients() && ( | ||
315 | !m_icon_pixmap.drawable() || | 316 | !m_icon_pixmap.drawable() || |
316 | (m_icon_pixmap.width() != width() - 4 || | 317 | (m_icon_pixmap.width() != width() - 4 || |
317 | m_icon_pixmap.height() != height() - 4))) { | 318 | m_icon_pixmap.height() != height() - 4))) { |
@@ -339,15 +340,14 @@ void WinButton::clear() { | |||
339 | 340 | ||
340 | XFree(hints); | 341 | XFree(hints); |
341 | } | 342 | } |
342 | 343 | ||
343 | drawType(); | 344 | drawType(); |
344 | } | 345 | } |
345 | 346 | ||
346 | void WinButton::update(FbTk::Subject *subj) { | 347 | void WinButton::update(FbTk::Subject *subj) { |
347 | 348 | ||
348 | |||
349 | // just checking, if we the app provides a pixmap. | 349 | // just checking, if we the app provides a pixmap. |
350 | if (m_type == MENUICON) { | 350 | if (m_type == MENUICON && m_listen_to.numClients()) { |
351 | XWMHints* hints = XGetWMHints(m_listen_to.fbWindow().display(), | 351 | XWMHints* hints = XGetWMHints(m_listen_to.fbWindow().display(), |
352 | m_listen_to.winClient().window()); | 352 | m_listen_to.winClient().window()); |
353 | if (hints == 0) { | 353 | if (hints == 0) { |