- XSetWindowBorder(ob_display, self->window, ob_rr_theme->b_color->pixel);
- XSetWindowBorder(ob_display, self->title, ob_rr_theme->b_color->pixel);
- XSetWindowBorder(ob_display, self->handle, ob_rr_theme->b_color->pixel);
- XSetWindowBorder(ob_display, self->rgrip, ob_rr_theme->b_color->pixel);
- XSetWindowBorder(ob_display, self->lgrip, ob_rr_theme->b_color->pixel);
+ XSetWindowBorder(ob_display, self->window,
+ RrColorPixel(ob_rr_theme->b_color));
+ XSetWindowBorder(ob_display, self->title,
+ RrColorPixel(ob_rr_theme->b_color));
+ XSetWindowBorder(ob_display, self->handle,
+ RrColorPixel(ob_rr_theme->b_color));
+ XSetWindowBorder(ob_display, self->rgrip,
+ RrColorPixel(ob_rr_theme->b_color));
+ XSetWindowBorder(ob_display, self->lgrip,
+ RrColorPixel(ob_rr_theme->b_color));
- /* make the frame's shape match the clients */
- XShapeCombineShape(ob_display, self->window, ShapeBounding,
- self->innersize.left,
- self->innersize.top,
- self->client->window,
- ShapeBounding, ShapeSet);
-
- num = 0;
- if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
- xrect[0].x = -ob_rr_theme->bwidth;
- xrect[0].y = -ob_rr_theme->bwidth;
- xrect[0].width = self->width + self->rbwidth * 2;
- xrect[0].height = ob_rr_theme->title_height +
- self->bwidth * 2;
- ++num;
- }
-
- if (self->decorations & OB_FRAME_DECOR_HANDLE) {
- xrect[1].x = -ob_rr_theme->bwidth;
- xrect[1].y = FRAME_HANDLE_Y(self);
- xrect[1].width = self->width + self->rbwidth * 2;
- xrect[1].height = ob_rr_theme->handle_height +
- self->bwidth * 2;
- ++num;
- }
-
- XShapeCombineRectangles(ob_display, self->window,
- ShapeBounding, 0, 0, xrect, num,
- ShapeUnion, Unsorted);
+ /* make the frame's shape match the clients */
+ XShapeCombineShape(ob_display, self->window, ShapeBounding,
+ self->innersize.left,
+ self->innersize.top,
+ self->client->window,
+ ShapeBounding, ShapeSet);
+
+ num = 0;
+ if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
+ xrect[0].x = -ob_rr_theme->bwidth;
+ xrect[0].y = -ob_rr_theme->bwidth;
+ xrect[0].width = self->width + self->rbwidth * 2;
+ xrect[0].height = ob_rr_theme->title_height +
+ self->bwidth * 2;
+ ++num;
+ }
+
+ if (self->decorations & OB_FRAME_DECOR_HANDLE) {
+ xrect[1].x = -ob_rr_theme->bwidth;
+ xrect[1].y = FRAME_HANDLE_Y(self);
+ xrect[1].width = self->width + self->rbwidth * 2;
+ xrect[1].height = ob_rr_theme->handle_height +
+ self->bwidth * 2;
+ ++num;
+ }
+
+ XShapeCombineRectangles(ob_display, self->window,
+ ShapeBounding, 0, 0, xrect, num,
+ ShapeUnion, Unsorted);
+
+ if (!STRUT_EQUAL(self->size, oldsize)) {
+ gulong vals[4];
+ vals[0] = self->size.left;
+ vals[1] = self->size.right;
+ vals[2] = self->size.top;
+ vals[3] = self->size.bottom;
+ PROP_SETA32(self->client->window, kde_net_wm_frame_strut,
+ cardinal, vals, 4);
+ }
+
+ /* if this occurs while we are focus cycling, the indicator needs to
+ match the changes */
+ if (focus_cycle_target == self->client)
+ focus_cycle_draw_indicator();
- if (XCheckTypedWindowEvent(ob_display, client->window,
- ReparentNotify, &ev)) {
- XPutBackEvent(ob_display, &ev);
-
- /* re-map the window since the unmanaging process unmaps it */
+ while (XCheckTypedWindowEvent(ob_display, client->window,
+ ReparentNotify, &ev))
+ {
+ /* This check makes sure we don't catch our own reparent action to
+ our frame window. This doesn't count as the app reparenting itself
+ away of course.
+
+ Reparent events that are generated by us are just discarded here.
+ They are of no consequence to us anyhow.
+ */
+ if (ev.xreparent.parent != self->plate) {
+ reparent = FALSE;
+ XPutBackEvent(ob_display, &ev);
+ break;
+ }
+ }
- /* XXX ... um no it doesnt it unmaps its parent, the window itself
- retains its mapped state, no?! XXX
- XMapWindow(ob_display, client->window); */
- } else {
- /* according to the ICCCM - if the client doesn't reparent itself,
- then we will reparent the window to root for them */
- XReparentWindow(ob_display, client->window,
+ if (reparent) {
+ /* according to the ICCCM - if the client doesn't reparent itself,
+ then we will reparent the window to root for them */
+ XReparentWindow(ob_display, client->window,
- switch (*lc) {
- case 'N':
- if (!n) break;
- self->icon_x = x;
- XMapWindow(ob_display, self->icon);
- XMoveWindow(ob_display, self->icon, x, ob_rr_theme->padding);
- x += ob_rr_theme->button_size + 2 + ob_rr_theme->padding + 1;
- break;
- case 'D':
- if (!d) break;
- self->desk_x = x;
- XMapWindow(ob_display, self->desk);
- XMoveWindow(ob_display, self->desk, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
- break;
- case 'S':
- if (!s) break;
- self->shade_x = x;
- XMapWindow(ob_display, self->shade);
- XMoveWindow(ob_display, self->shade, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
- break;
- case 'I':
- if (!i) break;
- self->iconify_x = x;
- XMapWindow(ob_display, self->iconify);
- XMoveWindow(ob_display,self->iconify, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
- break;
- case 'L':
- if (!l) break;
- self->label_x = x;
- XMapWindow(ob_display, self->label);
- XMoveWindow(ob_display, self->label, x, ob_rr_theme->padding);
- x += self->label_width + ob_rr_theme->padding + 1;
- break;
- case 'M':
- if (!m) break;
- self->max_x = x;
- XMapWindow(ob_display, self->max);
- XMoveWindow(ob_display, self->max, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
- break;
- case 'C':
- if (!c) break;
- self->close_x = x;
- XMapWindow(ob_display, self->close);
- XMoveWindow(ob_display, self->close, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
- break;
- }
+ switch (*lc) {
+ case 'N':
+ if (!n) break;
+ self->icon_x = x;
+ XMapWindow(ob_display, self->icon);
+ XMoveWindow(ob_display, self->icon, x, ob_rr_theme->padding);
+ x += ob_rr_theme->button_size + 2 + ob_rr_theme->padding + 1;
+ break;
+ case 'D':
+ if (!d) break;
+ self->desk_x = x;
+ XMapWindow(ob_display, self->desk);
+ XMoveWindow(ob_display, self->desk, x, ob_rr_theme->padding + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ break;
+ case 'S':
+ if (!s) break;
+ self->shade_x = x;
+ XMapWindow(ob_display, self->shade);
+ XMoveWindow(ob_display, self->shade, x, ob_rr_theme->padding + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ break;
+ case 'I':
+ if (!i) break;
+ self->iconify_x = x;
+ XMapWindow(ob_display, self->iconify);
+ XMoveWindow(ob_display,self->iconify, x, ob_rr_theme->padding + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ break;
+ case 'L':
+ if (!l) break;
+ self->label_x = x;
+ XMapWindow(ob_display, self->label);
+ XMoveWindow(ob_display, self->label, x, ob_rr_theme->padding);
+ x += self->label_width + ob_rr_theme->padding + 1;
+ break;
+ case 'M':
+ if (!m) break;
+ self->max_x = x;
+ XMapWindow(ob_display, self->max);
+ XMoveWindow(ob_display, self->max, x, ob_rr_theme->padding + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ break;
+ case 'C':
+ if (!c) break;
+ self->close_x = x;
+ XMapWindow(ob_display, self->close);
+ XMoveWindow(ob_display, self->close, x, ob_rr_theme->padding + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ break;
+ }