X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fwindow.cc;h=1e8bc2272de65601935449b604cbb700369c9030;hb=cc5bde6d00892cf27fcb6e4e0b4974bcecca265f;hp=48df206c989b9c9dc18319fe4ae5e643e666e1bc;hpb=d181f1ad05332c42eb090384666171a142f54b0c;p=chaz%2Fopenbox diff --git a/util/epist/window.cc b/util/epist/window.cc index 48df206c..1e8bc227 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -44,6 +44,7 @@ XWindow::XWindow(epist *epist, screen *screen, Window window) XSelectInput(_epist->getXDisplay(), _window, PropertyChangeMask | StructureNotifyMask); + updateBlackboxAttributes(); updateNormalHints(); updateWMHints(); updateDimentions(); @@ -78,6 +79,23 @@ void XWindow::updateDimentions() { } +void XWindow::updateBlackboxAttributes() { + unsigned long *data; + unsigned long num = PropBlackboxAttributesElements; + + _decorated = true; + + if (_xatom->getValue(_window, + XAtom::blackbox_attributes, XAtom::blackbox_attributes, + num, &data)) { + if (num == PropBlackboxAttributesElements) + if (data[0] & AttribDecoration) + _decorated = (data[4] != DecorNone); + delete data; + } +} + + void XWindow::updateNormalHints() { XSizeHints size; long ret; @@ -436,3 +454,11 @@ void XWindow::maximize(Max max) const { break; } } + + +void XWindow::decorate(bool d) const { + _xatom->sendClientMessage(_screen->rootWindow(), + XAtom::blackbox_change_attributes, + _window, AttribDecoration, + 0, 0, 0, (d ? DecorNormal : DecorNone)); +}