+void XWindow::updateDimentions() {
+ Window root, child;
+ int x, y;
+ unsigned int w, h, b, d;
+
+ if (XGetGeometry(_epist->getXDisplay(), _window, &root, &x, &y, &w, &h,
+ &b, &d) &&
+ XTranslateCoordinates(_epist->getXDisplay(), _window, root, x, y,
+ &x, &y, &child))
+ _rect.setRect(x, y, w, h);
+ else
+ _rect.setRect(0, 0, 1, 1);
+}
+
+
+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;
+
+ // defaults
+ _gravity = NorthWestGravity;
+ _inc_x = _inc_y = 1;
+ _base_x = _base_y = 0;
+
+ if (XGetWMNormalHints(_epist->getXDisplay(), _window, &size, &ret)) {
+ if (size.flags & PWinGravity)
+ _gravity = size.win_gravity;
+ if (size.flags & PBaseSize) {
+ _base_x = size.base_width;
+ _base_y = size.base_height;
+ }
+ if (size.flags & PResizeInc) {
+ _inc_x = size.width_inc;
+ _inc_y = size.height_inc;
+ }
+ }
+}
+
+
+void XWindow::updateWMHints() {
+ XWMHints *hints;
+
+ // assume a window takes input if it doesnt specify
+ _can_focus = True;
+
+ if ((hints = XGetWMHints(_epist->getXDisplay(), _window)) != NULL) {
+ if (hints->flags & InputHint)
+ _can_focus = hints->input;
+ XFree(hints);
+ }
+}
+
+