summaryrefslogtreecommitdiff
authorMaarten Maathuis <madman2003@gmail.com>2008-02-17 10:21:01 (GMT)
committer Maarten Maathuis <madman2003@gmail.com>2008-02-17 10:21:01 (GMT)
commit70c0592a97c7dc9db0576d32b3bdbe4766520509 (patch) (side-by-side diff)
treef409b5995888c7ddb7bda05e727f0dfd107a036a
parentb95059c20746a71e60ef152bb627e1d5c2210d75 (diff)
downloadxserver-70c0592a97c7dc9db0576d32b3bdbe4766520509.zip
xserver-70c0592a97c7dc9db0576d32b3bdbe4766520509.tar.gz
Resize composite overlay window when the root window changes.
- This allows some compositing managers to work, even after randr12 has changed the root window size. - Thanks to ajax for figuring out the best place to put this. - Example: - xf86RandR12SetMode() calls EnableDisableFBAccess(). - That calls xf86SetRootClip() which in turn calls ResizeChildrenWinSize(). - The final step is the call to PositionWindow().
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--composite/compwindow.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 5792367..ee0f7d2 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -165,6 +165,29 @@ compCheckRedirect (WindowPtr pWin)
return TRUE;
}
+static int
+updateOverlayWindow(ScreenPtr pScreen)
+{
+ CompScreenPtr cs;
+ WindowPtr pWin; /* overlay window */
+ XID vlist[2];
+
+ cs = GetCompScreen(pScreen);
+ if ((pWin = cs->pOverlayWin) != NULL) {
+ if ((pWin->drawable.width == pScreen->width) &&
+ (pWin->drawable.height == pScreen->height))
+ return Success;
+
+ /* Let's resize the overlay window. */
+ vlist[0] = pScreen->width;
+ vlist[1] = pScreen->height;
+ return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
+ }
+
+ /* Let's be on the safe side and not assume an overlay window is always allocated. */
+ return Success;
+}
+
Bool
compPositionWindow (WindowPtr pWin, int x, int y)
{
@@ -203,6 +226,8 @@ compPositionWindow (WindowPtr pWin, int x, int y)
cs->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = compPositionWindow;
compCheckTree (pWin->drawable.pScreen);
+ if (updateOverlayWindow(pScreen) != Success)
+ ret = FALSE;
return ret;
}