diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-16 21:57:21 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-16 21:57:21 +0000 |
| commit | 136c9c078d33e5784881267be03d8ff1adf41bc5 (patch) | |
| tree | 5b9449a318ff53af4ea9fbed8850eb638451288a /src | |
| parent | 0c2f0e0b5e974bace6b7488541fac0fed23c5bc9 (diff) | |
support for pixmap icons, kwm_win_icon and the icon in wmhints
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 17 | ||||
| -rw-r--r-- | src/client.hh | 12 | ||||
| -rw-r--r-- | src/frame.cc | 5 |
3 files changed, 25 insertions, 9 deletions
diff --git a/src/client.cc b/src/client.cc index 7bf72645..53a6d768 100644 --- a/src/client.cc +++ b/src/client.cc @@ -576,6 +576,17 @@ void Client::updateWMHints(bool initstate) } else // no group! _group = None; + if (hints->flags & IconPixmapHint) { + updateKwmIcon(); // try get the kwm icon first, this is a fallback only + if (_pixmap_icon == None) { + _pixmap_icon = hints->icon_pixmap; + if (hints->flags & IconMaskHint) + _pixmap_icon_mask = hints->icon_mask; + else + _pixmap_icon_mask = None; + } + } + XFree(hints); } @@ -758,15 +769,15 @@ void Client::updateIcons() void Client::updateKwmIcon() { - _kwm_icon = _kwm_icon_mask = None; + _pixmap_icon = _pixmap_icon_mask = None; unsigned long num = 2; Pixmap *data; if (otk::Property::get(_window, otk::Property::atoms.kwm_win_icon, otk::Property::atoms.kwm_win_icon, &num, &data)) { if (num >= 2) { - _kwm_icon = data[0]; - _kwm_icon_mask = data[1]; + _pixmap_icon = data[0]; + _pixmap_icon_mask = data[1]; } delete [] data; } diff --git a/src/client.hh b/src/client.hh index 8d97bfcc..932bac16 100644 --- a/src/client.hh +++ b/src/client.hh @@ -348,8 +348,8 @@ private: //! The number of icons in _icons int _nicons; - Pixmap _kwm_icon; - Pixmap _kwm_icon_mask; + Pixmap _pixmap_icon; + Pixmap _pixmap_icon_mask; //! Retrieves the window's initial gravity void getGravity(); @@ -665,16 +665,16 @@ BB @param window The window id that the Client class should handle */ const Icon *icon(const otk::Size &s) const; - //! Returns the pixmap for the KWM_WIN_ICON specified on the window (or None) + //! Returns the pixmap for the pixmap icon specified on the window (or None) /*! The icon given by Client::icon should take precedence over this icon/mask. */ - Pixmap kwmIcon() const { return _kwm_icon; } - //! Returns the mask for the KWM_WIN_ICON specified on the window (or None) + Pixmap pixmapIcon() const { return _pixmap_icon; } + //! Returns the mask for the pixmap icon specified on the window (or None) /*! The icon given by Client::icon should take precedence over this icon/mask. */ - Pixmap kwmIconMask() const { return _kwm_icon_mask; } + Pixmap pixmapIconMask() const { return _pixmap_icon_mask; } //! Move the window (actually, its frame) to a position. /*! diff --git a/src/frame.cc b/src/frame.cc index d1c206e7..23742be8 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -557,6 +557,11 @@ void Frame::renderIcon() const Icon *icon = _client->icon(otk::Size(geom.button_size, geom.button_size)); control->drawImage(*s, icon->w, icon->h, icon->data); + if (!icon->data) { + Pixmap p = _client->pixmapIcon(), m = _client->pixmapIconMask(); + if (p != None) + control->drawImage(*s, p, m); + } XSetWindowBackgroundPixmap(**otk::display, _icon, s->pixmap()); XClearWindow(**otk::display, _icon); |
