aboutsummaryrefslogtreecommitdiff
path: root/src/IconButton.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2005-04-27 17:45:56 (GMT)
committersimonb <simonb>2005-04-27 17:45:56 (GMT)
commit690030444b984e6b348284ae3c88671ee65a530b (patch)
treea0e36a3de8afa6a867f395a37757343e9577a24d /src/IconButton.cc
parent9970dd11c7f9c0d9d91601c9e9785a857ca2c6d8 (diff)
downloadfluxbox_pavel-690030444b984e6b348284ae3c88671ee65a530b.zip
fluxbox_pavel-690030444b984e6b348284ae3c88671ee65a530b.tar.bz2
add rough support for non-default depth pixmaps. Saves us having ghost
holes in windows
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r--src/IconButton.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 4258f13..7918be9 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -226,10 +226,14 @@ void IconButton::update(FbTk::Subject *subj) {
226 if (m_win.clientList().empty()) 226 if (m_win.clientList().empty())
227 return; 227 return;
228 228
229 XWMHints *hints = XGetWMHints(FbTk::App::instance()->display(), m_win.winClient().window()); 229 Display *display = FbTk::App::instance()->display();
230
231 XWMHints *hints = XGetWMHints(display, m_win.winClient().window());
230 if (hints == 0) 232 if (hints == 0)
231 return; 233 return;
232 234
235 int screen = m_win.screen().screenNumber();
236
233 if (m_use_pixmap && (hints->flags & IconPixmapHint) && hints->icon_pixmap != 0) { 237 if (m_use_pixmap && (hints->flags & IconPixmapHint) && hints->icon_pixmap != 0) {
234 // setup icon window 238 // setup icon window
235 m_icon_window.show(); 239 m_icon_window.show();
@@ -237,7 +241,7 @@ void IconButton::update(FbTk::Subject *subj) {
237 int new_width = new_height; 241 int new_width = new_height;
238 m_icon_window.resize((new_width>0) ? new_width : 1, (new_height>0) ? new_height : 1); 242 m_icon_window.resize((new_width>0) ? new_width : 1, (new_height>0) ? new_height : 1);
239 243
240 m_icon_pixmap.copy(hints->icon_pixmap); 244 m_icon_pixmap.copy(hints->icon_pixmap, DefaultDepth(display, screen), screen);
241 m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height()); 245 m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height());
242 246
243 m_icon_window.setBackgroundPixmap(m_icon_pixmap.drawable()); 247 m_icon_window.setBackgroundPixmap(m_icon_pixmap.drawable());
@@ -249,7 +253,7 @@ void IconButton::update(FbTk::Subject *subj) {
249 } 253 }
250 254
251 if(m_use_pixmap && (hints->flags & IconMaskHint)) { 255 if(m_use_pixmap && (hints->flags & IconMaskHint)) {
252 m_icon_mask.copy(hints->icon_mask); 256 m_icon_mask.copy(hints->icon_mask, 0, 0);
253 m_icon_mask.scale(m_icon_pixmap.width(), m_icon_pixmap.height()); 257 m_icon_mask.scale(m_icon_pixmap.width(), m_icon_pixmap.height());
254 } else 258 } else
255 m_icon_mask = 0; 259 m_icon_mask = 0;
@@ -260,7 +264,7 @@ void IconButton::update(FbTk::Subject *subj) {
260#ifdef SHAPE 264#ifdef SHAPE
261 265
262 if (m_icon_mask.drawable() != 0) { 266 if (m_icon_mask.drawable() != 0) {
263 XShapeCombineMask(FbTk::App::instance()->display(), 267 XShapeCombineMask(display,
264 m_icon_window.drawable(), 268 m_icon_window.drawable(),
265 ShapeBounding, 269 ShapeBounding,
266 0, 0, 270 0, 0,