xserver: Branch 'xorg-server-1.5-apple'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Mon May 5 15:35:53 PDT 2008


 miext/rootless/rootlessWindow.c |   71 +++++++++++++++++++++++++---------------
 1 file changed, 46 insertions(+), 25 deletions(-)

New commits:
commit e524c73bcbe95de68dd29f42f16f5076c92494c6
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon May 5 15:32:26 2008 -0700

    Rootless: mi doesn't let us resize root, so we need to do it ourselves...
    (cherry picked from commit c1ec36e28cff857664090cc8792db1ae93b783fa)

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index df1d3a8..0edafe7 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1338,34 +1338,55 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
     RegionRec saveRoot;
 
     RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin);
+    
+    if(pWin->parent) {
+        if (winRec) {
+            oldBW = winRec->borderWidth;
+            oldX = winRec->x;
+            oldY = winRec->y;
+            oldW = winRec->width;
+            oldH = winRec->height;
 
-    if (winRec) {
-        oldBW = winRec->borderWidth;
-        oldX = winRec->x;
-        oldY = winRec->y;
-        oldW = winRec->width;
-        oldH = winRec->height;
-
-        newBW = oldBW;
-        newX = x;
-        newY = y;
-        newW = w + 2*newBW;
-        newH = h + 2*newBW;
-
-        resize_after = StartFrameResize(pWin, TRUE,
-                                        oldX, oldY, oldW, oldH, oldBW,
-                                        newX, newY, newW, newH, newBW);
-    }
+            newBW = oldBW;
+            newX = x;
+            newY = y;
+            newW = w + 2*newBW;
+            newH = h + 2*newBW;
 
-    HUGE_ROOT(pWin);
-    SCREEN_UNWRAP(pScreen, ResizeWindow);
-    pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
-    SCREEN_WRAP(pScreen, ResizeWindow);
-    NORMAL_ROOT(pWin);
+            resize_after = StartFrameResize(pWin, TRUE,
+                                            oldX, oldY, oldW, oldH, oldBW,
+                                            newX, newY, newW, newH, newBW);
+        }
 
-    if (winRec) {
-        FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
-                          newX, newY, newW, newH, newBW, resize_after);
+        HUGE_ROOT(pWin);
+        SCREEN_UNWRAP(pScreen, ResizeWindow);
+        pScreen->ResizeWindow(pWin, x, y, w, h, pSib);
+        SCREEN_WRAP(pScreen, ResizeWindow);
+        NORMAL_ROOT(pWin);
+
+        if (winRec) {
+            FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
+                              newX, newY, newW, newH, newBW, resize_after);
+        }
+    } else {
+        /* Special case for resizing the root window */
+        BoxRec box;
+
+        pWin->drawable.x = x;
+        pWin->drawable.y = y;
+        pWin->drawable.width = w;
+        pWin->drawable.height = h;
+
+        box.x1 = x; box.y1 = y;
+        box.x2 = x + w; box.y2 = y + h;
+        REGION_UNINIT(pScreen, &pWin->winSize);
+        REGION_INIT(pScreen, &pWin->winSize, &box, 1);
+        REGION_COPY(pScreen, &pWin->borderSize, &pWin->winSize);
+        REGION_COPY(pScreen, &pWin->clipList, &pWin->winSize);
+        REGION_COPY(pScreen, &pWin->borderClip, &pWin->winSize);
+
+        miSendExposures(pWin, &pWin->borderClip,
+                        pWin->drawable.x, pWin->drawable.y);        
     }
 
     RL_DEBUG_MSG("resizewindow end\n");


More information about the xorg-commit mailing list