]> Dogcows Code - chaz/openbox/blobdiff - openbox/frame.c
clearer code paths
[chaz/openbox] / openbox / frame.c
index d88074c6aaf8dca3a7189529a093333c1841f495..04dbe6e2b35cd32bcd80c534f3000092f330f930 100644 (file)
@@ -51,6 +51,7 @@ static void layout_title(ObFrame *self);
 static void set_theme_statics(ObFrame *self);
 static void free_theme_statics(ObFrame *self);
 static gboolean frame_animate_iconify(gpointer self);
+static void frame_adjust_shape(ObFrame *self);
 static void frame_adjust_cursors(ObFrame *self);
 static void frame_get_offscreen_buffer(ObFrame *self);
 static void frame_free_offscreen_buffer(ObFrame *self);
@@ -312,11 +313,6 @@ void frame_adjust_shape(ObFrame *self)
                                 ShapeBounding, 0, 0, xrect, num,
                                 ShapeUnion, Unsorted);
     }
-
-    if (self->pixmap)
-        XShapeCombineShape(ob_display, self->pixmap, ShapeBounding,
-                           0, 0, self->window, ShapeBounding, ShapeSet);
-
 #endif
 }
 
@@ -368,7 +364,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
                   self->cbwidth_l + (!self->max_horz ? self->bwidth : 0),
                   self->cbwidth_t + self->bwidth,
                   self->cbwidth_r + (!self->max_horz ? self->bwidth : 0),
-                  self->cbwidth_b + (!self->max_horz || !self->max_vert ? self->bwidth : 0));
+                  self->cbwidth_b + (!self->max_horz || !self->max_vert ?
+                                     self->bwidth : 0));
 
         if (self->decorations & OB_FRAME_DECOR_TITLEBAR)
             self->size.top += ob_rr_theme->title_height + self->bwidth;
@@ -789,9 +786,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
             framerender_frame(self);
             frame_adjust_shape(self);
 
-            /* the offscreen buffer is invalid when the window is resized */
-            if (self->visible)
-                frame_get_offscreen_buffer(self);
+            /* the offscreen buffer's shape needs to match */
+            frame_get_offscreen_buffer(self);
         }
 
         if (!STRUT_EQUAL(self->size, oldsize)) {
@@ -922,6 +918,9 @@ void frame_grab_client(ObFrame *self)
     /* reparent the client to the frame */
     XReparentWindow(ob_display, self->client->window, self->window, 0, 0);
 
+    /* enable the offscreen composite buffer for the client window */
+    composite_enable_for_window(self->client->window);
+
     /*
       When reparenting the client window, it is usually not mapped yet, since
       this occurs from a MapRequest. However, in the case where Openbox is
@@ -1753,7 +1752,15 @@ static void frame_get_offscreen_buffer(ObFrame *self)
     frame_free_offscreen_buffer(self);
 
     if (self->visible || frame_iconify_animating(self)) {
-        self->pixmap = composite_get_window_pixmap(self->window);
+        self->pixmap = composite_get_window_pixmap(self->client->window);
+
+#ifdef SHAPE
+        /* shape the offscreen buffer to match the window */
+        XShapeCombineShape(ob_display, self->pixmap, ShapeBounding,
+                           0, 0, self->client->window,
+                           ShapeBounding, ShapeSet);
+#endif
+
         /*
           self->picture = composite_create_picture(self->window,
           wattrib.visual,
This page took 0.022979 seconds and 4 git commands to generate.