X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframe.c;h=9e176a5079cc6e28a7384dfcd5b464d1ba3df9bd;hb=d9699d14700da5f227f6e5ad708519b1efdd874d;hp=0b85245652065687e6765b07d1b9745285cbfaa7;hpb=d13daff9596c70cefa878efc901c9b877eda2d89;p=chaz%2Fopenbox diff --git a/openbox/frame.c b/openbox/frame.c index 0b852456..9e176a50 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -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 } @@ -759,9 +755,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, frame_client_gravity. */ self->area.x = self->client->area.x; self->area.y = self->client->area.y; - frame_client_gravity(self, &self->area.x, &self->area.y, - self->client->area.width, - self->client->area.height); + frame_client_gravity(self, &self->area.x, &self->area.y); } if (!fake) { @@ -790,9 +784,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)) { @@ -923,6 +916,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 @@ -1406,7 +1402,7 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y) return OB_FRAME_CONTEXT_NONE; } -void frame_client_gravity(ObFrame *self, gint *x, gint *y, gint w, gint h) +void frame_client_gravity(ObFrame *self, gint *x, gint *y) { /* horizontal */ switch (self->client->gravity) { @@ -1469,7 +1465,7 @@ void frame_client_gravity(ObFrame *self, gint *x, gint *y, gint w, gint h) } } -void frame_frame_gravity(ObFrame *self, gint *x, gint *y, gint w, gint h) +void frame_frame_gravity(ObFrame *self, gint *x, gint *y) { /* horizontal */ switch (self->client->gravity) { @@ -1530,7 +1526,7 @@ void frame_rect_to_frame(ObFrame *self, Rect *r) { r->width += self->size.left + self->size.right; r->height += self->size.top + self->size.bottom; - frame_client_gravity(self, &r->x, &r->y, r->width, r->height); + frame_client_gravity(self, &r->x, &r->y); } static void flash_done(gpointer data) @@ -1754,7 +1750,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,