]> Dogcows Code - chaz/openbox/commitdiff
parent relative for grips
authorDana Jansens <danakj@orodu.net>
Thu, 27 Mar 2003 23:44:46 +0000 (23:44 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 27 Mar 2003 23:44:46 +0000 (23:44 +0000)
engines/openbox/openbox.c

index d8c10c2f0281500ee6592d9cc3c82796caabc77f..7981e8014ab4158e3019396aee899f2b29497827 100644 (file)
@@ -19,7 +19,6 @@
                         f->cbwidth)
 #define BUTTON_SIZE     (LABEL_HEIGHT - 2)
 #define GRIP_WIDTH      (BUTTON_SIZE * 2)
-#define HANDLE_WIDTH(f) (f->width - (GRIP_WIDTH + f->bwidth) * 2)
 
 #define PLATE_EVENTMASK (SubstructureRedirectMask | ButtonPressMask)
 #define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask)
@@ -804,19 +803,32 @@ static void render(ObFrame *self)
     }
 
     if (self->frame.client->decorations & Decor_Handle) {
-        paint(self->handle, (client_focused(self->frame.client) ?
-                             self->a_focused_handle :
-                             self->a_unfocused_handle),
-              GRIP_WIDTH + self->bwidth, 0,
-              HANDLE_WIDTH(self), s_handle_height);
-        paint(self->lgrip, (client_focused(self->frame.client) ?
-                            a_focused_grip :
-                            a_unfocused_grip),
-              0, 0, GRIP_WIDTH, s_handle_height);
-        paint(self->rgrip, (client_focused(self->frame.client) ?
-                            a_focused_grip :
-                            a_unfocused_grip),
-              0, 0, GRIP_WIDTH, s_handle_height);
+        Appearance *h, *g;
+
+        h = (client_focused(self->frame.client) ?
+             self->a_focused_handle : self->a_unfocused_handle);
+        g = (client_focused(self->frame.client) ?
+             a_focused_grip : a_unfocused_grip);
+
+        if (g->surface.data.planar.grad == Background_ParentRelative) {
+            g->surface.data.planar.parent = h;
+            paint(self->handle, h, 0, 0, self->width, s_handle_height);
+        } else {
+            paint(self->handle, h,
+                  GRIP_WIDTH + self->bwidth, 0,
+                  self->width - (GRIP_WIDTH + self->bwidth) * 2,
+                  s_handle_height);
+        }
+
+        g->surface.data.planar.parentx = 0;
+        g->surface.data.planar.parenty = 0;
+
+        paint(self->lgrip, g, 0, 0, GRIP_WIDTH, s_handle_height);
+
+        g->surface.data.planar.parentx = self->width - GRIP_WIDTH;
+        g->surface.data.planar.parenty = 0;
+
+        paint(self->rgrip, g, 0, 0, GRIP_WIDTH, s_handle_height);
     }
 }
 
This page took 0.02605 seconds and 4 git commands to generate.