only enable automatic composite redirection for the client windows, not the frames. maybe this will avoid screen artifacts with the crap server support
Dana Jansens danakj@orodu.net
4 files changed,
22 insertions(+),
12 deletions(-)
M
openbox/composite.c
→
openbox/composite.c
@@ -8,6 +8,8 @@ void composite_shutdown(gboolean reconfig) {}
gboolean composite_window_has_alpha(Visual *vis) { return FALSE; } XID composite_get_window_picture(Window win, Visual *vis) { return None; } Pixmap composite_get_window_pixmap(Window win) { return None; } +void composite_setup_root_window() {} +void composite_enable_for_window(Window win) {} #else static Picture root_picture = None;@@ -16,13 +18,6 @@ void composite_startup(gboolean reconfig)
{ if (reconfig) return; if (!extensions_comp) return; - - /* Redirect window contents to offscreen pixmaps */ -/* - XCompositeRedirectSubwindows(ob_display, - RootWindow(ob_display, ob_screen), - CompositeRedirectAutomatic); -*/ } void composite_shutdown(gboolean reconfig)@@ -69,6 +64,12 @@ {
if (!extensions_comp) return None; return XCompositeNameWindowPixmap(ob_display, win); +} + +void composite_enable_for_window(Window win) +{ + /* Redirect window contents to offscreen pixmaps */ + XCompositeRedirectWindow(ob_display, win, CompositeRedirectAutomatic); } #endif
M
openbox/composite.h
→
openbox/composite.h
@@ -7,6 +7,9 @@
void composite_startup(gboolean reconfig); void composite_shutdown(gboolean reconfig); +void composite_setup_root_window(); +void composite_enable_for_window(Window win); + gboolean composite_window_has_alpha(Visual *vis); XID composite_get_window_picture(Window win, Visual *vis); Pixmap composite_get_window_pixmap(Window win);
M
openbox/frame.c
→
openbox/frame.c
@@ -288,6 +288,12 @@ self->size.top,
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;@@ -312,10 +318,6 @@ XShapeCombineRectangles(ob_display, self->window,
ShapeBounding, 0, 0, xrect, num, ShapeUnion, Unsorted); } - - if (self->pixmap) - XShapeCombineShape(ob_display, self->pixmap, ShapeBounding, - 0, 0, self->window, ShapeBounding, ShapeSet); #endif }@@ -922,6 +924,9 @@ */
/* 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@@ -1754,7 +1759,7 @@ {
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); /* self->picture = composite_create_picture(self->window, wattrib.visual,
M
openbox/screen.c
→
openbox/screen.c
@@ -27,6 +27,7 @@ #include "startupnotify.h"
#include "moveresize.h" #include "config.h" #include "screen.h" +#include "composite.h" #include "client.h" #include "session.h" #include "frame.h"