xserver: Branch 'master' - 9 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 20 17:12:41 UTC 2023


 dix/dispatch.c                  |    2 
 exa/exa.c                       |    2 
 exa/exa_accel.c                 |    2 
 fb/fb.h                         |    2 
 fb/fbpixmap.c                   |    2 
 fb/fbwindow.c                   |    2 
 glamor/glamor_copy.c            |    2 
 glamor/glamor_pixmap.c          |    2 
 include/pixmapstr.h             |    2 
 mi/miexpose.c                   |    2 
 miext/damage/damage.c           |    8 
 miext/rootless/README.txt       |    8 
 miext/rootless/rootless.h       |    3 
 miext/rootless/rootlessCommon.h |   19 -
 miext/rootless/rootlessConfig.h |    4 
 miext/rootless/rootlessGC.c     |    8 
 miext/rootless/rootlessWindow.c |  387 ++++------------------------------------
 present/present_scmd.c          |    2 
 18 files changed, 65 insertions(+), 394 deletions(-)

New commits:
commit 16e7cdba489b7e419b3732cb56f26de2b71d3504
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Jan 1 10:57:46 2023 -0800

    rootless: Use screen_x and screen_y instead of pixmap pointer hacks
    
    This updates rootless to treat pixmaps consistently with COMPOSITE,
    using the screen_x and screen_y values rather than doing hacky math.
    
    This will allow for proper bounds checking on a given PixmapRec.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 9c26753a9..efcec5c81 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -2182,7 +2182,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
             PixmapPtr pPix = (*pDraw->pScreen->GetWindowPixmap) (pWin);
 
             pBoundingDraw = &pPix->drawable;
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
             relx -= pPix->screen_x;
             rely -= pPix->screen_y;
 #endif
