+ if (_decorations & Client::Decor_Handle) {
+ geom.handle_y = _innersize.top + _client->area().height() + geom.cbwidth;
+ XMoveResizeWindow(**otk::display, _handle, -geom.bwidth, geom.handle_y,
+ geom.width, geom.handle_height);
+ XMoveWindow(**otk::display, _lgrip, -geom.bwidth, -geom.bwidth);
+ XMoveWindow(**otk::display, _rgrip,
+ -geom.bwidth + geom.width - geom.grip_width(),
+ -geom.bwidth);
+ _innersize.bottom += geom.handle_height + geom.bwidth;
+ XMapWindow(**otk::display, _handle);
+ } else
+ XUnmapWindow(**otk::display, _handle);
+
+ XResizeWindow(**otk::display, _frame, geom.width,
+ (_client->shaded() ? geom.title_height() :
+ _innersize.top + _innersize.bottom +
+ _client->area().height()));
+
+ // do this in two steps because clients whose gravity is set to
+ // 'Static' don't end up getting moved at all with an XMoveResizeWindow
+ XMoveWindow(**otk::display, _plate, _innersize.left - geom.cbwidth,
+ _innersize.top - geom.cbwidth);
+ XResizeWindow(**otk::display, _plate, _client->area().width(),
+ _client->area().height());
+
+ _size.left = _innersize.left + geom.bwidth;
+ _size.right = _innersize.right + geom.bwidth;
+ _size.top = _innersize.top + geom.bwidth;
+ _size.bottom = _innersize.bottom + geom.bwidth;
+
+ _area = otk::Rect(_area.position(), otk::Size(_client->area().width() +
+ _size.left + _size.right,
+ _client->area().height() +
+ _size.top + _size.bottom));
+
+ // render all the elements
+ int screen = _client->screen();
+ bool focus = _client->focused();
+ if (_decorations & Client::Decor_Titlebar) {
+ render(screen, otk::Size(geom.width, geom.title_height()), _title,
+ &_title_sur, *(focus ? style->titlebarFocusBackground() :
+ style->titlebarUnfocusBackground()), false);
+
+ renderLabel();
+ renderMax();
+ renderDesk();
+ renderIconify();
+ renderIcon();
+ renderClose();
+ }
+
+ if (_decorations & Client::Decor_Handle) {
+ render(screen, otk::Size(geom.width, geom.handle_height), _handle,
+ &_handle_sur, *(focus ? style->handleFocusBackground() :
+ style->handleUnfocusBackground()));
+ render(screen, otk::Size(geom.grip_width(), geom.handle_height), _lgrip,
+ &_grip_sur, *(focus ? style->gripFocusBackground() :
+ style->gripUnfocusBackground()));
+ XSetWindowBackgroundPixmap(**otk::display, _rgrip, _grip_sur->pixmap());
+ XClearWindow(**otk::display, _rgrip);
+ }
+
+ XSetWindowBorder(**otk::display, _plate,
+ focus ? style->clientBorderFocusColor()->pixel() :
+ style->clientBorderUnfocusColor()->pixel());
+
+ adjustShape();
+}