-
- // position/size all the windows
-
- XResizeWindow(otk::OBDisplay::display, _window,
- _size.left + _size.right + _client->area().width(),
- _size.top + _size.bottom + _client->area().height());
-
- XMoveWindow(otk::OBDisplay::display, _client->window(),
- _size.left, _size.top);
-
- if (_decorations & OBClient::Decor_Titlebar) {
- XMoveResizeWindow(otk::OBDisplay::display, _titlebar,
- _titlebar_area.x(), _titlebar_area.y(),
- _titlebar_area.width(), _titlebar_area.height());
- XMoveResizeWindow(otk::OBDisplay::display, _label,
- _label_area.x(), _label_area.y(),
- _label_area.width(), _label_area.height());
- if (_decorations & OBClient::Decor_Iconify)
- XMoveResizeWindow(otk::OBDisplay::display, _button_iconify,
- _button_iconify_area.x(), _button_iconify_area.y(),
- _button_iconify_area.width(),
- _button_iconify_area.height());
- if (_decorations & OBClient::Decor_Maximize)
- XMoveResizeWindow(otk::OBDisplay::display, _button_max,
- _button_max_area.x(), _button_max_area.y(),
- _button_max_area.width(),
- _button_max_area.height());
- if (_decorations & OBClient::Decor_Sticky)
- XMoveResizeWindow(otk::OBDisplay::display, _button_stick,
- _button_stick_area.x(), _button_stick_area.y(),
- _button_stick_area.width(),
- _button_stick_area.height());
- if (_decorations & OBClient::Decor_Close)
- XMoveResizeWindow(otk::OBDisplay::display, _button_close,
- _button_close_area.x(), _button_close_area.y(),
- _button_close_area.width(),
- _button_close_area.height());
+ // position/size and map/unmap all the windows
+
+ if (decorations & Client::Decor_Titlebar) {
+ XMoveResizeWindow(**otk::display, _title, -geom.bwidth, -geom.bwidth,
+ geom.width, geom.title_height());
+ _innersize.top += geom.title_height() + geom.bwidth;
+ XMapWindow(**otk::display, _title);
+
+ // layout the title bar elements
+ layoutTitle();
+ } else
+ XUnmapWindow(**otk::display, _title);
+
+ 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()));
+
+ renderLabel();