diff --git a/exa/exa.c b/exa/exa.c
index b16875845..42047fa2d 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -125,7 +125,7 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
 void
 exaGetDrawableDeltas(DrawablePtr pDrawable, PixmapPtr pPixmap, int *xp, int *yp)
 {
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (pDrawable->type == DRAWABLE_WINDOW) {
         *xp = -pPixmap->screen_x;
         *yp = -pPixmap->screen_y;
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index e632331da..2a31bd3c7 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -963,7 +963,7 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     RegionInit(&rgnDst, NullBox, 0);
 
     RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (pPixmap->screen_x || pPixmap->screen_y)
         RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y);
 #endif
diff --git a/fb/fb.h b/fb/fb.h
index 8ab050d0f..08143a0d4 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -441,7 +441,7 @@ typedef struct {
 #define __fbPixDrawableX(pPix)	((pPix)->drawable.x)
 #define __fbPixDrawableY(pPix)	((pPix)->drawable.y)
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
 #define __fbPixOffXWin(pPix)	(__fbPixDrawableX(pPix) - (pPix)->screen_x)
 #define __fbPixOffYWin(pPix)	(__fbPixDrawableY(pPix) - (pPix)->screen_y)
 #else
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index af5d7bec0..89e3370a6 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -76,7 +76,7 @@ fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
     fbInitializeDrawable(&pPixmap->drawable);
 #endif
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     pPixmap->screen_x = 0;
     pPixmap->screen_y = 0;
 #endif
diff --git a/fb/fbwindow.c b/fb/fbwindow.c
index fca871d62..df33af948 100644
--- a/fb/fbwindow.c
+++ b/fb/fbwindow.c
@@ -116,7 +116,7 @@ fbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 
     RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (pPixmap->screen_x || pPixmap->screen_y)
         RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y);
 #endif
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index 1ab2be6c0..fa2d783a1 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -781,7 +781,7 @@ glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_regio
 
     RegionIntersect(&dst_region, &window->borderClip, src_region);
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (pixmap->screen_x || pixmap->screen_y)
         RegionTranslate(&dst_region, -pixmap->screen_x, -pixmap->screen_y);
 #endif
diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 9aa169cdc..2c8cc3ba0 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -39,7 +39,7 @@ void
 glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
                            int *x, int *y)
 {
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (drawable->type == DRAWABLE_WINDOW) {
         *x = -pixmap->screen_x;
         *y = -pixmap->screen_y;
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index faf54fa4d..54fc26508 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -78,7 +78,7 @@ typedef struct _Pixmap {
     int refcnt;
     int devKind;                /* This is the pitch of the pixmap, typically width*bpp/8. */
     DevUnion devPrivate;        /* When !NULL, devPrivate.ptr points to the raw pixel data. */
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     short screen_x;
     short screen_y;
 #endif
diff --git a/mi/miexpose.c b/mi/miexpose.c
index e54b18b30..6b6938a75 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -461,7 +461,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
         tile_x_off = pWin->drawable.x;
         tile_y_off = pWin->drawable.y;
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
         draw_x_off = pixmap->screen_x;
         draw_y_off = pixmap->screen_y;
         tile_x_off -= draw_x_off;
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index f3ae4ebbc..48e6af673 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -142,7 +142,7 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
     RegionRec pixClip;
     int draw_x, draw_y;
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     int screen_x = 0, screen_y = 0;
 #endif
 
@@ -150,7 +150,7 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
     if (!RegionNotEmpty(pRegion))
         return;
 
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     /*
      * When drawing to a pixmap which is storing window contents,
      * the region presented is in pixmap relative coordinates which
@@ -201,7 +201,7 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
 
         draw_x = pDamage->pDrawable->x;
         draw_y = pDamage->pDrawable->y;
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
         /*
          * Need to move everyone to screen coordinates
          * XXX what about off-screen pixmaps with non-zero x/y?
@@ -274,7 +274,7 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
         if (pDamageRegion == pRegion && (draw_x || draw_y))
             RegionTranslate(pDamageRegion, draw_x, draw_y);
     }
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
     if (screen_x || screen_y)
         RegionTranslate(pRegion, -screen_x, -screen_y);
 #endif
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index d9a4d05e9..40400b395 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -226,20 +226,10 @@ extern RegionRec rootlessHugeRoot;
  *  Can't access the bits before the first word of the drawable's data in
  *  rootless mode, so make sure our base address is always 32-bit aligned.
  */
-#define SetPixmapBaseToScreen(pix, _x, _y) {                                \
-    PixmapPtr   _pPix = (PixmapPtr) (pix);                                  \
-    _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) -              \
-                            ((int)(_x) * _pPix->drawable.bitsPerPixel/8 +   \
-                             (int)(_y) * _pPix->devKind);                   \
-    if (_pPix->drawable.bitsPerPixel != FB_UNIT) {                          \
-        size_t _diff = ((size_t) _pPix->devPrivate.ptr) &               \
-                         (FB_UNIT / CHAR_BIT - 1);                          \
-        _pPix->devPrivate.ptr = (char *) (_pPix->devPrivate.ptr) -          \
-                                _diff;                                      \
-        _pPix->drawable.x = _diff /                                         \
-                            (_pPix->drawable.bitsPerPixel / CHAR_BIT);      \
-    }                                                                       \
-}
+#define SetPixmapBaseToScreen(pix, _x, _y) do { \
+    pix->screen_x = _x; \
+    pix->screen_y = _y; \
+} while(0)
 
 // Returns TRUE if this window is visible inside a frame
 // (e.g. it is visible and has a top-level or root parent)
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 0a2d9391a..643dedff6 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -705,11 +705,17 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     else {
         RootlessStartDrawing(pWin);
 
-        miCopyRegion((DrawablePtr) pWin, (DrawablePtr) pWin,
+        PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
+        DrawablePtr pDrawable = &pPixmap->drawable;
+
+        if (pPixmap->screen_x || pPixmap->screen_y) {
+            RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y);
+        }
+
+        miCopyRegion(pDrawable, pDrawable,
                      0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
 
-        /* prgnSrc has been translated to dst position */
-        RootlessDamageRegion(pWin, prgnSrc);
+        RootlessDamageRegion(pWin, &rgnDst);
     }
 
  out:
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 46fd9a1fd..200ded348 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -137,7 +137,7 @@ present_check_flip(RRCrtcPtr            crtc,
 
     /* Does the window match the pixmap exactly? */
     if (window->drawable.x != 0 || window->drawable.y != 0 ||
-#ifdef COMPOSITE
+#if defined(COMPOSITE) || defined(ROOTLESS)
         window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y ||
 #endif
         window->drawable.width != pixmap->drawable.width ||
commit 820b1dc461157b54fd49a787dbaf9d68a92debd9
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Jan 14 22:26:30 2023 -0800

    rootless: Dead code removal (RootlessResizeCopyWindow)
    
    This should no longer be necessary since we only support implementations
    that handle preserving the bits across resize.  We can use
    RootlessNoCopyWindow instead.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 47f46e492..0a2d9391a 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -625,11 +625,6 @@ RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
  */
 
 // Globals needed during window resize and move.
-static void *gResizeDeathBits = NULL;
-static int gResizeDeathCount = 0;
-static PixmapPtr gResizeDeathPix[2] = { NULL, NULL };
-
-static BoxRec gResizeDeathBounds[2];
 static CopyWindowProcPtr gResizeOldCopyWindowProc = NULL;
 
 /*
@@ -649,74 +644,6 @@ RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     RegionTranslate(prgnSrc, -dx, -dy);
 }
 
-/*
- * RootlessResizeCopyWindow
- *  CopyWindow used during ResizeWindow for gravity moves. Based on
- *  fbCopyWindow. The original always draws on the root pixmap, which
- *  we don't have. Instead, draw on the parent window's pixmap.
- *  Resize version: the old location's pixels are in gResizeCopyWindowSource.
- */
-static void
-RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
-                         RegionPtr prgnSrc)
-{
-    ScreenPtr pScreen = pWin->drawable.pScreen;
-    RegionRec rgnDst;
-    int dx, dy;
-
-    RL_DEBUG_MSG("resizecopywindowFB start (win %p (%lu)) ", pWin, RootlessWID(pWin));
-
-    /* Don't unwrap pScreen->CopyWindow.
-       The bogus rewrap with RootlessCopyWindow causes a crash if
-       CopyWindow is called again during the same resize. */
-
-    if (gResizeDeathCount == 0)
-        return;
-
-    RootlessStartDrawing(pWin);
-
-    dx = ptOldOrg.x - pWin->drawable.x;
-    dy = ptOldOrg.y - pWin->drawable.y;
-    RegionTranslate(prgnSrc, -dx, -dy);
-    RegionNull(&rgnDst);
-    RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
-
-    if (gResizeDeathCount == 1) {
-        /* Simple case, we only have a single source pixmap. */
-
-        miCopyRegion(&gResizeDeathPix[0]->drawable,
-                     &pScreen->GetWindowPixmap(pWin)->drawable, 0,
-                     &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
-    }
-    else {
-        int i;
-        RegionRec clip, clipped;
-
-        /* More complex case, N source pixmaps (usually two). So we
-           intersect the destination with each source and copy those bits. */
-
-        for (i = 0; i < gResizeDeathCount; i++) {
-            RegionInit(&clip, gResizeDeathBounds + 0, 1);
-            RegionNull(&clipped);
-            RegionIntersect(&rgnDst, &clip, &clipped);
-
-            miCopyRegion(&gResizeDeathPix[i]->drawable,
-                         &pScreen->GetWindowPixmap(pWin)->drawable, 0,
-                         &clipped, dx, dy, fbCopyWindowProc, 0, 0);
-
-            RegionUninit(&clipped);
-            RegionUninit(&clip);
-        }
-    }
-
-    /* Don't update - resize will update everything */
-    RegionUninit(&rgnDst);
-
-    fbValidateDrawable(&pWin->drawable);
-
-    RL_DEBUG_MSG("resizecopywindowFB end\n");
-}
-
 /*
  * RootlessCopyWindow
  *  Update *new* location of window. Old location is redrawn with
@@ -886,48 +813,6 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
 
     RootlessRedisplay(pWin);
 
-    /* If gravity is true, then we need to have a way of recovering all
-       the original bits in the window for when X rearranges the contents
-       based on the various gravity settings. The obvious way is to just
-       snapshot the entire backing store before resizing it, but that
-       it slow on large windows.
-
-       So the optimization here is to use the implementation's resize
-       weighting options (if available) to allow us to reason about what
-       is left in the backing store after the resize. We can then only
-       copy what won't be there after the resize, and do a two-stage copy
-       operation.
-
-       Most of these optimizations are only applied when the top-left
-       corner of the window is fixed, since that's the common case. They
-       could probably be extended with some thought. */
-
-    gResizeDeathCount = 0;
-
-    if (gravity) {
-        RootlessStartDrawing(pWin);
-
-        gResizeDeathBits = xallocarray(winRec->bytesPerRow, winRec->height);
-
-        memcpy(gResizeDeathBits, winRec->pixelData,
-               winRec->bytesPerRow * winRec->height);
-
-        gResizeDeathBounds[0] = (BoxRec) {
-        oldX, oldY, oldX2, oldY2};
-        gResizeDeathPix[0]
-            = GetScratchPixmapHeader(pScreen, winRec->width,
-                                     winRec->height,
-                                     winRec->win->drawable.depth,
-                                     winRec->win->drawable.bitsPerPixel,
-                                     winRec->bytesPerRow,
-                                     (void *) gResizeDeathBits);
-
-        SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY);
-        gResizeDeathCount = 1;
-    }
-
-    RootlessStopDrawing(pWin, FALSE);
-
     winRec->x = newX;
     winRec->y = newY;
     winRec->width = newW;
@@ -947,7 +832,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
 
     if (gravity) {
         gResizeOldCopyWindowProc = pScreen->CopyWindow;
-        pScreen->CopyWindow = RootlessResizeCopyWindow;
+        pScreen->CopyWindow = RootlessNoCopyWindow;
     }
 }
 
@@ -966,16 +851,6 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY,
 
     RootlessDamageRect(pWin, -newBW, -newBW, newW, newH);
 
-    for (i = 0; i < 2; i++) {
-        if (gResizeDeathPix[i] != NULL) {
-            FreeScratchPixmapHeader(gResizeDeathPix[i]);
-            gResizeDeathPix[i] = NULL;
-        }
-    }
-
-    free(gResizeDeathBits);
-    gResizeDeathBits = NULL;
-
     if (gravity) {
         pScreen->CopyWindow = gResizeOldCopyWindowProc;
     }
commit 40c56932a56d8499a2290195f721617a0ee804de
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Jan 8 23:22:00 2023 -0800

    rootless: Remove an unnecessary memory copy when handling resize with gravity RL_GRAVITY_NONE (border width changes)
    
    This should no longer be necessary since we only support implementations that handle preserving the bits across resize
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index a216de11b..47f46e492 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -949,43 +949,6 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
         gResizeOldCopyWindowProc = pScreen->CopyWindow;
         pScreen->CopyWindow = RootlessResizeCopyWindow;
     }
