From 9910094bd10d857b250e3e7826a4305695ed23a0 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 1 Jan 2007 07:15:59 +0000 Subject: don't set menuicon background to style's pixmap when the window has an icon --- ChangeLog | 2 ++ src/WinButton.cc | 48 +++++++----------------------------------------- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 940dd40..3e2ca91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Changes for 1.0rc3: *07/01/01: * Happy New Year! + * Don't draw style's menu icon pixmap underneath the program's icon (Mark) + WinButton.cc * Don't run [startup] items in apps file if fluxbox fails to start (Mark) fluxbox.cc/hh * Don't run [startup] items in apps file on reconfigure (Mark) diff --git a/src/WinButton.cc b/src/WinButton.cc index 496e63d..f8421b5 100644 --- a/src/WinButton.cc +++ b/src/WinButton.cc @@ -310,12 +310,13 @@ void WinButton::drawType() { void WinButton::clear() { FbTk::Button::clear(); - - // ensure the m_listen_to has actually a client - if (m_type == MENUICON && !m_listen_to.empty() && ( - !m_icon_pixmap.drawable() || - (m_icon_pixmap.width() != width() - 4 || - m_icon_pixmap.height() != height() - 4))) { + drawType(); +} + +void WinButton::update(FbTk::Subject *subj) { + + // update the menu icon + if (m_type == MENUICON && !m_listen_to.empty()) { Display* display = m_listen_to.fbWindow().display(); int screen = m_listen_to.screen().screenNumber(); @@ -334,41 +335,6 @@ void WinButton::clear() { } - drawType(); -} - -void WinButton::update(FbTk::Subject *subj) { - - // just checking, if we the app provides a pixmap. - if (m_type == MENUICON && !m_listen_to.empty()) { - XWMHints* hints = XGetWMHints(m_listen_to.fbWindow().display(), - m_listen_to.winClient().window()); - if (hints == 0) { - m_icon_pixmap.release(); - m_icon_mask.release(); - } else { - - // no pixmap - if (!((hints->flags & IconPixmapHint) && hints->icon_pixmap != 0)) - m_icon_pixmap.release(); - - // pixmap has changed - if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0 && - hints->icon_pixmap != m_icon_pixmap.drawable()) - m_icon_pixmap.release(); - - // no pixmap-mask - if (!(hints->flags & IconMaskHint)) - m_icon_mask.release(); - - // pixmap-mask has changed - if (hints->flags & IconMaskHint && hints->icon_mask != m_icon_mask.drawable()) - m_icon_mask.release(); - } - - XFree(hints); - } - // pressed_pixmap isn't stateful in any current buttons, so no need // to potentially override that. Just make sure background pm is ok Pixmap my_pm = getBackgroundPixmap(); -- cgit v0.11.2