--- compiz-0.9.4+bzr20110606.orig/src/window.cpp 2011-06-01 11:49:33.000000000 -0400 +++ compiz-0.9.4+bzr20110606/src/window.cpp 2011-08-09 14:03:25.000000000 -0400 @@ -770,7 +770,8 @@ if (input.left || input.right || input.top || input.bottom) { - int x, y, width, height; + int x, y; + unsigned int width, height; int bw = serverGeometry.border () * 2; x = serverGeometry.x () - input.left; @@ -781,7 +782,36 @@ if (shaded) height = input.top + input.bottom; - XMoveResizeWindow (screen->dpy (), frame, x, y, width, height); + /* 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 + * around (and might result in display corruption, eg in OpenGL */ + if (geometry.x () - input.left == x && + geometry.y () - input.top == y && + geometry.width () + input.left + input.right + bw == width && + geometry.height () + input.top + input.bottom + bw == height) + { + XConfigureEvent xev; + + xev.type = ConfigureNotify; + xev.event = screen->root (); + xev.window = priv->frame; + + xev.x = x; + xev.y = y; + xev.width = width; + xev.height = height; + xev.border_width = window->priv->attrib.border_width; + + xev.above = (window->prev) ? ROOTPARENT (window->prev) : None; + xev.override_redirect = window->priv->attrib.override_redirect; + + XSendEvent (screen->dpy (), screen->root (), false, + SubstructureNotifyMask, (XEvent *) &xev); + } + else + XMoveResizeWindow (screen->dpy (), frame, x, y, width, height); + if (shaded) { XUnmapWindow (screen->dpy (), wrapper); @@ -823,13 +853,13 @@ XMoveResizeWindow (screen->dpy (), wrapper, 0, 0, serverGeometry.width (), serverGeometry.height ()); } + XMoveResizeWindow (screen->dpy (), id, 0, 0, serverGeometry.width (), serverGeometry.height ()); window->sendConfigureNotify (); frameRegion = CompRegion (); window->windowNotify (CompWindowNotifyFrameUpdate); } - window->recalcActions (); } @@ -1425,8 +1455,8 @@ bool CompWindow::resize (CompWindow::Geometry gm) { - if (priv->geometry.x () != gm.width () || - priv->geometry.y () != gm.height () || + if (priv->geometry.width () != gm.width () || + priv->geometry.height () != gm.height () || priv->geometry.border () != gm.border ()) { int pw, ph; @@ -3093,9 +3123,9 @@ { if (!sibling) { - XLowerWindow (screen->dpy (), id); if (frame) XLowerWindow (screen->dpy (), frame); + XLowerWindow (screen->dpy (), id); /* Restacking of compiz's window list happens * immediately and since this path doesn't call @@ -5695,7 +5725,7 @@ if (!i) i = b; - + if (priv->input.left != i->left || priv->input.right != i->right || priv->input.top != i->top || @@ -5722,6 +5752,7 @@ Atoms::frameExtents, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, 4); + priv->updateSize (); priv->updateFrameWindow (); } @@ -5859,7 +5890,7 @@ if (attrib.map_state == IsViewable || shaded) XMapWindow (dpy, frame); - attr.event_mask = SubstructureRedirectMask | StructureNotifyMask | + attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask;