aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/composite
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-20 17:39:30 +0200
committermarha <marha@users.sourceforge.net>2012-04-20 17:39:30 +0200
commitae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4 (patch)
treeb18ae337e913f36a95f97530f6a792e9366a393c /xorg-server/composite
parent4207bc7b2972aed9a45756fae8c48957d323fa21 (diff)
parent0e3699334faf92f508b6c187a261548b656b0dd3 (diff)
downloadvcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.tar.gz
vcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.tar.bz2
vcxsrv-ae228baa2cfe88bd7c7de40d5038ad2cc1ecffa4.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/dix/dispatch.c xorg-server/dix/resource.c
Diffstat (limited to 'xorg-server/composite')
-rw-r--r--xorg-server/composite/compext.c25
-rw-r--r--xorg-server/composite/compint.h2
-rw-r--r--xorg-server/composite/compositeext.h2
3 files changed, 28 insertions, 1 deletions
diff --git a/xorg-server/composite/compext.c b/xorg-server/composite/compext.c
index 940eed1fc..1d4d8bf97 100644
--- a/xorg-server/composite/compext.c
+++ b/xorg-server/composite/compext.c
@@ -497,6 +497,28 @@ SProcCompositeDispatch(ClientPtr client)
return BadRequest;
}
+/** @see GetDefaultBytes */
+static void
+GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size)
+{
+ WindowPtr window = value;
+
+ /* Currently only pixmap bytes are reported to clients. */
+ size->resourceSize = 0;
+
+ /* Calculate pixmap reference sizes. */
+ size->pixmapRefSize = 0;
+ if (window->redirectDraw != RedirectDrawNone)
+ {
+ SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+ ResourceSizeRec pixmapSize = { 0, 0 };
+ ScreenPtr screen = window->drawable.pScreen;
+ PixmapPtr pixmap = screen->GetWindowPixmap(window);
+ pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+ size->pixmapRefSize += pixmapSize.pixmapRefSize;
+ }
+}
+
void
CompositeExtensionInit(void)
{
@@ -529,6 +551,9 @@ CompositeExtensionInit(void)
if (!CompositeClientWindowType)
return;
+ SetResourceTypeSizeFunc(CompositeClientWindowType,
+ GetCompositeClientWindowBytes);
+
CompositeClientSubwindowsType = CreateNewResourceType
(FreeCompositeClientSubwindows, "CompositeClientSubwindows");
if (!CompositeClientSubwindowsType)
diff --git a/xorg-server/composite/compint.h b/xorg-server/composite/compint.h
index 6c4272e5b..9e2713e93 100644
--- a/xorg-server/composite/compint.h
+++ b/xorg-server/composite/compint.h
@@ -71,6 +71,7 @@
#include "damageextint.h"
#include "xfixes.h"
#include <X11/extensions/compositeproto.h>
+#include "compositeext.h"
#include <assert.h>
/*
@@ -182,7 +183,6 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
#define GetCompSubwindows(w) ((CompSubwindowsPtr) \
dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
-extern RESTYPE CompositeClientWindowType;
extern RESTYPE CompositeClientSubwindowsType;
extern RESTYPE CompositeClientOverlayType;
diff --git a/xorg-server/composite/compositeext.h b/xorg-server/composite/compositeext.h
index 600604d8d..0b148f029 100644
--- a/xorg-server/composite/compositeext.h
+++ b/xorg-server/composite/compositeext.h
@@ -35,4 +35,6 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
VisualID * vids,
int nVisuals);
+extern _X_EXPORT RESTYPE CompositeClientWindowType;
+
#endif /* _COMPOSITEEXT_H_ */