? xres-win-pixmap.patch Index: xres.c =================================================================== RCS file: /cvs/xserver/xserver/Xext/xres.c,v retrieving revision 1.9 diff -u -r1.9 xres.c --- xres.c 2 Nov 2003 19:56:10 -0000 1.9 +++ xres.c 7 Dec 2004 23:02:26 -0000 @@ -17,6 +17,7 @@ #include "swaprep.h" #include #include "pixmapstr.h" +#include "windowstr.h" #include "xext.h" extern RESTYPE lastResourceType; @@ -192,6 +193,19 @@ *bytes += (pix->devKind * pix->drawable.height); } +static void +ResFindWindowPixmaps (pointer value, XID id, pointer cdata) +{ + unsigned long *bytes = (unsigned long *)cdata; + WindowPtr pWin = (WindowPtr)value; + + if (pWin->backgroundState == BackgroundPixmap) + { + PixmapPtr pix = pWin->background.pixmap; + *bytes += (pix->devKind * pix->drawable.height); + } +} + static int ProcXResQueryClientPixmapBytes (ClientPtr client) { @@ -216,6 +230,13 @@ FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, (pointer)(&bytes)); + /* + * Make sure win background pixmaps also held to account. + */ + FindClientResourcesByType(clients[clientID], RT_WINDOW, + ResFindWindowPixmaps, + (pointer)(&bytes)); + rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0;