add resize corners to the bottom corners of the inner client border

This commit is contained in:
Dana Jansens 2007-08-04 11:38:01 -04:00
parent f94fe1b847
commit 82438c21ec
3 changed files with 69 additions and 2 deletions

View file

@ -130,6 +130,11 @@ ObFrame *frame_new(ObClient *client)
self->innerright = createWindow(self->window, NULL, mask, &attrib);
self->innerbottom = createWindow(self->window, NULL, mask, &attrib);
self->innerblb = createWindow(self->innerbottom, NULL, mask, &attrib);
self->innerbrb = createWindow(self->innerbottom, NULL, mask, &attrib);
self->innerbll = createWindow(self->innerleft, NULL, mask, &attrib);
self->innerbrr = createWindow(self->innerright, NULL, mask, &attrib);
self->title = createWindow(self->window, NULL, mask, &attrib);
self->titleleft = createWindow(self->window, NULL, mask, &attrib);
self->titletop = createWindow(self->window, NULL, mask, &attrib);
@ -388,6 +393,9 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
/* position/size and map/unmap all the windows */
if (!fake) {
gint innercornerheight =
ob_rr_theme->grip_width - self->size.bottom;
if (self->cbwidth_l) {
XMoveResizeWindow(ob_display, self->innerleft,
self->size.left - self->cbwidth_l,
@ -398,6 +406,19 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
} else
XUnmapWindow(ob_display, self->innerleft);
if (self->cbwidth_l && innercornerheight > 0) {
XMoveResizeWindow(ob_display, self->innerbll,
0,
self->client->area.height -
(ob_rr_theme->grip_width -
self->size.bottom),
self->cbwidth_l,
ob_rr_theme->grip_width - self->size.bottom);
XMapWindow(ob_display, self->innerbll);
} else
XUnmapWindow(ob_display, self->innerbll);
if (self->cbwidth_r) {
XMoveResizeWindow(ob_display, self->innerright,
self->size.left + self->client->area.width,
@ -408,6 +429,19 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
} else
XUnmapWindow(ob_display, self->innerright);
if (self->cbwidth_r && innercornerheight > 0) {
XMoveResizeWindow(ob_display, self->innerbrr,
0,
self->client->area.height -
(ob_rr_theme->grip_width -
self->size.bottom),
self->cbwidth_r,
ob_rr_theme->grip_width - self->size.bottom);
XMapWindow(ob_display, self->innerbrr);
} else
XUnmapWindow(ob_display, self->innerbrr);
if (self->cbwidth_t) {
XMoveResizeWindow(ob_display, self->innertop,
self->size.left - self->cbwidth_l,
@ -428,9 +462,26 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
self->cbwidth_l + self->cbwidth_r,
self->cbwidth_b);
XMoveResizeWindow(ob_display, self->innerblb,
0, 0,
ob_rr_theme->grip_width + self->bwidth,
self->cbwidth_b);
XMoveResizeWindow(ob_display, self->innerbrb,
self->client->area.width +
self->cbwidth_l + self->cbwidth_r -
(ob_rr_theme->grip_width + self->bwidth),
0,
ob_rr_theme->grip_width + self->bwidth,
self->cbwidth_b);
XMapWindow(ob_display, self->innerbottom);
} else
XMapWindow(ob_display, self->innerblb);
XMapWindow(ob_display, self->innerbrb);
} else {
XUnmapWindow(ob_display, self->innerbottom);
XUnmapWindow(ob_display, self->innerblb);
XUnmapWindow(ob_display, self->innerbrb);
}
if (self->bwidth) {
gint titlesides;
@ -876,12 +927,16 @@ static void frame_adjust_cursors(ObFrame *self)
XChangeWindowAttributes(ob_display, self->lgripleft, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->lgriptop, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->lgripbottom, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->innerbll, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->innerblb, CWCursor, &a);
a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHEAST : OB_CURSOR_NONE);
XChangeWindowAttributes(ob_display, self->rgrip, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->handleright, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->rgripright, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->rgriptop, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->rgripbottom, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->innerbrr, CWCursor, &a);
XChangeWindowAttributes(ob_display, self->innerbrb, CWCursor, &a);
}
}

View file

@ -120,6 +120,10 @@ struct _ObFrame
Window innertop; /*!< For drawing the inner client border */
Window innerright; /*!< For drawing the inner client border */
Window innerbottom; /*!< For drawing the inner client border */
Window innerblb;
Window innerbll;
Window innerbrb;
Window innerbrr;
Window backback; /*!< A colored window shown while resizing */
Window backfront; /*!< An undrawn-in window, to prevent flashing on
unmap */

View file

@ -59,6 +59,14 @@ void framerender_frame(ObFrame *self)
XClearWindow(ob_display, self->innerright);
XSetWindowBackground(ob_display, self->innerbottom, px);
XClearWindow(ob_display, self->innerbottom);
XSetWindowBackground(ob_display, self->innerbll, px);
XClearWindow(ob_display, self->innerbll);
XSetWindowBackground(ob_display, self->innerbrr, px);
XClearWindow(ob_display, self->innerbrr);
XSetWindowBackground(ob_display, self->innerblb, px);
XClearWindow(ob_display, self->innerblb);
XSetWindowBackground(ob_display, self->innerbrb, px);
XClearWindow(ob_display, self->innerbrb);
px = (self->focused ?
RrColorPixel(ob_rr_theme->frame_focused_border_color) :