diff -Nur -x '*.orig' -x '*~' ubuntu/metadata/wall.xml.in ubuntu.new/metadata/wall.xml.in
--- ubuntu/metadata/wall.xml.in 2008-04-03 10:22:43.000000000 +0200
+++ ubuntu.new/metadata/wall.xml.in 2008-04-03 10:44:35.000000000 +0200
@@ -261,6 +261,7 @@
<_short>Flip Left
<_long>Flip left
true
+ false
@@ -269,6 +270,7 @@
<_short>Flip Right
<_long>Flip right
true
+ false
@@ -277,6 +279,7 @@
<_short>Flip Up
<_long>Flip up
true
+ false
@@ -285,6 +288,7 @@
<_short>Flip Down
<_long>Flip down
true
+ false
diff -Nur -x '*.orig' -x '*~' ubuntu/src/wall/wall.c ubuntu.new/src/wall/wall.c
--- ubuntu/src/wall/wall.c 2008-04-03 10:22:44.000000000 +0200
+++ ubuntu.new/src/wall/wall.c 2008-04-03 10:43:25.000000000 +0200
@@ -97,6 +97,11 @@
PaintWindowProc paintWindow;
ActivateWindowProc activateWindow;
+ WindowGrabNotifyProc windowGrabNotify;
+ WindowUngrabNotifyProc windowUngrabNotify;
+
+ int grabCount;
+
Bool moving; /* Used to track miniview movement */
Bool showPreview;
@@ -160,6 +165,88 @@
static void
+wallWindowGrabNotify (CompWindow * w, int x, int y,
+ unsigned int state, unsigned int mask)
+{
+ CompScreen *s = w->screen;
+ WALL_SCREEN(s);
+
+ if (ws->grabCount >= 0)
+ {
+ if (!ws->grabCount)
+ {
+ addScreenAction (s, wallGetFlipLeftEdge(s->display));
+ addScreenAction (s, wallGetFlipRightEdge(s->display));
+ addScreenAction (s, wallGetFlipUpEdge(s->display));
+ addScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+
+ ws->grabCount++;
+
+ }
+
+ UNWRAP (ws, s, windowGrabNotify);
+ (*w->screen->windowGrabNotify) (w, x, y, state, mask);
+ WRAP (ws, s, windowGrabNotify, wallWindowGrabNotify);
+}
+
+static void
+wallWindowUngrabNotify (CompWindow * w)
+{
+ CompScreen *s = w->screen;
+ WALL_SCREEN(s);
+
+ if (ws->grabCount >= 0)
+ {
+ ws->grabCount--;
+
+ if (!ws->grabCount)
+ {
+ removeScreenAction (s, wallGetFlipLeftEdge(s->display));
+ removeScreenAction (s, wallGetFlipRightEdge(s->display));
+ removeScreenAction (s, wallGetFlipUpEdge(s->display));
+ removeScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+ }
+
+ UNWRAP (ws, s, windowUngrabNotify);
+ (*w->screen->windowUngrabNotify) (w);
+ WRAP (ws, s, windowUngrabNotify, wallWindowUngrabNotify);
+}
+
+static void
+wallScreenOptionChangeNotify (CompScreen *s, CompOption *opt,
+ WallScreenOptions num)
+{
+ WALL_SCREEN (s);
+
+ if (ws->grabCount == -1 || ws->grabCount > 0)
+ {
+ removeScreenAction (s, wallGetFlipLeftEdge(s->display));
+ removeScreenAction (s, wallGetFlipRightEdge(s->display));
+ removeScreenAction (s, wallGetFlipUpEdge(s->display));
+ removeScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+
+ if (wallGetEdgeflipPointer (s) || wallGetEdgeflipMove (s) ||
+ wallGetEdgeflipDnd (s))
+ {
+ if (!wallGetEdgeflipPointer (s) && !wallGetEdgeflipDnd (s))
+ ws->grabCount = 0;
+ else
+ {
+ ws->grabCount = -1;
+ addScreenAction (s, wallGetFlipLeftEdge(s->display));
+ addScreenAction (s, wallGetFlipRightEdge(s->display));
+ addScreenAction (s, wallGetFlipUpEdge(s->display));
+ addScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+ }
+ else
+ ws->grabCount = -2;
+}
+
+static void
wallClearCairoLayer (cairo_t *cr)
{
cairo_save (cr);
@@ -1868,6 +1955,8 @@
ws->moving = FALSE;
ws->showPreview = FALSE;
+ ws->grabCount = 0;
+
memset (&ws->switcherContext, 0, sizeof (WallCairoContext));
memset (&ws->thumbContext, 0, sizeof (WallCairoContext));
memset (&ws->highlightContext, 0, sizeof (WallCairoContext));
@@ -1881,6 +1970,30 @@
WRAP (ws, s, paintWindow, wallPaintWindow);
WRAP (ws, s, activateWindow, wallActivateWindow);
+ WRAP (ws, s, windowGrabNotify, wallWindowGrabNotify);
+ WRAP (ws, s, windowUngrabNotify, wallWindowUngrabNotify);
+
+ wallSetEdgeflipPointerNotify (s, wallScreenOptionChangeNotify);
+ wallSetEdgeflipMoveNotify (s, wallScreenOptionChangeNotify);
+ wallSetEdgeflipDndNotify (s, wallScreenOptionChangeNotify);
+
+ if (wallGetEdgeflipPointer (s) || wallGetEdgeflipMove (s) ||
+ wallGetEdgeflipDnd (s))
+ {
+ if (!wallGetEdgeflipPointer (s) && !wallGetEdgeflipDnd (s))
+ ws->grabCount = 0;
+ else
+ {
+ ws->grabCount = -1;
+ addScreenAction (s, wallGetFlipLeftEdge(s->display));
+ addScreenAction (s, wallGetFlipRightEdge(s->display));
+ addScreenAction (s, wallGetFlipUpEdge(s->display));
+ addScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+ }
+ else
+ ws->grabCount = -2;
+
s->base.privates[wd->screenPrivateIndex].ptr = ws;
wallCreateCairoContexts (s, TRUE);
@@ -1907,6 +2020,17 @@
UNWRAP (ws, s, paintWindow);
UNWRAP (ws, s, activateWindow);
+ UNWRAP (ws, s, windowGrabNotify);
+ UNWRAP (ws, s, windowUngrabNotify);
+
+ if (ws->grabCount > 0 || ws->grabCount == -1)
+ {
+ removeScreenAction (s, wallGetFlipLeftEdge(s->display));
+ removeScreenAction (s, wallGetFlipRightEdge(s->display));
+ removeScreenAction (s, wallGetFlipUpEdge(s->display));
+ removeScreenAction (s, wallGetFlipDownEdge(s->display));
+ }
+
free(ws);
}