]> Dogcows Code - chaz/openbox/blobdiff - openbox/frame.c
add the iconify action
[chaz/openbox] / openbox / frame.c
index 25a9214b4146560c58ad534f19e3749bf1d051ca..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);
@@ -288,12 +289,6 @@ void frame_adjust_shape(ObFrame *self)
                            self->client->window,
                            ShapeBounding, ShapeSet);
 
-        /* shape the offscreen buffer to match the window */
-        if (self->pixmap)
-            XShapeCombineShape(ob_display, self->pixmap, ShapeBounding,
-                               0, 0, self->client->window,
-                               ShapeBounding, ShapeSet);
-
         num = 0;
         if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
             xrect[0].x = 0;
@@ -318,7 +313,6 @@ void frame_adjust_shape(ObFrame *self)
                                 ShapeBounding, 0, 0, xrect, num,
                                 ShapeUnion, Unsorted);
     }
-
 #endif
 }
 
@@ -792,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)) {
@@ -1760,6 +1753,14 @@ static void frame_get_offscreen_buffer(ObFrame *self)
 
     if (self->visible || frame_iconify_animating(self)) {
         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.025165 seconds and 4 git commands to generate.