]> Dogcows Code - chaz/openbox/commitdiff
fix shape.
authorDana Jansens <danakj@orodu.net>
Tue, 27 Aug 2002 03:59:51 +0000 (03:59 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 27 Aug 2002 03:59:51 +0000 (03:59 +0000)
a) it didnt work when it added shape after mapping
b) removing shape wouldnt have worked right either

src/Window.cc

index a1567156da20fbacb896249e7b03ea128c848572..32fe86c75c373205b0ea01d379cf1bc96749deb1 100644 (file)
@@ -1631,6 +1631,14 @@ void BlackboxWindow::configureShape(void) {
                           ShapeBounding, 0, 0, xrect, num,
                           ShapeUnion, Unsorted);
 }
+
+
+void BlackboxWindow::clearShape(void) {
+  XShapeCombineMask(blackbox->getXDisplay(), frame.window, ShapeBounding,
+                    frame.margin.left - frame.border_w,
+                    frame.margin.top - frame.border_w,
+                    None, ShapeSet);
+}
 #endif // SHAPE
 
 
@@ -3785,9 +3793,15 @@ void BlackboxWindow::leaveNotifyEvent(const XCrossingEvent*) {
 
 
 #ifdef    SHAPE
-void BlackboxWindow::shapeEvent(XShapeEvent *) {
-  if (blackbox->hasShapeExtensions() && flags.shaped) {
-    configureShape();
+void BlackboxWindow::shapeEvent(XShapeEvent *e) {
+  if (blackbox->hasShapeExtensions()) {
+    if (! e->shaped && flags.shaped) {
+      clearShape();
+      flags.shaped = False;
+    } else if (e->shaped) {
+      configureShape();
+      flags.shaped = True;
+    }
   }
 }
 #endif // SHAPE
This page took 0.025834 seconds and 4 git commands to generate.