]> Dogcows Code - chaz/openbox/blobdiff - util/epist/window.cc
toggledecor almost done
[chaz/openbox] / util / epist / window.cc
index 48df206c989b9c9dc18319fe4ae5e643e666e1bc..1e8bc2272de65601935449b604cbb700369c9030 100644 (file)
@@ -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));
+}
This page took 0.021759 seconds and 4 git commands to generate.