-
-    /* If we can't rely on the window server preserving the bits we
-       need in the position we need, copy the pixels in the
-       intersection from src to dst. ResizeWindow assumes these pixels
-       are already present when making gravity adjustments. pWin
-       currently has new-sized pixmap but is in old position.
-
-       FIXME: border width change! (?) */
-
-    if (gravity && weight == RL_GRAVITY_NONE) {
-        PixmapPtr src, dst;
-
-        assert(gResizeDeathCount == 1);
-
-        src = gResizeDeathPix[0];
-        dst = pScreen->GetWindowPixmap(pWin);
-
-        RL_DEBUG_MSG("Resize copy rect %d %d %d %d\n",
-                     rect.x1, rect.y1, rect.x2, rect.y2);
-
-        /* rect is the intersection of the old location and new location */
-        if (BOX_NOT_EMPTY(rect) && src != NULL && dst != NULL) {
-            /* The window drawable still has the old frame position, which
-               means that DST doesn't actually point at the origin of our
-               physical backing store when adjusted by the drawable.x,y
-               position. So sneakily adjust it temporarily while copying.. */
-
-            ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData;
-            SetPixmapBaseToScreen(dst, newX, newY);
-
-            fbCopyWindowProc(&src->drawable, &dst->drawable, NULL,
-                             &rect, 1, 0, 0, FALSE, FALSE, 0, 0);
-
-            ((PixmapPtr) dst)->devPrivate.ptr = winRec->pixelData;
-            SetPixmapBaseToScreen(dst, oldX, oldY);
-        }
-    }
 }
 
 static void
