compiz team mailing list archive
-
compiz team
-
Mailing list archive
-
Message #23130
[Merge] lp:~smspillaz/compiz/compiz.SRU1 into lp:compiz
Sam Spilsbury has proposed merging lp:~smspillaz/compiz/compiz.SRU1 into lp:compiz.
Requested reviews:
compiz packagers (compiz)
For more details, see:
https://code.launchpad.net/~smspillaz/compiz/compiz.SRU1/+merge/78647
SRU 1 Changes
--
https://code.launchpad.net/~smspillaz/compiz/compiz.SRU1/+merge/78647
Your team compiz packagers is requested to review the proposed merge of lp:~smspillaz/compiz/compiz.SRU1 into lp:compiz.
=== added file 'debian/patches/fix-748840.patch'
--- debian/patches/fix-748840.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-748840.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,14 @@
+=== modified file 'src/window.cpp'
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-08 00:52:01.411641789 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-08 00:52:15.907713677 +0800
+@@ -4137,7 +4137,7 @@
+ * window may not be allowed). */
+ if (p && PrivateWindow::validSiblingBelow (p, this))
+ {
+- p = PrivateWindow::findValidStackSiblingBelow (sibling, p);
++ p = PrivateWindow::findValidStackSiblingBelow (this, p);
+
+ /* if we found a valid sibling under the active window, it's
+ our new sibling we want to stack above */
=== added file 'debian/patches/fix-853951.patch'
--- debian/patches/fix-853951.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-853951.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,14 @@
+=== modified file 'plugins/decor/src/decor.cpp'
+Index: compiz-0.9.6+bzr20110929/plugins/decor/src/decor.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/plugins/decor/src/decor.cpp 2011-10-03 23:00:04.239603147 +0800
++++ compiz-0.9.6+bzr20110929/plugins/decor/src/decor.cpp 2011-10-03 23:00:10.751635440 +0800
+@@ -189,6 +189,8 @@
+ if (wd &&
+ wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP)
+ {
++
++
+ CompRect box;
+ GLTexture::MatrixList ml (1);
+ mask |= PAINT_WINDOW_BLEND_MASK;
=== added file 'debian/patches/fix-857487.patch'
--- debian/patches/fix-857487.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-857487.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,14 @@
+=== modified file 'src/window.cpp'
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-08 00:53:38.748124448 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-08 00:53:59.804228858 +0800
+@@ -4137,7 +4137,7 @@
+ * window may not be allowed). */
+ if (p && PrivateWindow::validSiblingBelow (p, this))
+ {
+- p = PrivateWindow::findValidStackSiblingBelow (this, p);
++ p = PrivateWindow::findValidStackSiblingBelow (sibling, p);
+
+ /* if we found a valid sibling under the active window, it's
+ our new sibling we want to stack above */
=== added file 'debian/patches/fix-857737-part2.patch'
--- debian/patches/fix-857737-part2.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-857737-part2.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,31 @@
+=== modified file 'src/window.cpp'
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-04 18:02:27.259019110 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-04 18:02:50.495134327 +0800
+@@ -1426,6 +1426,7 @@
+ priv->id = 0;
+ priv->frame = 0;
+ priv->serverFrame = 0;
++ priv->managed = false;
+ }
+
+ priv->destroyRefCnt--;
+@@ -3421,7 +3422,7 @@
+ }
+ }
+ }
+- else
++ else if (priv->id)
+ {
+ priv->reconfigureXWindow (valueMask, xwc);
+ }
+@@ -3861,7 +3862,7 @@
+ * if serverPrev was recently restacked */
+ if (window->serverPrev)
+ {
+- if (!sibling)
++ if (!sibling && id)
+ {
+ XWindowChanges lxwc;
+ unsigned int valueMask = CWStackMode;
=== added file 'debian/patches/fix-857738-part1.patch'
--- debian/patches/fix-857738-part1.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-857738-part1.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,31 @@
+=== modified file 'src/screen.cpp'
+Index: compiz-0.9.6+bzr20110929/src/screen.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/screen.cpp 2011-10-04 18:03:01.075186789 +0800
++++ compiz-0.9.6+bzr20110929/src/screen.cpp 2011-10-04 18:03:11.191236955 +0800
+@@ -2711,6 +2711,12 @@
+ CompWindowList::iterator it =
+ std::find (priv->windows.begin (), priv->windows.end (), w);
+
++ if (it == priv->windows.end ())
++ {
++ compLogMessage ("core", CompLogLevelWarn, "a broken plugin tried to remove a window twice, we won't allow that!");
++ return;
++ }
++
+ priv->windows.erase (it);
+ priv->eraseWindowFromMap (w->id ());
+
+@@ -2738,6 +2744,12 @@
+ CompWindowList::iterator it =
+ std::find (priv->serverWindows.begin (), priv->serverWindows.end (), w);
+
++ if (it == priv->serverWindows.end ())
++ {
++ compLogMessage ("core", CompLogLevelWarn, "a broken plugin tried to remove a window twice, we won't allow that!");
++ return;
++ }
++
+ priv->serverWindows.erase (it);
+
+ if (w->serverNext)
=== added file 'debian/patches/fix-863328.patch'
--- debian/patches/fix-863328.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-863328.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,56 @@
+=== modified file 'plugins/scale/src/privates.h'
+Index: compiz-0.9.6+bzr20110929/plugins/scale/src/privates.h
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/plugins/scale/src/privates.h 2011-10-08 00:54:30.544381292 +0800
++++ compiz-0.9.6+bzr20110929/plugins/scale/src/privates.h 2011-10-08 00:54:45.140453671 +0800
+@@ -176,6 +176,7 @@
+
+ GLfloat xVelocity, yVelocity, scaleVelocity;
+ GLfloat scale;
++ GLfloat lastTargetScale;
+ GLfloat tx, ty;
+ float delta;
+ bool adjust;
+Index: compiz-0.9.6+bzr20110929/plugins/scale/src/scale.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/plugins/scale/src/scale.cpp 2011-10-08 00:54:30.556381359 +0800
++++ compiz-0.9.6+bzr20110929/plugins/scale/src/scale.cpp 2011-10-08 00:54:45.144453690 +0800
+@@ -261,6 +261,17 @@
+
+ bool drawScaled = false;
+
++ /* Windows that wouldn't be visible before and after entering
++ * scale mode (because some plugin modified CompWindow::focus)
++ * should be faded in and out */
++ if (window->state () & CompWindowStateHiddenMask)
++ {
++ if (priv->slot)
++ attrib.opacity *= (1.0f - priv->scale) / (1.0f - priv->slot->scale);
++ else
++ attrib.opacity *= (1.0f - priv->scale) / (1.0f - priv->lastTargetScale);
++ }
++
+ if (priv->adjust || priv->slot)
+ {
+ if (priv->window->id () != priv->spScreen->selectedWindow &&
+@@ -940,9 +951,12 @@
+
+ if (sw->priv->slot)
+ {
++ sw->priv->lastTargetScale = sw->priv->slot->scale;
+ sw->priv->slot = NULL;
+ sw->priv->adjust = true;
+ }
++ else
++ sw->priv->lastTargetScale = 1.0f;
+ }
+
+ if (state & CompAction::StateCancel)
+@@ -1759,6 +1773,7 @@
+ yVelocity (0.0),
+ scaleVelocity (0.0),
+ scale (1.0),
++ lastTargetScale (1.0f),
+ tx (0.0),
+ ty (0.0),
+ delta (1.0),
=== added file 'debian/patches/fix-865863.patch'
--- debian/patches/fix-865863.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-865863.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,110 @@
+=== modified file 'src/event.cpp'
+Index: compiz-0.9.6+bzr20110929/src/event.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/event.cpp 2011-10-08 00:55:10.236578114 +0800
++++ compiz-0.9.6+bzr20110929/src/event.cpp 2011-10-08 00:55:24.972651184 +0800
+@@ -1239,59 +1239,66 @@
+ }
+ break;
+ case ReparentNotify:
++
+ w = findWindow (event->xreparent.window);
+
+- /* It is possible that some plugin might call
+- * w->destroy () before the window actually receives
+- * its first ReparentNotify event which would mean
+- * that it is already in the list of destroyed
+- * windows, so check that list too */
++ /* If this window isn't part of our tracked window
++ * list and was reparented into the root window then
++ * we need to track it */
+ if (!w)
+ {
+- foreach (CompWindow *dw, screen->priv->destroyedWindows)
++ if (event->xreparent.parent == priv->root)
++ {
++ /* Failure means that window has been destroyed. We still have to add
++ * the window to the window list as we might get configure requests
++ * which require us to stack other windows relative to it. Setting
++ * some default values if this is the case. */
++ if (!XGetWindowAttributes (priv->dpy, event->xcreatewindow.window, &wa))
++ priv->setDefaultWindowAttributes (&wa);
++
++ CoreWindow *cw = new CoreWindow (event->xcreatewindow.window);
++ cw->manage (priv->getTopWindow (), wa);
++
++ priv->createdWindows.remove (cw);
++ delete cw;
++ break;
++ }
++ else
+ {
+- if (dw->priv->serverId == event->xdestroywindow.window)
++ /* It is possible that some plugin might call
++ * w->destroy () before the window actually receives
++ * its first ReparentNotify event which would mean
++ * that it is already in the list of destroyed
++ * windows, so check that list too */
++
++ foreach (CompWindow *dw, screen->priv->destroyedWindows)
+ {
+- w = dw;
+- break;
++ if (dw->priv->serverId == event->xreparent.window)
++ {
++ w = dw;
++ break;
++ }
+ }
+ }
+ }
+
+- if (!w && event->xreparent.parent == priv->root)
+- {
+- /* Failure means that window has been destroyed. We still have to add
+- * the window to the window list as we might get configure requests
+- * which require us to stack other windows relative to it. Setting
+- * some default values if this is the case. */
+- if (!XGetWindowAttributes (priv->dpy, event->xcreatewindow.window, &wa))
+- priv->setDefaultWindowAttributes (&wa);
+-
+- CoreWindow *cw = new CoreWindow (event->xcreatewindow.window);
+- cw->manage (priv->getTopWindow (), wa);
++ /* This is the only case where a window is removed but not
++ destroyed. We must remove our event mask and all passive
++ grabs. */
+
+- priv->createdWindows.remove (cw);
+- delete cw;
+- }
+- else if (!(event->xreparent.parent == priv->root))
++ if (w)
+ {
+- /* This is the only case where a window is removed but not
+- destroyed. We must remove our event mask and all passive
+- grabs. */
+-
+- if (w)
++ if (event->xreparent.parent != w->priv->wrapper)
+ {
+- if (event->xreparent.parent != w->priv->wrapper)
+- {
+- w->moveInputFocusToOtherWindow ();
+- w->destroy ();
++ w->moveInputFocusToOtherWindow ();
++ w->destroy ();
+
+- XSelectInput (priv->dpy, w->id (), NoEventMask);
+- XShapeSelectInput (priv->dpy, w->id (), NoEventMask);
+- XUngrabButton (priv->dpy, AnyButton, AnyModifier, w->id ());
+- }
++ XSelectInput (priv->dpy, w->id (), NoEventMask);
++ XShapeSelectInput (priv->dpy, w->id (), NoEventMask);
++ XUngrabButton (priv->dpy, AnyButton, AnyModifier, w->id ());
+ }
+- }
++ }
++
+ break;
+ case CirculateNotify:
+ w = findWindow (event->xcirculate.window);
=== added file 'debian/patches/fix-866752.patch'
--- debian/patches/fix-866752.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-866752.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,597 @@
+=== modified file 'src/privatescreen.h'
+Index: compiz-0.9.6+bzr20110929/src/privatescreen.h
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/privatescreen.h 2011-09-29 14:53:38.000000000 +0800
++++ compiz-0.9.6+bzr20110929/src/privatescreen.h 2011-10-08 01:32:56.247814665 +0800
+@@ -35,6 +35,7 @@
+ #include <core/timer.h>
+ #include <core/plugin.h>
+ #include <time.h>
++#include <boost/shared_ptr.hpp>
+
+ #include <glibmm/main.h>
+
+@@ -100,6 +101,70 @@
+ unsigned int viewportY;
+ };
+
++namespace compiz
++{
++namespace X11
++{
++class PendingEvent {
++public:
++ PendingEvent (Display *, Window);
++ virtual ~PendingEvent ();
++
++ virtual bool match (XEvent *);
++
++ typedef boost::shared_ptr<PendingEvent> Ptr;
++
++protected:
++
++ virtual Window getEventWindow (XEvent *);
++
++ unsigned int mSerial;
++ Window mWindow;
++};
++
++class PendingConfigureEvent :
++ public PendingEvent
++{
++public:
++ PendingConfigureEvent (Display *, Window, unsigned int, XWindowChanges *);
++ virtual ~PendingConfigureEvent ();
++
++ virtual bool match (XEvent *);
++ bool matchVM (unsigned int valueMask);
++
++ typedef boost::shared_ptr<PendingConfigureEvent> Ptr;
++
++protected:
++
++ virtual Window getEventWindow (XEvent *);
++
++private:
++ unsigned int mValueMask;
++ XWindowChanges mXwc;
++};
++
++class PendingEventQueue
++{
++public:
++
++ PendingEventQueue (Display *);
++ virtual ~PendingEventQueue ();
++
++ void add (PendingEvent::Ptr p);
++ bool match (XEvent *);
++ bool pending ();
++ bool forEachIf (boost::function <bool (compiz::X11::PendingEvent::Ptr)>);
++
++protected:
++ bool removeIfMatching (const PendingEvent::Ptr &p, XEvent *);
++
++private:
++ std::list <PendingEvent::Ptr> mEvents;
++};
++
++}
++}
++
+ class PrivateScreen :
+ public ValueHolder,
+ public CoreOptions
+Index: compiz-0.9.6+bzr20110929/src/privatewindow.h
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/privatewindow.h 2011-09-29 14:53:38.000000000 +0800
++++ compiz-0.9.6+bzr20110929/src/privatewindow.h 2011-10-08 01:32:56.247814665 +0800
+@@ -289,7 +289,7 @@
+
+ typedef std::pair <XWindowChanges, unsigned int> XWCValueMask;
+
+- std::list <XWCValueMask> pendingConfigures;
++ compiz::X11::PendingEventQueue pendingConfigures;
+ bool pendingPositionUpdates;
+
+ struct timeval lastConfigureRequest;
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-08 01:32:53.175799424 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-08 01:39:03.445635494 +0800
+@@ -809,9 +809,6 @@
+ else
+ serverFrameGeometry.setHeight (xwc.height);
+
+- addPendingConfigure (xwc, valueMask);
+-
+-
+ /* Geometry is the same, so we're not going to get a ConfigureNotify
+ * event when the window is configured, which means that other plugins
+ * won't know that the client, frame and wrapper windows got shifted
+@@ -868,6 +865,14 @@
+
+ }
+
++ gettimeofday (&lastConfigureRequest, NULL);
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), serverFrame, valueMask, &xwc)));
++
++ pendingConfigures.add (pc);
++
+ XSendEvent (screen->dpy (), screen->root (), false,
+ SubstructureNotifyMask, (XEvent *) &xev);
+
+@@ -875,7 +880,16 @@
+ XSync (screen->dpy (), false);
+ }
+ else
++ {
++ gettimeofday (&lastConfigureRequest, NULL);
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), serverFrame, valueMask, &xwc)));
++
++ pendingConfigures.add (pc);
+ XConfigureWindow (screen->dpy (), serverFrame, valueMask, &xwc);
++ }
+ if (shaded)
+ {
+ XUnmapWindow (screen->dpy (), wrapper);
+@@ -923,8 +937,6 @@
+ else
+ serverFrameGeometry.setHeight (xwc.height);
+
+- addPendingConfigure (xwc, valueMask);
+-
+
+ /* Geometry is the same, so we're not going to get a ConfigureNotify
+ * event when the window is configured, which means that other plugins
+@@ -989,7 +1001,16 @@
+ XSync (screen->dpy (), false);
+ }
+ else
++ {
++ gettimeofday (&lastConfigureRequest, NULL);
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), serverFrame, valueMask, &xwc)));
++
++ pendingConfigures.add (pc);
+ XConfigureWindow (screen->dpy (), serverFrame, valueMask, &xwc);
++ }
+
+ if (shaded)
+ {
+@@ -1984,7 +2005,6 @@
+ int x, y, width, height;
+ CompWindow *above;
+ unsigned int valueMask = 0;
+- bool handled = false;
+
+ if (!priv->frame)
+ return;
+@@ -2016,61 +2036,15 @@
+ valueMask |= CWSibling | CWStackMode;
+ }
+
+- for (std::list <XWCValueMask>::iterator it = pendingConfigures.begin ();
+- it != pendingConfigures.end (); it++)
+- {
+- XWCValueMask &xwcvm = (*it);
+-
+-
+- if (xwcvm.second != valueMask)
+- {
+- /* For stacking cases, if a client wants to raise or lower a window
+- * then they don't need to specify CWSibling, so allow that to be
+- * excluded in those cases */
+-
+- if (ce->above == ROOTPARENT (screen->windows ().back ()) ||
+- ce->above == 0)
+- {
+- if ((xwcvm.second & ~(CWSibling)) != valueMask)
+- continue;
+- }
+- else
+- continue;
+- }
+-
+- if (xwcvm.second & CWX && xwcvm.first.x != ce->x)
+- continue;
+-
+- if (xwcvm.second & CWY && xwcvm.first.y != ce->y)
+- continue;
+-
+- if (xwcvm.second & CWWidth && xwcvm.first.width != ce->width)
+- continue;
+-
+- if (xwcvm.second & CWHeight && xwcvm.first.height != ce->height)
+- continue;
+-
+- if (xwcvm.second & (CWStackMode | CWSibling) && xwcvm.first.sibling != ce->above)
+- continue;
+-
+- /* Matched ConfigureWindow request to ConfigureNotify event
+- * remove it from the list */
+-
+- handled = true;
+-
+- pendingConfigures.erase (it);
+- break;
+- }
+-
+- if (!handled)
++ if (!pendingConfigures.match ((XEvent *) ce))
+ {
+ compLogMessage ("core", CompLogLevelWarn, "unhandled ConfigureNotify on 0x%x!", serverFrame);
+- compLogMessage ("core", CompLogLevelWarn, "this should never happen. you should"\
++ compLogMessage ("core", CompLogLevelWarn, "this should never happen. you should "\
+ "probably file a bug about this.");
+ #ifdef DEBUG
+ abort ();
+ #else
+- pendingConfigures.clear ();
++ pendingConfigures = compiz::X11::PendingEventQueue (screen->dpy ());
+ #endif
+ }
+
+@@ -2101,7 +2075,7 @@
+ if (above)
+ above->priv->updatePassiveButtonGrabs ();
+
+- if (pendingConfigures.empty ())
++ if (!pendingConfigures.pending ())
+ {
+ /* Tell plugins its ok to start doing stupid things again but
+ * obviously FIXME */
+@@ -2149,7 +2123,7 @@
+ * and a FIXME in any case, however, until we can break the API
+ * and remove CompWindow::move, this will need to be the case */
+
+- if (!priv->pendingConfigures.size ())
++ if (!priv->pendingConfigures.pending ())
+ {
+ priv->geometry.setX (priv->geometry.x () + dx);
+ priv->geometry.setY (priv->geometry.y () + dy);
+@@ -2191,34 +2165,194 @@
+ {
+ compLogMessage ("core", CompLogLevelWarn, "failed to receive ConfigureNotify event from request at %i (now: %i)\n",
+ priv->lastConfigureRequest.tv_usec, tv.tv_usec);
+- priv->pendingConfigures.clear ();
++ priv->pendingConfigures = compiz::X11::PendingEventQueue (screen->dpy ());
+ }
+ }
+ }
+ }
+
++bool
++compiz::X11::PendingEventQueue::pending ()
++{
++ return !mEvents.empty ();
++}
++
+ void
+-PrivateWindow::addPendingConfigure (XWindowChanges &xwc, unsigned int valueMask)
++compiz::X11::PendingEventQueue::add (PendingEvent::Ptr p)
++{
++ mEvents.push_back (p);
++}
++
++bool
++compiz::X11::PendingEventQueue::removeIfMatching (const PendingEvent::Ptr &p, XEvent *event)
++{
++ return p->match (event);
++}
++
++bool
++compiz::X11::PendingEventQueue::match (XEvent *event)
++{
++ unsigned int lastSize = mEvents.size ();
++
++ mEvents.erase (std::remove_if (mEvents.begin (), mEvents.end (),
++ boost::bind (&compiz::X11::PendingEventQueue::removeIfMatching, this, _1, event)), mEvents.end ());
++
++ return lastSize != mEvents.size ();
++}
++
++bool
++compiz::X11::PendingEventQueue::forEachIf (boost::function<bool (compiz::X11::PendingEvent::Ptr)> f)
++{
++ foreach (compiz::X11::PendingEvent::Ptr p, mEvents)
++ {
++ if (f (p))
++ return true;
++ }
++
++ return false;
++}
++
++compiz::X11::PendingEventQueue::PendingEventQueue (Display *d)
++{
++}
++
++compiz::X11::PendingEventQueue::~PendingEventQueue ()
++{
++}
++
++Window
++compiz::X11::PendingEvent::getEventWindow (XEvent *event)
++{
++ return event->xany.window;
++}
++
++bool
++compiz::X11::PendingEvent::match (XEvent *event)
++{
++ if (event->xany.serial != mSerial)
++ return false;
++ if (getEventWindow (event)!= mWindow)
++ return false;
++
++ return true;
++}
++
++compiz::X11::PendingEvent::PendingEvent (Display *d, Window w) :
++ mSerial (XNextRequest (d)),
++ mWindow (w)
++{
++}
++
++compiz::X11::PendingEvent::~PendingEvent ()
++{
++}
++
++Window
++compiz::X11::PendingConfigureEvent::getEventWindow (XEvent *event)
++{
++ return event->xconfigure.window;
++}
++
++bool
++compiz::X11::PendingConfigureEvent::matchVM (unsigned int valueMask)
++{
++ return valueMask & mValueMask;
++}
++
++bool
++compiz::X11::PendingConfigureEvent::match (XEvent *event)
++{
++ XConfigureEvent *ce = (XConfigureEvent *) event;
++ bool matched = true;
++
++ if (!compiz::X11::PendingEvent::match (event))
++ return false;
++
++ if (mValueMask & CWX)
++ if (ce->x != mXwc.x)
++ matched = false;
++
++ if (mValueMask & CWY)
++ if (ce->y != mXwc.y)
++ matched = false;
++
++ if (mValueMask & CWWidth)
++ if (ce->width != mXwc.width)
++ matched = false;
++
++ if (mValueMask & CWHeight)
++ if (ce->height != mXwc.height)
++ matched = false;
++
++ if (mValueMask & CWBorderWidth)
++ if (ce->border_width != mXwc.border_width)
++ matched = false;
++
++ if (mValueMask & (CWStackMode | CWSibling))
++ if (ce->above != mXwc.sibling)
++ matched = false;
++
++ /* Remove events from the queue
++ * even if they didn't match what
++ * we expected them to be, but still
++ * complain about it */
++ if (!matched)
++ {
++ compLogMessage ("core", CompLogLevelWarn, "no exact match for ConfigureNotify on 0x%x!", mWindow);
++ compLogMessage ("core", CompLogLevelWarn, "expected the following changes:");
++ if (mValueMask & CWX)
++ compLogMessage ("core", CompLogLevelWarn, "x: %i", mXwc.x);
++ if (mValueMask & CWY)
++ compLogMessage ("core", CompLogLevelWarn, "y: %i", mXwc.y);
++ if (mValueMask & CWWidth)
++ compLogMessage ("core", CompLogLevelWarn, "width: %i", mXwc.width);
++ if (mValueMask & CWHeight)
++ compLogMessage ("core", CompLogLevelWarn, "height: %i", mXwc.height);
++ if (mValueMask & CWBorderWidth)
++ compLogMessage ("core", CompLogLevelWarn, "border: %i", mXwc.border_width);
++ if (mValueMask & (CWStackMode | CWSibling))
++ compLogMessage ("core", CompLogLevelWarn, "sibling: 0x%x", mXwc.sibling);
++
++ compLogMessage ("core", CompLogLevelWarn, "instead got:");
++ compLogMessage ("core", CompLogLevelWarn, "x: %i", ce->x);
++ compLogMessage ("core", CompLogLevelWarn, "y: %i", ce->y);
++ compLogMessage ("core", CompLogLevelWarn, "width: %i", ce->width);
++ compLogMessage ("core", CompLogLevelWarn, "height: %i", ce->height);
++ compLogMessage ("core", CompLogLevelWarn, "above: %i", ce->above);
++ compLogMessage ("core", CompLogLevelWarn, "this should never happen. you should "\
++ "probably file a bug about this.");
++ }
++
++ return true;
++}
++
++compiz::X11::PendingConfigureEvent::PendingConfigureEvent (Display *d,
++ Window w,
++ unsigned int valueMask,
++ XWindowChanges *xwc) :
++ compiz::X11::PendingEvent::PendingEvent (d, w),
++ mValueMask (valueMask),
++ mXwc (*xwc)
+ {
+ CompOption::Vector options;
+ CompOption::Value v;
+
+ options.push_back (CompOption ("window", CompOption::TypeInt));
+- v.set ((int) id);
++ v.set ((int) w);
+ options.back ().set (v);
+ options.push_back (CompOption ("active", CompOption::TypeInt));
+ v.set ((int) 1);
+ options.back ().set (v);
+
+- gettimeofday (&lastConfigureRequest, NULL);
+-
+ /* Notify other plugins that it is unsafe to change geometry or serverGeometry
+ * FIXME: That API should not be accessible to plugins, this is a hack to avoid
+ * breaking ABI */
+
+ screen->handleCompizEvent ("core", "lock_position", options);
++}
+
+- priv->pendingConfigures.push_back (XWCValueMask (xwc, valueMask));
++compiz::X11::PendingConfigureEvent::~PendingConfigureEvent ()
++{
+ }
+
+ void
+@@ -2227,7 +2361,7 @@
+ unsigned int valueMask = CWX | CWY;
+ XWindowChanges xwc;
+
+- if (priv->pendingPositionUpdates && priv->pendingConfigures.empty ())
++ if (priv->pendingPositionUpdates && !priv->pendingConfigures.pending ())
+ {
+ if (priv->serverFrameGeometry.x () == priv->frameGeometry.x ())
+ valueMask &= ~(CWX);
+@@ -2242,8 +2376,6 @@
+ * larger changes to the window movement system. */
+ if (valueMask)
+ {
+- priv->addPendingConfigure (xwc, 0);
+-
+ priv->serverGeometry.setX (priv->geometry.x ());
+ priv->serverGeometry.setY (priv->geometry.y ());
+ priv->serverFrameGeometry.setX (priv->frameGeometry.x ());
+@@ -2252,6 +2384,14 @@
+ xwc.x = priv->serverFrameGeometry.x ();
+ xwc.y = priv->serverFrameGeometry.y ();
+
++ gettimeofday (&priv->lastConfigureRequest, NULL);
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), priv->serverFrame, 0, &xwc)));
++
++ priv->pendingConfigures.add (pc);
++
+ XConfigureWindow (screen->dpy (), ROOTPARENT (this), valueMask, &xwc);
+
+ if (priv->serverFrame)
+@@ -3055,6 +3195,13 @@
+ return m;
+ }
+
++static bool isPendingRestack (compiz::X11::PendingEvent::Ptr p)
++{
++ compiz::X11::PendingConfigureEvent::Ptr pc = boost::shared_static_cast <compiz::X11::PendingConfigureEvent> (p);
++
++ return pc->matchVM (CWStackMode | CWSibling);
++}
++
+ void
+ PrivateWindow::reconfigureXWindow (unsigned int valueMask,
+ XWindowChanges *xwc)
+@@ -3089,18 +3236,7 @@
+ /* check if the sibling is also pending a restack,
+ * if not, then setting this bit is useless */
+
+- bool pendingRestack = false;
+-
+- foreach (XWCValueMask &xwcvm, window->serverPrev->priv->pendingConfigures)
+- {
+- if (xwcvm.second & (CWSibling | CWStackMode))
+- {
+- pendingRestack = true;
+- break;
+- }
+- }
+-
+- if (!pendingRestack)
++ if (window->serverPrev->priv->pendingConfigures.forEachIf (boost::bind (isPendingRestack, _1)))
+ valueMask &= ~(CWSibling | CWStackMode);
+ }
+
+@@ -3180,7 +3316,14 @@
+ wc.width = serverFrameGeometry.width ();
+ wc.height = serverFrameGeometry.height ();
+
+- addPendingConfigure (wc, frameValueMask);
++ gettimeofday (&lastConfigureRequest, NULL);
++
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), priv->serverFrame, frameValueMask, &wc)));
++
++ pendingConfigures.add (pc);
+
+ XConfigureWindow (screen->dpy (), serverFrame, frameValueMask, &wc);
+ }
+@@ -3869,31 +4012,29 @@
+
+ lxwc.stack_mode = Below;
+
++ if (serverFrame)
++ {
++ gettimeofday (&lastConfigureRequest, NULL);
++ compiz::X11::PendingEvent::Ptr pc =
++ boost::shared_static_cast<compiz::X11::PendingEvent> (compiz::X11::PendingConfigureEvent::Ptr (
++ new compiz::X11::PendingConfigureEvent (
++ screen->dpy (), serverFrame, valueMask, &lxwc)));
++
++ pendingConfigures.add (pc);
++ }
++
+ /* Below with no sibling puts the window at the bottom
+ * of the stack */
+ XConfigureWindow (screen->dpy (), ROOTPARENT (window), valueMask, &lxwc);
+
+- if (serverFrame)
+- priv->addPendingConfigure (lxwc, CWStackMode);
+-
+ /* Update the list of windows last sent to the server */
+ screen->unhookServerWindow (window);
+ screen->insertServerWindow (window, 0);
+ }
+ else if (sibling)
+ {
+- bool pendingRestacks = false;
+-
+- foreach (XWCValueMask &xwcvm, sibling->priv->pendingConfigures)
+- {
+- if (xwcvm.second & (CWSibling | CWStackMode))
+- {
+- pendingRestacks = true;
+- break;
+- }
+- }
+-
+- if (sibling->priv->id != window->serverPrev->priv->id || pendingRestacks)
++ if (sibling->priv->id != window->serverPrev->priv->id ||
++ window->serverPrev->priv->pendingConfigures.forEachIf (boost::bind (isPendingRestack, _1)))
+ {
+ mask |= CWSibling | CWStackMode;
+
+@@ -6288,6 +6429,7 @@
+
+ pendingUnmaps (0),
+ pendingMaps (0),
++ pendingConfigures (screen->dpy ()),
+ pendingPositionUpdates (false),
+
+ startupId (0),
=== added file 'debian/patches/fix-869316.patch'
--- debian/patches/fix-869316.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-869316.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,259 @@
+=== modified file 'src/event.cpp'
+Index: compiz-0.9.6+bzr20110929/src/event.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/event.cpp 2011-10-08 00:58:53.733686375 +0800
++++ compiz-0.9.6+bzr20110929/src/event.cpp 2011-10-08 00:59:07.389754097 +0800
+@@ -1841,13 +1841,24 @@
+
+ if (wa.root == priv->root)
+ {
+- if (event->xfocus.mode != NotifyGrab)
++ if (event->xfocus.mode == NotifyGrab)
++ priv->grabbed = true;
++ else if (event->xfocus.mode == NotifyUngrab)
++ priv->grabbed = false;
++ else
+ {
++ CompWindowList dockWindows;
++ XWindowChanges xwc;
++ unsigned int mask;
++
+ w = findTopLevelWindow (event->xfocus.window);
+ if (w && w->managed ())
+ {
+ unsigned int state = w->state ();
+
++ if (priv->nextActiveWindow == event->xfocus.window)
++ priv->nextActiveWindow = None;
++
+ if (w->id () != priv->activeWindow)
+ {
+ CompWindow *active = screen->findWindow (priv->activeWindow);
+@@ -1857,7 +1868,47 @@
+ w->priv->activeNum = priv->activeNum++;
+
+ if (active)
++ {
++ CompWindowList windowsLostFocus;
++ /* If this window lost focus and was above a fullscreen window
++ * and is no longer capable of being focused (eg, it is
++ * not visible on this viewport) then we need to check if
++ * any other windows below it are also now no longer capable
++ * of being focused and restack them in the highest position
++ * below docks that they are allowed to take */
++ if (!active->focus ())
++ {
++ windowsLostFocus.push_back (active);
++ for (CompWindow *fsw = active->prev; fsw; fsw = fsw->prev)
++ {
++ if (!fsw->focus () &&
++ fsw->managed () &&
++ !(fsw->type () & (CompWindowTypeDockMask |
++ CompWindowTypeFullscreenMask)) &&
++ !fsw->overrideRedirect ())
++ windowsLostFocus.push_back (fsw);
++
++ if (fsw->type () & CompWindowTypeFullscreenMask)
++ {
++ /* This will be the window that we must lower relative to */
++ CompWindow *sibling = PrivateWindow::findValidStackSiblingBelow (active, fsw);
++
++ if (sibling)
++ {
++ for (CompWindowList::reverse_iterator rit = windowsLostFocus.rbegin ();
++ rit != windowsLostFocus.rend (); rit++)
++ {
++ (*rit)->restackAbove (sibling);
++ }
++ }
++
++ break;
++ }
++ }
++ }
++
+ active->priv->updatePassiveButtonGrabs ();
++ }
+
+ w->priv->updatePassiveButtonGrabs ();
+
+@@ -1871,9 +1922,6 @@
+
+ state &= ~CompWindowStateDemandsAttentionMask;
+ w->changeState (state);
+-
+- if (priv->nextActiveWindow == event->xfocus.window)
+- priv->nextActiveWindow = None;
+ }
+ else if (event->xfocus.window == priv->root)
+ {
+@@ -1899,9 +1947,31 @@
+ }
+ }
+ }
++
++ /* Ensure that docks are stacked in the right place
++ *
++ * When a normal window gets the focus and is above a
++ * fullscreen window, restack the docks to be above
++ * the highest level mapped and visible normal window,
++ * otherwise put them above the highest fullscreen window
++ */
++ if (w)
++ {
++ if (PrivateWindow::stackDocks (w, dockWindows, &xwc, &mask))
++ {
++ Window sibling = xwc.sibling;
++ xwc.stack_mode = Above;
++
++ /* Then update the dock windows */
++ foreach (CompWindow *dw, dockWindows)
++ {
++ xwc.sibling = sibling;
++ dw->configureXWindow (mask, &xwc);
++ }
++ }
++ }
++
+ }
+- else
+- priv->grabbed = true;
+ }
+ else
+ {
+Index: compiz-0.9.6+bzr20110929/src/stackdebugger.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/stackdebugger.cpp 2011-10-08 00:58:53.749686457 +0800
++++ compiz-0.9.6+bzr20110929/src/stackdebugger.cpp 2011-10-08 00:59:07.389754097 +0800
+@@ -344,7 +344,7 @@
+
+ /* search down the stack to check if there is a fullscreen
+ * window, otherwise we are not on the fullscreen layer */
+- for (CompWindow *rw = w->serverPrev; rw; rw = rw->serverPrev)
++ for (CompWindow *rw = w->prev; rw; rw = rw->prev)
+ {
+ if (rw->type () & CompWindowTypeFullscreenMask)
+ {
+@@ -384,9 +384,9 @@
+
+ /* search down the stack to check if there is a fullscreen
+ * window, otherwise we are not on the fullscreen layer */
+- for (CompWindow *rw = w->serverPrev; rw; rw = rw->serverPrev)
++ for (CompWindow *rw = w->prev; rw; rw = rw->prev)
+ {
+- if (rw->type () == CompWindowTypeFullscreenMask)
++ if (rw->type () & CompWindowTypeFullscreenMask)
+ {
+ fullscreenWindow = true;
+ break;
+@@ -412,9 +412,9 @@
+
+ /* search down the stack to check if there is a fullscreen
+ * window, otherwise we are not on the fullscreen layer */
+- for (CompWindow *rw = w->serverPrev; rw; rw = rw->serverPrev)
++ for (CompWindow *rw = w->prev; rw; rw = rw->prev)
+ {
+- if (rw->type () == CompWindowTypeFullscreenMask)
++ if (rw->type () & CompWindowTypeFullscreenMask)
+ {
+ fullscreenWindow = true;
+ break;
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-08 00:58:53.761686514 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-08 00:59:07.393754112 +0800
+@@ -2702,34 +2702,8 @@
+ }
+
+ if (setFocus)
+- {
+- CompWindowList dockWindows;
+- XWindowChanges xwc;
+- unsigned int mask;
+-
+ screen->priv->nextActiveWindow = priv->id;
+
+- /* Ensure that docks are stacked in the right place
+- *
+- * When a normal window gets the focus and is above a
+- * fullscreen window, restack the docks to be above
+- * the highest level mapped and visible normal window,
+- * otherwise put them above the highest fullscreen window
+- */
+- if (PrivateWindow::stackDocks (this, dockWindows, &xwc, &mask))
+- {
+- Window sibling = xwc.sibling;
+- xwc.stack_mode = Above;
+-
+- /* Then update the dock windows */
+- foreach (CompWindow *dw, dockWindows)
+- {
+- xwc.sibling = sibling;
+- dw->configureXWindow (mask, &xwc);
+- }
+- }
+- }
+-
+ if (!setFocus && !modalTransient)
+ {
+ CompWindow *ancestor;
+@@ -2930,6 +2904,10 @@
+ {
+ bool allowedRelativeToLayer = !(below->priv->type & belowMask);
+
++ if (aboveFs && below->priv->type & CompWindowTypeFullscreenMask)
++ if (!below->focus ())
++ break;
++
+ t = screen->findWindow (below->transientFor ());
+
+ while (t && allowedRelativeToLayer)
+@@ -3364,12 +3342,12 @@
+ {
+ /* If there is another toplevel window above the fullscreen one
+ * then we need to stack above that */
+- if (dw->focus () &&
++ if ((dw->priv->managed && !dw->priv->unmanaging) &&
++ !(dw->priv->state & CompWindowStateHiddenMask) &&
+ !PrivateWindow::isAncestorTo (w, dw) &&
+ !(dw->type () & (CompWindowTypeFullscreenMask |
+ CompWindowTypeDockMask)) &&
+- !dw->overrideRedirect () &&
+- dw->defaultViewport () == screen->vp () &&
++ !dw->overrideRedirect () &&
+ dw->isViewable ())
+ {
+ belowDocks = dw;
+@@ -3383,10 +3361,11 @@
+ firstFullscreenWindow = dw;
+ for (CompWindow *dww = dw->serverPrev; dww; dww = dww->serverPrev)
+ {
+- if (!(dww->type () & (CompWindowTypeFullscreenMask |
++ if ((dw->priv->managed && !dw->priv->unmanaging) &&
++ !(dw->priv->state & CompWindowStateHiddenMask) &&
++ !(dww->type () & (CompWindowTypeFullscreenMask |
+ CompWindowTypeDockMask)) &&
+- !dww->overrideRedirect () &&
+- dww->defaultViewport () == screen->vp () &&
++ !dww->overrideRedirect () &&
+ dww->isViewable ())
+ {
+ belowDocks = dww;
+@@ -4070,6 +4049,17 @@
+ if (priv->id == screen->activeWindow ())
+ aboveFs = true;
+
++ for (CompWindow *pw = serverPrev; pw; pw = pw->serverPrev)
++ {
++ if (pw->priv->type & CompWindowTypeFullscreenMask)
++ {
++ if (priv->id == screen->activeWindow ())
++ aboveFs = true;
++
++ break;
++ }
++ }
++
+ mask = priv->addWindowStackChanges (&xwc,
+ PrivateWindow::findSiblingBelow (this, aboveFs));
+
=== added file 'debian/patches/fix-869967.patch'
--- debian/patches/fix-869967.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-869967.patch 2011-10-07 17:52:31 +0000
@@ -0,0 +1,49 @@
+=== modified file 'src/window.cpp'
+Index: compiz-0.9.6+bzr20110929/src/window.cpp
+===================================================================
+--- compiz-0.9.6+bzr20110929.orig/src/window.cpp 2011-10-08 00:59:29.269862594 +0800
++++ compiz-0.9.6+bzr20110929/src/window.cpp 2011-10-08 00:59:40.613918842 +0800
+@@ -2670,6 +2670,8 @@
+ XChangeProperty (s->dpy (), s->root (), Atoms::winActive,
+ XA_WINDOW, 32, PropModeReplace,
+ (unsigned char *) &priv->id, 1);
++
++ screen->priv->nextActiveWindow = priv->serverFrame;
+ }
+ else
+ {
+@@ -2729,6 +2731,7 @@
+ priv->id == screen->priv->nextActiveWindow)
+ {
+ CompWindow *ancestor;
++ Window lastNextActiveWindow = screen->priv->nextActiveWindow;
+
+ if (priv->transientFor && priv->transientFor != screen->root ())
+ {
+@@ -2780,6 +2783,26 @@
+ }
+ else
+ screen->focusDefaultWindow ();
++
++ /* FIXME:
++ * moveInputFocusTo and focusDefaultWindow should really
++ * return booleans */
++ if (lastNextActiveWindow != screen->priv->nextActiveWindow &&
++ screen->priv->optionGetRaiseOnClick ())
++ {
++ /* If this window just got the focus because another window
++ * was unmanaged then we should also raise it if click raise
++ * is on, since another plugin might have raised another window
++ * without wanting to focus it and this window will be beneath
++ * it in the stack but above it in the active window history
++ * so when the focus moves here this window should be raised
++ * That's the tradeoff for maintaining a predictable focus order
++ * as compared to eg a predictable stacking order */
++
++ CompWindow *nextActive = screen->findWindow (screen->priv->nextActiveWindow);
++ if (nextActive)
++ nextActive->raise ();
++ }
+ }
+ }
+
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-10-04 10:38:18 +0000
+++ debian/patches/series 2011-10-07 17:52:31 +0000
@@ -1,5 +1,14 @@
01_ctrl_alt_*tea*.patch
02_fix_autofocus_minimize_window.patch
03_fix_configureframe.patch
-04_fix_insertServerWindow_crash.patch
-05_fix_reconfigureXWindow_crash.patch
+fix-748840.patch
+fix-857487.patch
+fix-857737-part2.patch
+fix-857738-part1.patch
+fix-863328.patch
+fix-865863.patch
+fix-866752.patch
+fix-869316.patch
+fix-869967.patch
+#04_fix_insertServerWindow_crash.patch
+#05_fix_reconfigureXWindow_crash.patch