]> Dogcows Code - chaz/openbox/blobdiff - openbox/framerender.c
draw the handle without borders
[chaz/openbox] / openbox / framerender.c
index bbf1398344ccc89eda95b89b5f22b5642627440a..5fdc8a95575c3304ec231393d48ad710701afaae 100644 (file)
@@ -42,6 +42,51 @@ void framerender_frame(ObFrame *self)
               RrColorPixel(ob_rr_theme->cb_unfocused_color));
         XSetWindowBackground(ob_display, self->inner, px);
         XClearWindow(ob_display, self->inner);
+
+        px = (self->focused ?
+              RrColorPixel(ob_rr_theme->frame_focused_border_color) :
+              RrColorPixel(ob_rr_theme->frame_unfocused_border_color));
+
+        XSetWindowBackground(ob_display, self->left, px);
+        XClearWindow(ob_display, self->left);
+        XSetWindowBackground(ob_display, self->right, px);
+        XClearWindow(ob_display, self->right);
+
+        XSetWindowBackground(ob_display, self->titleleft, px);
+        XClearWindow(ob_display, self->titleleft);
+        XSetWindowBackground(ob_display, self->titletop, px);
+        XClearWindow(ob_display, self->titletop);
+        XSetWindowBackground(ob_display, self->titletopleft, px);
+        XClearWindow(ob_display, self->titletopleft);
+        XSetWindowBackground(ob_display, self->titletopright, px);
+        XClearWindow(ob_display, self->titletopright);
+        XSetWindowBackground(ob_display, self->titleright, px);
+        XClearWindow(ob_display, self->titleright);
+        XSetWindowBackground(ob_display, self->titlebottom, px);
+        XClearWindow(ob_display, self->titlebottom);
+
+        XSetWindowBackground(ob_display, self->handleleft, px);
+        XClearWindow(ob_display, self->handleleft);
+        XSetWindowBackground(ob_display, self->handletop, px);
+        XClearWindow(ob_display, self->handletop);
+        XSetWindowBackground(ob_display, self->handleright, px);
+        XClearWindow(ob_display, self->handleright);
+        XSetWindowBackground(ob_display, self->handlebottom, px);
+        XClearWindow(ob_display, self->handlebottom);
+
+        XSetWindowBackground(ob_display, self->lgripleft, px);
+        XClearWindow(ob_display, self->lgripleft);
+        XSetWindowBackground(ob_display, self->lgriptop, px);
+        XClearWindow(ob_display, self->lgriptop);
+        XSetWindowBackground(ob_display, self->lgripbottom, px);
+        XClearWindow(ob_display, self->lgripbottom);
+
+        XSetWindowBackground(ob_display, self->rgripright, px);
+        XClearWindow(ob_display, self->rgripright);
+        XSetWindowBackground(ob_display, self->rgriptop, px);
+        XClearWindow(ob_display, self->rgriptop);
+        XSetWindowBackground(ob_display, self->rgripbottom, px);
+        XClearWindow(ob_display, self->rgripbottom);
     }
 
     if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
@@ -167,9 +212,16 @@ 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;
 
+        ob_rr_theme->a_clear->surface.parentx = ob_rr_theme->grip_width +
+            self->bwidth;
+        RrPaint(ob_rr_theme->a_clear, self->topresize,
+                self->width - (ob_rr_theme->grip_width + self->bwidth) * 2,
+                ob_rr_theme->paddingy + 1);
+
+        ob_rr_theme->a_clear->surface.parentx = 0;
+
         if (ob_rr_theme->grip_width > 0)
             RrPaint(ob_rr_theme->a_clear, self->tltresize,
                     ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1);
@@ -265,7 +317,7 @@ void framerender_frame(ObFrame *self)
 
 static void framerender_label(ObFrame *self, RrAppearance *a)
 {
-    if (self->label_x < 0) return;
+    if (!self->label_on) return;
     /* set the texture's text! */
     a->texture[0].data.text.string = self->client->title;
     RrPaint(a, self->label, self->label_width, ob_rr_theme->label_height);
@@ -275,7 +327,7 @@ static void framerender_icon(ObFrame *self, RrAppearance *a)
 {
     const ObClientIcon *icon;
 
-    if (self->icon_x < 0) return;
+    if (!self->icon_on) return;
 
     icon = client_icon(self->client,
                        ob_rr_theme->button_size + 2,
@@ -294,33 +346,33 @@ static void framerender_icon(ObFrame *self, RrAppearance *a)
 
 static void framerender_max(ObFrame *self, RrAppearance *a)
 {
-    if (self->max_x < 0) return;
+    if (!self->max_on) return;
     RrPaint(a, self->max, ob_rr_theme->button_size, ob_rr_theme->button_size);
 }
 
 static void framerender_iconify(ObFrame *self, RrAppearance *a)
 {
-    if (self->iconify_x < 0) return;
+    if (!self->iconify_on) return;
     RrPaint(a, self->iconify,
             ob_rr_theme->button_size, ob_rr_theme->button_size);
 }
 
 static void framerender_desk(ObFrame *self, RrAppearance *a)
 {
-    if (self->desk_x < 0) return;
+    if (!self->desk_on) return;
     RrPaint(a, self->desk, ob_rr_theme->button_size, ob_rr_theme->button_size);
 }
 
 static void framerender_shade(ObFrame *self, RrAppearance *a)
 {
-    if (self->shade_x < 0) return;
+    if (!self->shade_on) return;
     RrPaint(a, self->shade,
             ob_rr_theme->button_size, ob_rr_theme->button_size);
 }
 
 static void framerender_close(ObFrame *self, RrAppearance *a)
 {
-    if (self->close_x < 0) return;
+    if (!self->close_on) return;
     RrPaint(a, self->close,
             ob_rr_theme->button_size, ob_rr_theme->button_size);
 }
This page took 0.023442 seconds and 4 git commands to generate.