All pastes #425284 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-05 12:09 UTC
rendered paste body
diff --git a/plugins/cube.c b/plugins/cube.c
index 6784a45..81a4cf4 100644
--- a/plugins/cube.c
+++ b/plugins/cube.c
@@ -1583,6 +1583,25 @@ cubeApplyScreenTransform (CompScreen		  *s,
     matrixTranslate (transform, -cs->outputXOffset, cs->outputYOffset, 0.0f);
 }
 
+static void
+cubeFoldEvent(CompScreen *s, Bool unfolded)
+{
+    CompOption o[2];
+
+    o[0].type = CompOptionTypeInt;
+    o[0].name = "root";
+    o[0].value.i = s->root;
+
+    o[1].type = CompOptionTypeBool;
+    o[1].name = "unfolded";
+    o[1].value.b = unfolded;
+
+    (*s->display->handleCompizEvent) (s->display, 
+				      "cube", 
+				      "unfoldEvent", 
+				      o, 2);
+}
+
 static Bool
 cubeUnfold (CompDisplay     *d,
 	    CompAction      *action,
@@ -1611,6 +1630,7 @@ cubeUnfold (CompDisplay     *d,
 
 	if (cs->grabIndex)
 	{
+	    cubeFoldEvent (s, TRUE);
 	    cs->unfolded = TRUE;
 	    damageScreen (s);
 	}
@@ -1646,6 +1666,7 @@ cubeFold (CompDisplay     *d,
 
 	if (cs->grabIndex)
 	{
+	    cubeFoldEvent (s, FALSE);
 	    cs->unfolded = FALSE;
 	    damageScreen (s);
 	}