From 5d7cb45be7dae9db3d08ed96d5bed2c0ead563bc Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 25 Jun 2010 11:48:31 -0400 Subject: [PATCH] add borders --- openbox/composite.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/openbox/composite.c b/openbox/composite.c index b970eb5e..d8be5bca 100644 --- a/openbox/composite.c +++ b/openbox/composite.c @@ -419,7 +419,7 @@ static gboolean composite(gpointer data) struct timeval start, end, dif; GList *it; ObWindow *win; - ObClient *client; + ObClient *client = NULL; if (!composite_enabled()) return FALSE; @@ -566,6 +566,48 @@ static gboolean composite(gpointer data) if (win->alpha && *win->alpha < 0xffffffff) glColor4f(1.0, 1.0, 1.0, 1.0); + if (client && (client->frame->decorations & OB_FRAME_DECOR_BORDER)) { + int a, b, c, d; + a = client->frame->size.left; + b = client->frame->size.right; + c = client->frame->size.top; + d = client->frame->size.bottom; + if (client->frame->focused) + glColor4f(ob_rr_theme->frame_focused_border_color->r/255.0, + ob_rr_theme->frame_focused_border_color->g/255.0, + ob_rr_theme->frame_focused_border_color->b/255.0, + 0.5); + else + glColor4f(ob_rr_theme->frame_unfocused_border_color->r/255.0, + ob_rr_theme->frame_unfocused_border_color->g/255.0, + ob_rr_theme->frame_unfocused_border_color->b/255.0, + 0.5); + glDisable(GL_TEXTURE_2D); + glBegin(GL_QUADS); + glVertex3f(x - a, y - c, 0.0); + glVertex3f(x + w, y - c, 0.0); + glVertex3f(x + w, y, 0.0); + glVertex3f(x - a, y, 0.0); + + glVertex3f(x + w, y - c, 0.0); + glVertex3f(x + w + b, y - c, 0.0); + glVertex3f(x + w + b, y + h + d, 0.0); + glVertex3f(x + w, y + h + d, 0.0); + + glVertex3f(x - a, y + h + d, 0.0); + glVertex3f(x + w, y + h + d, 0.0); + glVertex3f(x + w, y + h, 0.0); + glVertex3f(x - a, y + h, 0.0); + + glVertex3f(x - a, y, 0.0); + glVertex3f(x, y, 0.0); + glVertex3f(x, y + h, 0.0); + glVertex3f(x - a, y + h, 0.0); + glEnd(); + glEnable(GL_TEXTURE_2D); + glColor4f(1.0, 1.0, 1.0, 1.0); + } + obt_display_ignore_errors(TRUE); glXReleaseTexImageEXT(obt_display, win->gpixmap, GLX_FRONT_LEFT_EXT); obt_display_ignore_errors(FALSE); -- 2.34.1