]> Dogcows Code - chaz/openbox/blobdiff - openbox/framerender.c
no tabs
[chaz/openbox] / openbox / framerender.c
index 4115ceba06073d088a2d52cdd2a76aed86c7551d..093260fbd3cdb252551b287d8136026dd20c63a8 100644 (file)
@@ -1,3 +1,21 @@
+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+   framerender.c for the Openbox window manager
+   Copyright (c) 2003        Ben Jansens
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   See the COPYING file for a copy of the GNU General Public License.
+*/
+
 #include "frame.h"
 #include "openbox.h"
 #include "screen.h"
@@ -15,12 +33,15 @@ static void framerender_close(ObFrame *self, RrAppearance *a);
 
 void framerender_frame(ObFrame *self)
 {
-    if (self->focused)
-        XSetWindowBorder(ob_display, self->plate,
-                         RrColorPixel(ob_rr_theme->cb_focused_color));
-    else
-        XSetWindowBorder(ob_display, self->plate,
-                         RrColorPixel(ob_rr_theme->cb_unfocused_color));
+    {
+        unsigned long px;
+
+        px = (self->focused ?
+              RrColorPixel(ob_rr_theme->cb_focused_color) :
+              RrColorPixel(ob_rr_theme->cb_unfocused_color));
+        XSetWindowBackground(ob_display, self->plate, px);
+        XClearWindow(ob_display, self->plate);
+    }
 
     if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
         RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
@@ -120,34 +141,48 @@ void framerender_frame(ObFrame *self)
 
         RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
 
+        ob_rr_theme->a_clear->surface.parent = t;
+        ob_rr_theme->a_clear->surface.parentx = 0;
+        ob_rr_theme->a_clear->surface.parenty = 0;
+
+        RrPaint(ob_rr_theme->a_clear, self->tlresize,
+                ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+
+        ob_rr_theme->a_clear->surface.parentx =
+            self->width - ob_rr_theme->grip_width;
+
+        RrPaint(ob_rr_theme->a_clear, self->trresize,
+                ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+
+
         /* set parents for any parent relative guys */
         l->surface.parent = t;
         l->surface.parentx = self->label_x;
-        l->surface.parenty = ob_rr_theme->bevel;
+        l->surface.parenty = ob_rr_theme->padding;
 
         m->surface.parent = t;
         m->surface.parentx = self->max_x;
-        m->surface.parenty = ob_rr_theme->bevel + 1;
+        m->surface.parenty = ob_rr_theme->padding + 1;
 
         n->surface.parent = t;
         n->surface.parentx = self->icon_x;
-        n->surface.parenty = ob_rr_theme->bevel;
+        n->surface.parenty = ob_rr_theme->padding;
 
         i->surface.parent = t;
         i->surface.parentx = self->iconify_x;
-        i->surface.parenty = ob_rr_theme->bevel + 1;
+        i->surface.parenty = ob_rr_theme->padding + 1;
 
         d->surface.parent = t;
         d->surface.parentx = self->desk_x;
-        d->surface.parenty = ob_rr_theme->bevel + 1;
+        d->surface.parenty = ob_rr_theme->padding + 1;
 
         s->surface.parent = t;
         s->surface.parentx = self->shade_x;
-        s->surface.parenty = ob_rr_theme->bevel + 1;
+        s->surface.parenty = ob_rr_theme->padding + 1;
 
         c->surface.parent = t;
         c->surface.parentx = self->close_x;
-        c->surface.parenty = ob_rr_theme->bevel + 1;
+        c->surface.parenty = ob_rr_theme->padding + 1;
 
         framerender_label(self, l);
         framerender_max(self, m);
@@ -186,6 +221,8 @@ void framerender_frame(ObFrame *self)
                     ob_rr_theme->grip_width, ob_rr_theme->handle_height);
         }
     }
+
+    XFlush(ob_display);
 }
 
 static void framerender_label(ObFrame *self, RrAppearance *a)
This page took 0.024783 seconds and 4 git commands to generate.