]> Dogcows Code - chaz/openbox/commitdiff
only enable automatic composite redirection for the client windows, not the frames...
authorDana Jansens <danakj@orodu.net>
Thu, 21 Jun 2007 05:49:08 +0000 (05:49 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 21 Jun 2007 05:49:08 +0000 (05:49 +0000)
openbox/composite.c
openbox/composite.h
openbox/frame.c
openbox/screen.c

index 93c025ff527f5bf301e76b31b6961908304b8a1e..deedf9651d91fd8f2985518ac280d32fb92cd2dc 100644 (file)
@@ -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)
@@ -71,4 +66,10 @@ Pixmap composite_get_window_pixmap(Window win)
     return XCompositeNameWindowPixmap(ob_display, win);
 }
 
+void composite_enable_for_window(Window win)
+{
+    /* Redirect window contents to offscreen pixmaps */
+    XCompositeRedirectWindow(ob_display, win, CompositeRedirectAutomatic);
+}
+
 #endif
index 94232ffa710b48c50ced2bbb35437d3ff450058e..d20abacb2e7e04e88b28e151ad43e76626230b47 100644 (file)
@@ -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);
index 0b85245652065687e6765b07d1b9745285cbfaa7..25a9214b4146560c58ad534f19e3749bf1d051ca 100644 (file)
@@ -288,6 +288,12 @@ 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;
@@ -313,10 +319,6 @@ void frame_adjust_shape(ObFrame *self)
                                 ShapeUnion, Unsorted);
     }
 
-    if (self->pixmap)
-        XShapeCombineShape(ob_display, self->pixmap, ShapeBounding,
-                           0, 0, self->window, ShapeBounding, ShapeSet);
-
 #endif
 }
 
@@ -923,6 +925,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
@@ -1754,7 +1759,7 @@ 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);
         /*
           self->picture = composite_create_picture(self->window,
           wattrib.visual,
index 4abf5b6ceac19e3abd5f3d04f7df182238ff294c..7e02bff43accde12621ba2eb7438d99b0a24560d 100644 (file)
@@ -27,6 +27,7 @@
 #include "moveresize.h"
 #include "config.h"
 #include "screen.h"
+#include "composite.h"
 #include "client.h"
 #include "session.h"
 #include "frame.h"
This page took 0.032556 seconds and 4 git commands to generate.