diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-05-01 07:41:19 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-05-01 07:41:19 +0000 |
commit | 1bf67d07bd27db8be1a8227902cf1cd497dde6e2 (patch) | |
tree | fccd421189958ad207e156f236677682c5c96184 /xserver/miext | |
parent | b6fb6c37ff0e39007f5fa5f4bc6a89435a2041d0 (diff) |
Merge X server 21.1.8. tested by kn@ and op@.
Diffstat (limited to 'xserver/miext')
-rw-r--r-- | xserver/miext/rootless/rootlessCommon.c | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/xserver/miext/rootless/rootlessCommon.c b/xserver/miext/rootless/rootlessCommon.c index 504362790..44c2c3789 100644 --- a/xserver/miext/rootless/rootlessCommon.c +++ b/xserver/miext/rootless/rootlessCommon.c @@ -134,6 +134,23 @@ RootlessResolveColormap(ScreenPtr pScreen, int first_color, return TRUE; } +unsigned long RootlessWID(WindowPtr pWindow) { + ScreenPtr pScreen = pWindow->drawable.pScreen; + WindowPtr top = TopLevelParent(pWindow); + RootlessWindowRec *winRec; + PixmapPtr curPixmap; + + if (top == NULL) { + return 0; + } + winRec = WINREC(top); + if (winRec == NULL) { + return 0; + } + + return (unsigned long)(uintptr_t)winRec->wid; +} + /* * RootlessStartDrawing * Prepare a window for direct access to its backing buffer. @@ -148,11 +165,15 @@ RootlessStartDrawing(WindowPtr pWindow) RootlessWindowRec *winRec; PixmapPtr curPixmap; - if (top == NULL) + if (top == NULL) { + RL_DEBUG_MSG("RootlessStartDrawing is a no-op because top == NULL.\n"); return; + } winRec = WINREC(top); - if (winRec == NULL) + if (winRec == NULL) { + RL_DEBUG_MSG("RootlessStartDrawing is a no-op because winRec == NULL.\n"); return; + } // Make sure the window's top-level parent is prepared for drawing. if (!winRec->is_drawing) { @@ -166,10 +187,23 @@ RootlessStartDrawing(WindowPtr pWindow) top->drawable.depth, top->drawable.bitsPerPixel, winRec->bytesPerRow, winRec->pixelData); + + RL_DEBUG_MSG("GetScratchPixmapHeader gave us %p %p (%d,%d %dx%d %d) for wid=%lu\n", + winRec->pixmap, winRec->pixmap->devPrivate.ptr, winRec->pixmap->drawable.x, + winRec->pixmap->drawable.y, winRec->pixmap->drawable.width, winRec->pixmap->drawable.height, + winRec->pixmap->drawable.bitsPerPixel, RootlessWID(pWindow)); + SetPixmapBaseToScreen(winRec->pixmap, top->drawable.x - bw, top->drawable.y - bw); + RL_DEBUG_MSG("After SetPixmapBaseToScreen(%d %d %d): %p (%d,%d %dx%d %d) for wid=%lu\n", + top->drawable.x, top->drawable.y, bw, winRec->pixmap->devPrivate.ptr, winRec->pixmap->drawable.x, + winRec->pixmap->drawable.y, winRec->pixmap->drawable.width, winRec->pixmap->drawable.height, + winRec->pixmap->drawable.bitsPerPixel, RootlessWID(pWindow)); + winRec->is_drawing = TRUE; + } else { + RL_DEBUG_MSG("Skipped call to xprStartDrawing (wid: %lu) because winRec->is_drawing says we already did.\n", RootlessWID(pWindow)); } curPixmap = pScreen->GetWindowPixmap(pWindow); @@ -181,6 +215,10 @@ RootlessStartDrawing(WindowPtr pWindow) PixmapPtr oldPixmap = dixLookupPrivate(&pWindow->devPrivates, rootlessWindowOldPixmapPrivateKey); + + RL_DEBUG_MSG("curPixmap is %p %p for wid=%lu\n", curPixmap, curPixmap ? curPixmap->devPrivate.ptr : NULL, RootlessWID(pWindow)); + RL_DEBUG_MSG("oldPixmap is %p %p for wid=%lu\n", oldPixmap, oldPixmap ? oldPixmap->devPrivate.ptr : NULL, RootlessWID(pWindow)); + if (oldPixmap != NULL) { if (oldPixmap == curPixmap) RL_DEBUG_MSG @@ -277,7 +315,7 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) WindowPtr pTop; BoxPtr b1, b2; - RL_DEBUG_MSG("Damaged win 0x%x ", pWindow); + RL_DEBUG_MSG("Damaged win %p\n", pWindow); pTop = TopLevelParent(pWindow); if (pTop == NULL) |