From 64eb8cd6a92f4dfc0caf261b65535b86b3e0f542 Mon Sep 17 00:00:00 2001 From: mathias Date: Sat, 7 May 2005 08:06:23 +0000 Subject: 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. --- src/WinButton.cc | 10 +++++----- 1 file 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() { void WinButton::clear() { FbTk::Button::clear(); - - if (m_type == MENUICON && ( + + // ensure the m_listen_to has actually a client + if (m_type == MENUICON && m_listen_to.numClients() && ( !m_icon_pixmap.drawable() || (m_icon_pixmap.width() != width() - 4 || m_icon_pixmap.height() != height() - 4))) { @@ -339,15 +340,14 @@ void WinButton::clear() { XFree(hints); } - + drawType(); } void WinButton::update(FbTk::Subject *subj) { - // just checking, if we the app provides a pixmap. - if (m_type == MENUICON) { + if (m_type == MENUICON && m_listen_to.numClients()) { XWMHints* hints = XGetWMHints(m_listen_to.fbWindow().display(), m_listen_to.winClient().window()); if (hints == 0) { -- cgit v0.11.2