summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-05-03 19:06:35 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-05-03 19:06:35 +0800
commit32affe04818a82b884ef617bf319b0c9f2189cd9 (patch)
treebc920bf13c2cde97099d876f0510417e75ee0109 /src
parent963fb41a95b6ad0e58224e5fdd0f2eeb797c5f2c (diff)
downloadmobilebling-32affe04818a82b884ef617bf319b0c9f2189cd9.tar.gz
mobilebling-32affe04818a82b884ef617bf319b0c9f2189cd9.tar.bz2
Send a fake configure notify event when the window size doesn't change
on frame update since other plugins need to know when the client window changed geometry.
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp43
1 files changed, 37 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 4e222ab..d62a7f4 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -770,7 +770,8 @@ PrivateWindow::updateFrameWindow ()
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 @@ PrivateWindow::updateFrameWindow ()
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 @@ PrivateWindow::updateFrameWindow ()
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 ();
}
@@ -3034,9 +3064,9 @@ PrivateWindow::addWindowStackChanges (XWindowChanges *xwc,
{
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
@@ -5623,7 +5653,7 @@ CompWindow::setWindowFrameExtents (CompWindowExtents *b,
if (!i)
i = b;
-
+
if (priv->input.left != i->left ||
priv->input.right != i->right ||
priv->input.top != i->top ||
@@ -5650,6 +5680,7 @@ CompWindow::setWindowFrameExtents (CompWindowExtents *b,
Atoms::frameExtents,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) data, 4);
+
priv->updateSize ();
priv->updateFrameWindow ();
}
@@ -5777,7 +5808,7 @@ PrivateWindow::reparent ()
if (wa.map_state == IsViewable || shaded)
XMapWindow (dpy, frame);
- attr.event_mask = SubstructureRedirectMask | StructureNotifyMask |
+ attr.event_mask = SubstructureRedirectMask |
SubstructureNotifyMask | EnterWindowMask |
LeaveWindowMask;