commit a06cea245b5271e2e88b98e50ea3213d655eb98c
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Tue Jan 3 00:13:12 2023 -0800

    rootless: Dead code removal (resize_after in StartFrameResize / FinishFrameResize)
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index ce8b22b3d..a216de11b 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -854,14 +854,13 @@ ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW,
  *  saved and the implementation is told to change the window size.
  *  (x,y,w,h) is outer frame of window (outside border)
  */
-static Bool
+static void
 StartFrameResize(WindowPtr pWin, Bool gravity,
                  int oldX, int oldY, int oldW, int oldH, int oldBW,
                  int newX, int newY, int newW, int newH, int newBW)
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     RootlessWindowRec *winRec = WINREC(pWin);
-    Bool resize_after = FALSE;
 
     BoxRec rect;
     int oldX2, newX2;
@@ -935,15 +934,10 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
     winRec->height = newH;
     winRec->borderWidth = newBW;
 
-    /* Unless both dimensions are getting smaller, Resize the frame
-       before doing gravity repair */
-
-    if (!resize_after) {
-        SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
-                                             newX + SCREEN_TO_GLOBAL_X,
-                                             newY + SCREEN_TO_GLOBAL_Y,
-                                             newW, newH, weight);
-    }
+    SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
+                                         newX + SCREEN_TO_GLOBAL_X,
+                                         newY + SCREEN_TO_GLOBAL_Y,
+                                         newW, newH, weight);
 
     RootlessStartDrawing(pWin);
 
@@ -992,37 +986,18 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
             SetPixmapBaseToScreen(dst, oldX, oldY);
         }
     }
-
-    return resize_after;
 }
 
 static void
 FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY,
                   unsigned int oldW, unsigned int oldH, unsigned int oldBW,
                   int newX, int newY, unsigned int newW, unsigned int newH,
-                  unsigned int newBW, Bool resize_now)
+                  unsigned int newBW)
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     RootlessWindowRec *winRec = WINREC(pWin);
     int i;
 
-    RootlessStopDrawing(pWin, FALSE);
-
-    if (resize_now) {
-        unsigned int weight;
-
-        /* We didn't resize anything earlier, so do it now, now that
-           we've finished gravitating the bits. */
-
-        weight = ResizeWeighting(oldX, oldY, oldW, oldH, oldBW,
-                                 newX, newY, newW, newH, newBW);
-
-        SCREENREC(pScreen)->imp->ResizeFrame(winRec->wid, pScreen,
-                                             newX + SCREEN_TO_GLOBAL_X,
-                                             newY + SCREEN_TO_GLOBAL_Y,
-                                             newW, newH, weight);
-    }
-
     /* Redraw everything. FIXME: there must be times when we don't need
        to do this. Perhaps when top-left weighting and no gravity? */
 
