+ XSetWindowAttributes attrib;
+ unsigned long mask;
+ const otk::ScreenInfo *info = otk::display->screenInfo(client->screen());
+
+ // create all of the decor windows (except title bar buttons)
+ mask = CWOverrideRedirect | CWEventMask;
+ attrib.event_mask = Frame::event_mask;
+ attrib.override_redirect = true;
+ _frame = createWindow(info, info->rootWindow(), mask, &attrib);
+
+ mask = 0;
+ _plate = createWindow(info, _frame, mask, &attrib);
+ mask = CWEventMask;
+ attrib.event_mask = (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
+ ExposureMask);
+ _title = createWindow(info, _frame, mask, &attrib);
+ _label = createWindow(info, _title, mask, &attrib);
+ _max = createWindow(info, _title, mask, &attrib);
+ _close = createWindow(info, _title, mask, &attrib);
+ _desk = createWindow(info, _title, mask, &attrib);
+ _icon = createWindow(info, _title, mask, &attrib);
+ _iconify = createWindow(info, _title, mask, &attrib);
+ _handle = createWindow(info, _frame, mask, &attrib);
+ mask |= CWCursor;
+ attrib.cursor = openbox->cursors().ll_angle;
+ _lgrip = createWindow(info, _handle, mask, &attrib);
+ attrib.cursor = openbox->cursors().lr_angle;
+ _rgrip = createWindow(info, _handle, mask, &attrib);
+
+ // the other stuff is shown based on decor settings
+ XMapWindow(**otk::display, _plate);
+ XMapWindow(**otk::display, _lgrip);
+ XMapWindow(**otk::display, _rgrip);
+ XMapWindow(**otk::display, _label);
+
+ applyStyle(*otk::RenderStyle::style(_client->screen()));
+
+ _layout = openbox->screen(_client->screen())->config().titlebar_layout;
+
+ // register all of the windows with the event dispatcher
+ Window *w = allWindows();
+ for (unsigned int i = 0; w[i]; ++i)
+ openbox->registerHandler(w[i], this);
+ delete [] w;