aboutsummaryrefslogtreecommitdiff
path: root/src/IconButton.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2006-04-17 23:34:01 (GMT)
committersimonb <simonb>2006-04-17 23:34:01 (GMT)
commitb9af026688f0945196582af5773d62f5df3f97f3 (patch)
treed97e66e4271480644f3ff2a2c0106730d1f714f4 /src/IconButton.cc
parent3e6def97d18133baf82b596cb742a2f7ef4f9f00 (diff)
downloadfluxbox_pavel-b9af026688f0945196582af5773d62f5df3f97f3.zip
fluxbox_pavel-b9af026688f0945196582af5773d62f5df3f97f3.tar.bz2
iconbutton handling fixes
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r--src/IconButton.cc33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 015065c..11b2c02 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -170,6 +170,7 @@ IconButton::IconButton(const IconbarTool& tool, const FbTk::FbWindow &parent,
170 } 170 }
171 171
172 m_win.hintSig().attach(this); 172 m_win.hintSig().attach(this);
173 m_win.titleSig().attach(this);
173 174
174 FbTk::EventManager::instance()->add(*this, m_icon_window); 175 FbTk::EventManager::instance()->add(*this, m_icon_window);
175 176
@@ -236,13 +237,9 @@ void IconButton::update(FbTk::Subject *subj) {
236 237
237 Display *display = FbTk::App::instance()->display(); 238 Display *display = FbTk::App::instance()->display();
238 239
239 XWMHints *hints = XGetWMHints(display, m_win.winClient().window());
240 if (hints == 0)
241 return;
242
243 int screen = m_win.screen().screenNumber(); 240 int screen = m_win.screen().screenNumber();
244 241
245 if (m_use_pixmap && (hints->flags & IconPixmapHint) && hints->icon_pixmap != 0) { 242 if (m_use_pixmap && m_win.usePixmap()) {
246 // setup icon window 243 // setup icon window
247 m_icon_window.show(); 244 m_icon_window.show();
248 unsigned int w = width(); 245 unsigned int w = width();
@@ -262,7 +259,7 @@ void IconButton::update(FbTk::Subject *subj) {
262 neww = newh; 259 neww = newh;
263 m_icon_window.moveResize(iconx, icony, neww, newh); 260 m_icon_window.moveResize(iconx, icony, neww, newh);
264 261
265 m_icon_pixmap.copy(hints->icon_pixmap, DefaultDepth(display, screen), screen); 262 m_icon_pixmap.copy(m_win.iconPixmap().drawable(), DefaultDepth(display, screen), screen);
266 m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height()); 263 m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height());
267 264
268 // rotate the icon or not?? lets go not for now, and see what they say... 265 // rotate the icon or not?? lets go not for now, and see what they say...
@@ -277,29 +274,27 @@ void IconButton::update(FbTk::Subject *subj) {
277 m_icon_pixmap = 0; 274 m_icon_pixmap = 0;
278 } 275 }
279 276
280 if(m_use_pixmap && (hints->flags & IconMaskHint)) { 277 if(m_use_pixmap && m_win.useMask()) {
281 m_icon_mask.copy(hints->icon_mask, 0, 0); 278 m_icon_mask.copy(m_win.iconMask().drawable(), 0, 0);
282 m_icon_mask.scale(m_icon_pixmap.width(), m_icon_pixmap.height()); 279 m_icon_mask.scale(m_icon_pixmap.width(), m_icon_pixmap.height());
283 m_icon_mask.rotate(orientation()); 280 m_icon_mask.rotate(orientation());
284 } else 281 } else
285 m_icon_mask = 0; 282 m_icon_mask = 0;
286 283
287 XFree(hints);
288 hints = 0;
289
290#ifdef SHAPE 284#ifdef SHAPE
291 285
292 if (m_icon_mask.drawable() != 0) { 286 XShapeCombineMask(display,
293 XShapeCombineMask(display, 287 m_icon_window.drawable(),
294 m_icon_window.drawable(), 288 ShapeBounding,
295 ShapeBounding, 289 0, 0,
296 0, 0, 290 m_icon_mask.drawable(),
297 m_icon_mask.drawable(), 291 ShapeSet);
298 ShapeSet);
299 }
300 292
301#endif // SHAPE 293#endif // SHAPE
302 294
295 if (subj == &(m_win.titleSig()))
296 setText(m_win.title());
297
303 if (subj != 0) { 298 if (subj != 0) {
304 setupWindow(); 299 setupWindow();
305 } else { 300 } else {