@@ -1057,7 +1032,6 @@ RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
     int oldX = 0, oldY = 0, newX = 0, newY = 0;
     unsigned int oldW = 0, oldH = 0, oldBW = 0;
     unsigned int newW = 0, newH = 0, newBW = 0;
-    Bool resize_after = FALSE;
     RegionRec saveRoot;
 
     RL_DEBUG_MSG("movewindow start \n");
@@ -1084,9 +1058,9 @@ RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
             newW = pWin->drawable.width + 2 * newBW;
             newH = pWin->drawable.height + 2 * newBW;
 
-            resize_after = StartFrameResize(pWin, FALSE,
-                                            oldX, oldY, oldW, oldH, oldBW,
-                                            newX, newY, newW, newH, newBW);
+            StartFrameResize(pWin, FALSE,
+                             oldX, oldY, oldW, oldH, oldBW,
+                             newX, newY, newW, newH, newBW);
         }
     }
 
@@ -1115,8 +1089,9 @@ RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind)
                                                y + SCREEN_TO_GLOBAL_Y);
         }
         else {
-            FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
-                              newX, newY, newW, newH, newBW, resize_after);
+            FinishFrameResize(pWin, FALSE,
+                              oldX, oldY, oldW, oldH, oldBW,
+                              newX, newY, newW, newH, newBW);
         }
     }
 
@@ -1139,7 +1114,6 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
     ScreenPtr pScreen = pWin->drawable.pScreen;
     int oldX = 0, oldY = 0, newX = 0, newY = 0;
     unsigned int oldW = 0, oldH = 0, oldBW = 0, newW = 0, newH = 0, newBW = 0;
-    Bool resize_after = FALSE;
     RegionRec saveRoot;
 
     RL_DEBUG_MSG("resizewindow start (win %p (%lu)) ", pWin, RootlessWID(pWin));
@@ -1158,9 +1132,9 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
             newW = w + 2 * newBW;
             newH = h + 2 * newBW;
 
-            resize_after = StartFrameResize(pWin, TRUE,
-                                            oldX, oldY, oldW, oldH, oldBW,
-                                            newX, newY, newW, newH, newBW);
+            StartFrameResize(pWin, TRUE,
+                             oldX, oldY, oldW, oldH, oldBW,
+                             newX, newY, newW, newH, newBW);
         }
 
         HUGE_ROOT(pWin);
@@ -1170,8 +1144,9 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
         NORMAL_ROOT(pWin);
 
         if (winRec) {
-            FinishFrameResize(pWin, TRUE, oldX, oldY, oldW, oldH, oldBW,
-                              newX, newY, newW, newH, newBW, resize_after);
+            FinishFrameResize(pWin, TRUE,
+                              oldX, oldY, oldW, oldH, oldBW,
+                              newX, newY, newW, newH, newBW);
         }
     }
     else {
@@ -1328,7 +1303,6 @@ void
 RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
 {
     RegionRec saveRoot;
-    Bool resize_after = FALSE;
 
     RL_DEBUG_MSG("change border width ");
 
@@ -1351,9 +1325,9 @@ RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
             newW = pWin->drawable.width + 2 * newBW;
             newH = pWin->drawable.height + 2 * newBW;
 
-            resize_after = StartFrameResize(pWin, FALSE,
-                                            oldX, oldY, oldW, oldH, oldBW,
-                                            newX, newY, newW, newH, newBW);
+            StartFrameResize(pWin, FALSE,
+                             oldX, oldY, oldW, oldH, oldBW,
+                             newX, newY, newW, newH, newBW);
         }
 
         HUGE_ROOT(pWin);
@@ -1363,8 +1337,9 @@ RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
         NORMAL_ROOT(pWin);
 
         if (winRec) {
-            FinishFrameResize(pWin, FALSE, oldX, oldY, oldW, oldH, oldBW,
-                              newX, newY, newW, newH, newBW, resize_after);
+            FinishFrameResize(pWin, FALSE,
+                              oldX, oldY, oldW, oldH, oldBW,
+                              newX, newY, newW, newH, newBW);
         }
     }
 
commit 1b36a10bd48043fe18f77b532da30fbf7b38a02d
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Mon Jan 2 18:59:49 2023 -0800

    rootless: Remove the special case for northwest gravity in StartFrameResize
    
    I don't see a reason why we would want to preserve pixels that are going to
    not be visible anyways.  The rootless implementation already handles
    preserving the relevant bits for us.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index d84e27358..ce8b22b3d 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -861,7 +861,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
     RootlessWindowRec *winRec = WINREC(pWin);
-    Bool need_window_source = FALSE, resize_after = FALSE;
+    Bool resize_after = FALSE;
 
     BoxRec rect;
     int oldX2, newX2;
@@ -905,119 +905,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
 
     gResizeDeathCount = 0;
 
-    if (gravity && weight == RL_GRAVITY_NORTH_WEST) {
-        unsigned int code = 0;
-
-        /* Top left corner is anchored. We never need to copy the
-           entire window. */
-
-        need_window_source = TRUE;
-
-        /* These comparisons were chosen to avoid setting bits when the sizes
-           are the same. (So the fastest case automatically gets taken when
-           dimensions are unchanging.) */
-
-        if (newW < oldW)
-            code |= WIDTH_SMALLER;
-        if (newH < oldH)
-            code |= HEIGHT_SMALLER;
-
-        if (((code ^ (code >> 1)) & 1) == 0) {
-            /* Both dimensions are either getting larger, or both
-               are getting smaller. No need to copy anything. */
-
-            if (code == (WIDTH_SMALLER | HEIGHT_SMALLER)) {
-                /* Since the window is getting smaller, we can do gravity
-                   repair on it with its current size, then resize it
-                   afterwards. */
-
-                resize_after = TRUE;
-            }
-
-            gResizeDeathCount = 1;
-        }
-        else {
-            unsigned int copy_rowbytes, Bpp;
-            unsigned int copy_rect_width, copy_rect_height;
-            BoxRec copy_rect;
-
-            /* We can get away with a partial copy. 'rect' is the
-               intersection between old and new bounds, so copy
-               everything to the right of or below the intersection. */
-
-            RootlessStartDrawing(pWin);
-
-            if (code == WIDTH_SMALLER) {
-                copy_rect.x1 = rect.x2;
-                copy_rect.y1 = rect.y1;
-                copy_rect.x2 = oldX2;
-                copy_rect.y2 = oldY2;
-            }
-            else if (code == HEIGHT_SMALLER) {
-                copy_rect.x1 = rect.x1;
-                copy_rect.y1 = rect.y2;
-                copy_rect.x2 = oldX2;
-                copy_rect.y2 = oldY2;
-            }
-            else
-                OsAbort();
-
-            Bpp = winRec->win->drawable.bitsPerPixel / 8;
-            copy_rect_width = copy_rect.x2 - copy_rect.x1;
-            copy_rect_height = copy_rect.y2 - copy_rect.y1;
-            copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31;
-            gResizeDeathBits = xallocarray(copy_rowbytes, copy_rect_height);
-
-            if (copy_rect_width * copy_rect_height >
-                rootless_CopyBytes_threshold &&
-                SCREENREC(pScreen)->imp->CopyBytes) {
-                SCREENREC(pScreen)->imp->CopyBytes(copy_rect_width * Bpp,
-                                                   copy_rect_height,
-                                                   ((char *) winRec->pixelData)
-                                                   +
-                                                   ((copy_rect.y1 -
-                                                     oldY) *
-                                                    winRec->bytesPerRow)
-                                                   + (copy_rect.x1 -
-                                                      oldX) * Bpp,
-                                                   winRec->bytesPerRow,
-                                                   gResizeDeathBits,
-                                                   copy_rowbytes);
-            }
-            else {
-                fbBlt((FbBits *) (winRec->pixelData
-                                  +
-                                  ((copy_rect.y1 - oldY) * winRec->bytesPerRow)
-                                  + (copy_rect.x1 - oldX) * Bpp),
-                      winRec->bytesPerRow / sizeof(FbBits), 0,
-                      (FbBits *) gResizeDeathBits,
-                      copy_rowbytes / sizeof(FbBits), 0, copy_rect_width * Bpp,
-                      copy_rect_height, GXcopy, FB_ALLONES, Bpp, 0, 0);
-            }
-
-            gResizeDeathBounds[1] = copy_rect;
-            gResizeDeathPix[1]
-                = GetScratchPixmapHeader(pScreen, copy_rect_width,
-                                         copy_rect_height,
-                                         winRec->win->drawable.depth,
-                                         winRec->win->drawable.bitsPerPixel,
-                                         winRec->bytesPerRow,
-                                         (void *) gResizeDeathBits);
-
-            SetPixmapBaseToScreen(gResizeDeathPix[1],
-                                  copy_rect.x1, copy_rect.y1);
-
-            gResizeDeathCount = 2;
-        }
-    }
-    else if (gravity) {
-        /* The general case. Just copy everything. */
-        need_window_source = TRUE;
-    }
-
-    /* If necessary, create a source pixmap pointing at the current
-       window bits. */
-    if (need_window_source) {
+    if (gravity) {
         RootlessStartDrawing(pWin);
 
         gResizeDeathBits = xallocarray(winRec->bytesPerRow, winRec->height);
commit 305e627c013c23431f7503542f00174623f51288
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Mon Jan 2 23:52:36 2023 -0800

    rootless: Use RL_GRAVITY_NORTH_WEST for min/max/zoom resizing
    
    If none of the four corners is fixed, we can use RL_GRAVITY_NORTH_WEST weighting
    for the operation to let the implementation presetve the window bits for us.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 5e371e0d1..d84e27358 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -845,7 +845,7 @@ ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW,
     else if (newX2 == oldX2 && newY1 == oldY1)
         return RL_GRAVITY_NORTH_EAST;
     else
-        return RL_GRAVITY_NONE;
+        return RL_GRAVITY_NORTH_WEST;
 }
 
 /*
commit 65ee3248f52e64fea482114f87317a842f500ae6
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Mon Jan 2 22:33:00 2023 -0800

    rootless: Ensure gResizeDeathPix is stored in locally-managed memory rather than re-using the implementation's backing store
    
    The implementation owns the pointer during RootlessStopDrawing and
    RootlessStartDrawing and is free to (does) change it.  Rootless
    cannot assume ownership of this memory region.  This is possibly
    the cause of some hard to diagnose crashes in XQuartz over the
    years.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index bacab4cb7..5e371e0d1 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1012,7 +1012,12 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
     }
     else if (gravity) {
         /* The general case. Just copy everything. */
+        need_window_source = TRUE;
+    }
 
+    /* If necessary, create a source pixmap pointing at the current
+       window bits. */
+    if (need_window_source) {
         RootlessStartDrawing(pWin);
 
         gResizeDeathBits = xallocarray(winRec->bytesPerRow, winRec->height);
@@ -1054,21 +1059,6 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
 
     RootlessStartDrawing(pWin);
 
-    /* If necessary, create a source pixmap pointing at the current
-       window bits. */
-
-    if (need_window_source) {
-        gResizeDeathBounds[0] = (BoxRec) {
-        oldX, oldY, oldX2, oldY2};
-        gResizeDeathPix[0]
-            = GetScratchPixmapHeader(pScreen, oldW, oldH,
-                                     winRec->win->drawable.depth,
-                                     winRec->win->drawable.bitsPerPixel,
-                                     winRec->bytesPerRow, winRec->pixelData);
-
-        SetPixmapBaseToScreen(gResizeDeathPix[0], oldX, oldY);
-    }
-
     /* Use custom CopyWindow when moving gravity bits around
        ResizeWindow assumes the old window contents are in the same
        pixmap, but here they're in deathPix instead. */
commit f71ef2f02f4649663a6d666618a32f7667fd50c3
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Mon Jan 2 19:43:21 2023 -0800

    rootless: Remove option to disable ROOTLESS_RESIZE_GRAVITY
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index 754715d33..8a3b2bedf 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -88,14 +88,6 @@ rootlessConfig.h:
         the underlying window server. Most operations will be buffered until
         this time has expired.
 
-      o ROOTLESS_RESIZE_GRAVITY: If the underlying window system supports it,
-        some frame resizes can be optimized by relying on the frame contents
-        maintaining a particular gravity during the resize. In this way less
-        of the frame contents need to be preserved by the generic rootless
-        layer. If true, the generic rootless layer will pass gravity hints
-        during resizing and rely on the frame contents being preserved
-        accordingly.
-
         The following runtime options are defined in rootless.h:
 
       o rootlessGlobalOffsetX, rootlessGlobalOffsetY: These specify the global
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index ed3b6c489..b375731bf 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -140,8 +140,7 @@ typedef void (*RootlessMoveFrameProc)
  *  pScreen     Screen to move the new frame to
  *  newX, newY  New position of the frame
  *  newW, newH  New size of the frame
- *  gravity     Gravity for window contents (rl_gravity_enum). This is always
- *              RL_GRAVITY_NONE unless ROOTLESS_RESIZE_GRAVITY is set.
+ *  gravity     Gravity for window contents (rl_gravity_enum).
  */
 typedef void (*RootlessResizeFrameProc)
  (RootlessFrameID wid, ScreenPtr pScreen,
diff --git a/miext/rootless/rootlessConfig.h b/miext/rootless/rootlessConfig.h
index 4c464b9f5..80c2f6d8a 100644
--- a/miext/rootless/rootlessConfig.h
+++ b/miext/rootless/rootlessConfig.h
@@ -34,10 +34,6 @@
 #ifndef _ROOTLESSCONFIG_H
 #define _ROOTLESSCONFIG_H
 
-#ifdef __APPLE__
-#define ROOTLESS_RESIZE_GRAVITY TRUE
-#endif
-
 /*# define ROOTLESSDEBUG*/
 
 #define ROOTLESS_PROTECT_ALPHA TRUE
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index fe09c7fe5..bacab4cb7 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -833,7 +833,6 @@ static inline unsigned int
 ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW,
                 int newX1, int newY1, int newX2, int newY2, int newBW)
 {
-#ifdef ROOTLESS_RESIZE_GRAVITY
     if (newBW != oldBW)
         return RL_GRAVITY_NONE;
 
@@ -847,9 +846,6 @@ ResizeWeighting(int oldX1, int oldY1, int oldX2, int oldY2, int oldBW,
         return RL_GRAVITY_NORTH_EAST;
     else
         return RL_GRAVITY_NONE;
-#else
-    return RL_GRAVITY_NONE;
-#endif
 }
 
 /*
commit 20f5b270d3d289b99063d307c048f121b9544261
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Jan 1 10:47:17 2023 -0800

    rootless: Fixup some format errors in debug logging
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index 83dec3bb7..d9a4d05e9 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -282,4 +282,5 @@ void RootlessDisableRoot(ScreenPtr pScreen);
 
 void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 
+unsigned long RootlessWID(WindowPtr pWindow);
 #endif                          /* _ROOTLESSCOMMON_H */
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 52d9df9ce..5af18a4a0 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -549,7 +549,7 @@ RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
     GC_SAVE(pGC);
     GCOP_UNWRAP(pGC);
 
-    RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
+    RL_DEBUG_MSG("copy area start (src %p, dst %p)", pSrc, dst);
 
     if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr) pSrc)) {
         /* If both source and dest are windows, and we're doing
@@ -800,7 +800,7 @@ static void
 RootlessPolySegment(DrawablePtr dst, GCPtr pGC, int nseg, xSegment * pSeg)
 {
     GCOP_UNWRAP(pGC);
-    RL_DEBUG_MSG("poly segment start (win 0x%x)", dst);
+    RL_DEBUG_MSG("poly segment start (dst %p)", dst);
 
     RootlessStartDrawing((WindowPtr) dst);
     pGC->ops->PolySegment(dst, pGC, nseg, pSeg);
@@ -998,7 +998,7 @@ RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
 {
     GC_SAVE(pGC);
     GCOP_UNWRAP(pGC);
-    RL_DEBUG_MSG("fill poly start (win 0x%x, fillStyle 0x%x)", dst,
+    RL_DEBUG_MSG("fill poly start (dst %p, fillStyle 0x%x)", dst,
                  pGC->fillStyle);
 
     if (count <= 2) {
@@ -1072,7 +1072,7 @@ RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
 {
     GC_SAVE(pGC);
     GCOP_UNWRAP(pGC);
-    RL_DEBUG_MSG("fill rect start (win 0x%x, fillStyle 0x%x)", dst,
+    RL_DEBUG_MSG("fill rect start (dst %p, fillStyle 0x%x)", dst,
                  pGC->fillStyle);
 
     if (nRectsInit <= 0) {
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 106d4320e..fe09c7fe5 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -325,7 +325,7 @@ RootlessPositionWindow(WindowPtr pWin, int x, int y)
     RootlessWindowRec *winRec = WINREC(pWin);
     Bool result;
 
-    RL_DEBUG_MSG("positionwindow start (win 0x%x @ %i, %i)\n", pWin, x, y);
+    RL_DEBUG_MSG("positionwindow start (win %p (%lu) @ %i, %i)\n", pWin, RootlessWID(pWin), x, y);
 
     if (winRec) {
         if (winRec->is_drawing) {
@@ -441,7 +441,7 @@ RootlessRealizeWindow(WindowPtr pWin)
     RegionRec saveRoot;
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
-    RL_DEBUG_MSG("realizewindow start (win 0x%x) ", pWin);
+    RL_DEBUG_MSG("realizewindow start (win %p (%lu)) ", pWin, RootlessWID(pWin));
 
     if ((IsTopLevel(pWin) && pWin->drawable.class == InputOutput)) {
         RootlessWindowRec *winRec;
@@ -664,7 +664,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
     RegionRec rgnDst;
     int dx, dy;
 
-    RL_DEBUG_MSG("resizecopywindowFB start (win 0x%x) ", pWin);
+    RL_DEBUG_MSG("resizecopywindowFB start (win %p (%lu)) ", pWin, RootlessWID(pWin));
 
     /* Don't unwrap pScreen->CopyWindow.
        The bogus rewrap with RootlessCopyWindow causes a crash if
@@ -733,7 +733,7 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     BoxPtr extents;
     int area;
 
-    RL_DEBUG_MSG("copywindowFB start (win 0x%x) ", pWin);
+    RL_DEBUG_MSG("copywindowFB start (win %p (%lu)) ", pWin, RootlessWID(pWin));
 
     SCREEN_UNWRAP(pScreen, CopyWindow);
 
@@ -1268,7 +1268,7 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y,
     Bool resize_after = FALSE;
     RegionRec saveRoot;
 
-    RL_DEBUG_MSG("resizewindow start (win 0x%x) ", pWin);
+    RL_DEBUG_MSG("resizewindow start (win %p (%lu)) ", pWin, RootlessWID(pWin));
 
     if (pWin->parent) {
         if (winRec) {
@@ -1649,7 +1649,7 @@ RootlessSetPixmapOfAncestors(WindowPtr pWin)
             XID pixel = 0;
 
             ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
-            RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
+            RL_DEBUG_MSG("Cleared ParentRelative on %p (%lu).\n", pWin, RootlessWID(pWin));
             break;
         }
 


More information about the xorg-commit mailing list