aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xext
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:53:42 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:53:42 +0100
commitd2dae84b3d8daf98062680a31663690718d9e867 (patch)
treed5ba7a097214845b8e4c82b6c56ed4c854f3a49a /nx-X11/programs/Xserver/Xext
parentfccef5fc5794c3aab5c28dbe354c3dc3a86cc07b (diff)
parent49607e93f53c7d15c8d18b36763e855ecb42a496 (diff)
downloadnx-libs-d2dae84b3d8daf98062680a31663690718d9e867.tar.gz
nx-libs-d2dae84b3d8daf98062680a31663690718d9e867.tar.bz2
nx-libs-d2dae84b3d8daf98062680a31663690718d9e867.zip
Merge branch 'uli42-pr/Xext-1.4.2' into 3.6.x
Attributes GH PR #735: https://github.com/ArcticaProject/nx-libs/pull/735
Diffstat (limited to 'nx-X11/programs/Xserver/Xext')
-rw-r--r--nx-X11/programs/Xserver/Xext/dpms.c7
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiX.c46
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiX.h13
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiXSwap.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiXh.h5
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiXprocs.c8
-rw-r--r--nx-X11/programs/Xserver/Xext/saver.c15
-rw-r--r--nx-X11/programs/Xserver/Xext/shm.c20
-rw-r--r--nx-X11/programs/Xserver/Xext/shmint.h2
-rw-r--r--nx-X11/programs/Xserver/Xext/sleepuntil.c1
-rw-r--r--nx-X11/programs/Xserver/Xext/sync.c24
-rw-r--r--nx-X11/programs/Xserver/Xext/xf86bigfont.c1
-rw-r--r--nx-X11/programs/Xserver/Xext/xres.c64
-rw-r--r--nx-X11/programs/Xserver/Xext/xtest.c6
-rw-r--r--nx-X11/programs/Xserver/Xext/xvdisp.c24
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmain.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmc.c2
17 files changed, 127 insertions, 119 deletions
diff --git a/nx-X11/programs/Xserver/Xext/dpms.c b/nx-X11/programs/Xserver/Xext/dpms.c
index 81bbd5179..3342f7738 100644
--- a/nx-X11/programs/Xserver/Xext/dpms.c
+++ b/nx-X11/programs/Xserver/Xext/dpms.c
@@ -196,12 +196,15 @@ static int
ProcDPMSEnable(client)
register ClientPtr client;
{
- /* REQUEST(xDPMSEnableReq); */
+ Bool was_enabled = DPMSEnabled;
REQUEST_SIZE_MATCH(xDPMSEnableReq);
- if (DPMSCapableFlag)
+ if (DPMSCapableFlag) {
DPMSEnabled = TRUE;
+ if (!was_enabled)
+ SetScreenSaverTimer();
+ }
return(client->noClientException);
}
diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c
index e36d04d9e..6eab7f36d 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiX.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiX.c
@@ -55,8 +55,10 @@ Equipment Corporation.
#ifdef RENDER
#include "picturestr.h"
#endif
+
#include "protocol-versions.h"
+
#ifdef GLXPROXY
extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
VisualPtr pVisual,
@@ -107,7 +109,6 @@ static void PanoramiXResetProc(ExtensionEntry*);
#include "panoramiXh.h"
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
-ScreenInfo *GlobalScrInfo = NULL;
static int PanoramiXGCIndex = -1;
static int PanoramiXScreenIndex = -1;
@@ -133,7 +134,7 @@ static void XineramaChangeClip(GCPtr, int, void *, int);
static void XineramaDestroyClip(GCPtr);
static void XineramaCopyClip(GCPtr, GCPtr);
-GCFuncs XineramaGCFuncs = {
+static GCFuncs XineramaGCFuncs = {
XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
};
@@ -166,7 +167,7 @@ XineramaCloseScreen (ScreenPtr pScreen)
return (*pScreen->CloseScreen) (pScreen);
}
-Bool
+static Bool
XineramaCreateGC(GCPtr pGC)
{
ScreenPtr pScreen = pGC->pScreen;
@@ -337,32 +338,11 @@ XineramaDeleteResource(void * data, XID id)
return 1;
}
-
-static Bool
-XineramaFindIDOnAnyScreen(void * resource, XID id, void * privdata)
-{
- PanoramiXRes *res = (PanoramiXRes*)resource;
- int j;
-
- FOR_NSCREENS(j)
- if(res->info[j].id == *((XID*)privdata)) return TRUE;
-
- return FALSE;
-}
-
-PanoramiXRes *
-PanoramiXFindIDOnAnyScreen(RESTYPE type, XID id)
-{
- return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
- XineramaFindIDOnAnyScreen, &id);
-}
-
typedef struct {
int screen;
int id;
} PanoramiXSearchData;
-
static Bool
XineramaFindIDByScrnum(void * resource, XID id, void * privdata)
{
@@ -387,23 +367,6 @@ PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
XineramaFindIDByScrnum, &data);
}
-WindowPtr
-PanoramiXChangeWindow(int ScrnNum, WindowPtr pWin)
-{
- int num = pWin->drawable.pScreen->myNum;
-
- if(num != ScrnNum) {
- PanoramiXRes *win;
-
- win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, num);
-
- if (win)
- pWin = (WindowPtr) LookupIDByType(win->info[ScrnNum].id, RT_WINDOW);
- }
-
- return pWin;
-}
-
typedef struct _connect_callback_list {
void (*func)(void);
struct _connect_callback_list *next;
@@ -494,7 +457,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
if (noPanoramiXExtension)
return;
- GlobalScrInfo = &screenInfo; /* For debug visibility */
PanoramiXNumScreens = screenInfo.numScreens;
if (PanoramiXNumScreens == 1) { /* Only 1 screen */
noPanoramiXExtension = TRUE;
diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.h b/nx-X11/programs/Xserver/Xext/panoramiX.h
index 210ba2751..22b93ea87 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiX.h
+++ b/nx-X11/programs/Xserver/Xext/panoramiX.h
@@ -1,4 +1,3 @@
-/* $TOG: panoramiX.h /main/4 1998/03/17 06:51:02 kaleb $ */
/*****************************************************************
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
@@ -94,18 +93,6 @@ typedef struct {
(a).root = screenInfo.screens[0]->root->drawable.id; \
}
-#define FORCE_WIN(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_WINDOW, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
-#define FORCE_CMAP(a) { \
- if ((win = PanoramiXFindIDOnAnyScreen(XRT_COLORMAP, a))) { \
- (a) = win->info[0].id; /* Real ID */ \
- } \
-}
-
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#define SKIP_FAKE_WINDOW(a) if(!LookupIDByType(a, XRT_WINDOW)) return
diff --git a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c
index c597da39c..4a8dcbdb7 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiXSwap.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiXSwap.c
@@ -68,6 +68,7 @@ SProcPanoramiXGetState(ClientPtr client)
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ swapl (&stuff->window);
return ProcPanoramiXGetState(client);
}
@@ -78,6 +79,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client)
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ swapl (&stuff->window);
return ProcPanoramiXGetScreenCount(client);
}
@@ -88,6 +90,8 @@ SProcPanoramiXGetScreenSize(ClientPtr client)
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ swapl (&stuff->window);
+ swapl (&stuff->screen);
return ProcPanoramiXGetScreenSize(client);
}
diff --git a/nx-X11/programs/Xserver/Xext/panoramiXh.h b/nx-X11/programs/Xserver/Xext/panoramiXh.h
index 6cee650ac..1a76a45cd 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiXh.h
+++ b/nx-X11/programs/Xserver/Xext/panoramiXh.h
@@ -19,10 +19,10 @@ extern int PanoramiXGetGeometry(ClientPtr client);
extern int PanoramiXTranslateCoords(ClientPtr client);
extern int PanoramiXCreatePixmap(ClientPtr client);
extern int PanoramiXFreePixmap(ClientPtr client);
-extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXChangeGC(ClientPtr client);
extern int PanoramiXCopyGC(ClientPtr client);
extern int PanoramiXCopyColormapAndFree(ClientPtr client);
+extern int PanoramiXCreateGC(ClientPtr client);
extern int PanoramiXSetDashes(ClientPtr client);
extern int PanoramiXSetClipRectangles(ClientPtr client);
extern int PanoramiXFreeGC(ClientPtr client);
@@ -64,7 +64,6 @@ PROC_EXTERN(ProcPanoramiXGetScreenSize);
PROC_EXTERN(ProcXineramaQueryScreens);
PROC_EXTERN(ProcXineramaIsActive);
-extern Bool XineramaCreateGC(GCPtr pGC);
extern int SProcPanoramiXDispatch(ClientPtr client);
@@ -72,6 +71,4 @@ extern char *ConnectionInfo;
extern int connBlockScreenStart;
extern xConnSetupPrefix connSetupPrefix;
-extern ScreenInfo *GlobalScrInfo;
extern int (* SavedProcVector[256]) (ClientPtr client);
-
diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
index 053213573..ce12bd9fd 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
@@ -572,7 +572,7 @@ int PanoramiXTranslateCoords(ClientPtr client)
INT16 x, y;
REQUEST(xTranslateCoordsReq);
- register WindowPtr pWin, pDst;
+ WindowPtr pWin, pDst;
xTranslateCoordsReply rep;
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
@@ -1080,8 +1080,8 @@ int PanoramiXCopyArea(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
if (stuff->dstDrawable != stuff->srcDrawable) {
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
- DixReadAccess);
- if ((pDst->pScreen != pSrc->pScreen) ||
+ DixReadAccess);
+ if ((pDst->pScreen != pSrc->pScreen) ||
(pDst->depth != pSrc->depth)) {
client->errorValue = stuff->dstDrawable;
return (BadMatch);
@@ -1186,7 +1186,7 @@ int PanoramiXCopyPlane(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
if (stuff->dstDrawable != stuff->srcDrawable) {
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
- DixReadAccess);
+ DixReadAccess);
if (pdstDraw->pScreen != psrcDraw->pScreen) {
client->errorValue = stuff->dstDrawable;
return (BadMatch);
diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c
index 89eebd7b1..65c43f6b4 100644
--- a/nx-X11/programs/Xserver/Xext/saver.c
+++ b/nx-X11/programs/Xserver/Xext/saver.c
@@ -1,5 +1,4 @@
/*
- * $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $
*
Copyright (c) 1992 X Consortium
@@ -65,7 +64,7 @@ static unsigned char ScreenSaverReqCode = 0;
#endif
static int ScreenSaverEventBase = 0;
-extern DISPATCH_PROC(ProcScreenSaverQueryInfo);
+static DISPATCH_PROC(ProcScreenSaverQueryInfo);
static DISPATCH_PROC(ProcScreenSaverDispatch);
static DISPATCH_PROC(ProcScreenSaverQueryVersion);
static DISPATCH_PROC(ProcScreenSaverSelectInput);
@@ -137,7 +136,7 @@ typedef struct _ScreenSaverSuspension
} ScreenSaverSuspensionRec;
static int ScreenSaverFreeSuspend(
- pointer /*value */,
+ void * /*value */,
XID /* id */
);
@@ -461,7 +460,7 @@ ScreenSaverFreeAttr (value, id)
}
static int
-ScreenSaverFreeSuspend (pointer value, XID id)
+ScreenSaverFreeSuspend (void * value, XID id)
{
ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value;
ScreenSaverSuspensionPtr *prev, this;
@@ -767,7 +766,7 @@ ProcScreenSaverQueryVersion (client)
return (client->noClientException);
}
-int
+static int
ProcScreenSaverQueryInfo (client)
register ClientPtr client;
{
@@ -863,9 +862,7 @@ ScreenSaverSetAttributes (ClientPtr client)
ScreenPtr pScreen;
ScreenSaverScreenPrivatePtr pPriv = 0;
ScreenSaverAttrPtr pAttr = 0;
- int ret;
- int len;
- int class, bw, depth;
+ int ret, len, class, bw, depth;
unsigned long visual;
int idepth, ivisual;
Bool fOK;
@@ -1404,7 +1401,7 @@ ProcScreenSaverSuspend (ClientPtr client)
this->count = 1;
this->clientResource = FakeClientID (client->index);
- if (!AddResource (this->clientResource, SuspendType, (pointer) this))
+ if (!AddResource (this->clientResource, SuspendType, (void *) this))
{
free (this);
return BadAlloc;
diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c
index ca1ff9a7f..8e99b1047 100644
--- a/nx-X11/programs/Xserver/Xext/shm.c
+++ b/nx-X11/programs/Xserver/Xext/shm.c
@@ -758,10 +758,10 @@ CreatePmap:
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
if (size < width * height)
return BadAlloc;
- /* thankfully, offset is unsigned */
- if (stuff->offset + size < size)
- return BadAlloc;
}
+ /* thankfully, offset is unsigned */
+ if (stuff->offset + size < size)
+ return BadAlloc;
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
@@ -820,8 +820,8 @@ static int
ProcShmPutImage(client)
register ClientPtr client;
{
- register GCPtr pGC;
- register DrawablePtr pDraw;
+ GCPtr pGC;
+ DrawablePtr pDraw;
long length;
ShmDescPtr shmdesc;
REQUEST(xShmPutImageReq);
@@ -933,7 +933,7 @@ static int
ProcShmGetImage(client)
register ClientPtr client;
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
long lenPer = 0, length;
Mask plane = 0;
xShmGetImageReply xgi;
@@ -1070,7 +1070,7 @@ ProcShmCreatePixmap(client)
register ClientPtr client;
{
PixmapPtr pMap;
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
DepthPtr pDepth;
register int i;
ShmDescPtr shmdesc;
@@ -1112,9 +1112,9 @@ CreatePmap:
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
if (size < width * height)
return BadAlloc;
- /* thankfully, offset is unsigned */
- if (stuff->offset + size < size)
- return BadAlloc;
+ /* thankfully, offset is unsigned */
+ if (stuff->offset + size < size)
+ return BadAlloc;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
diff --git a/nx-X11/programs/Xserver/Xext/shmint.h b/nx-X11/programs/Xserver/Xext/shmint.h
index 5135d1729..fc056bc72 100644
--- a/nx-X11/programs/Xserver/Xext/shmint.h
+++ b/nx-X11/programs/Xserver/Xext/shmint.h
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright © 2003 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c
index cc43815a7..8d59588f0 100644
--- a/nx-X11/programs/Xserver/Xext/sleepuntil.c
+++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c
@@ -1,5 +1,4 @@
/*
- * $Xorg: sleepuntil.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $
*
Copyright 1992, 1998 The Open Group
diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c
index a0711b77a..bc7cb404a 100644
--- a/nx-X11/programs/Xserver/Xext/sync.c
+++ b/nx-X11/programs/Xserver/Xext/sync.c
@@ -71,9 +71,8 @@ PERFORMANCE OF THIS SOFTWARE.
#include "protocol-versions.h"
#include <stdio.h>
-#if !defined(WIN32)
#include <sys/time.h>
-#endif
+
/*
* Local Global Variables
@@ -572,7 +571,7 @@ SyncSendAlarmNotifyEvents(pAlarm)
/* send to other interested clients */
for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next)
- WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
+ WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
}
@@ -1112,7 +1111,7 @@ SyncComputeBracketValues(pCounter, startOver)
{
SyncTriggerList *pCur;
SyncTrigger *pTrigger;
- SysCounterInfo *psci = pCounter->pSysCounterInfo;
+ SysCounterInfo *psci;
CARD64 *pnewgtval = NULL;
CARD64 *pnewltval = NULL;
SyncCounterType ct;
@@ -1120,6 +1119,7 @@ SyncComputeBracketValues(pCounter, startOver)
if (!pCounter)
return;
+ psci = pCounter->pSysCounterInfo;
ct = pCounter->pSysCounterInfo->counterType;
if (ct == XSyncCounterNeverChanges)
return;
@@ -2460,7 +2460,7 @@ ServertimeQueryValue(pCounter, pValue_return)
static void
ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater)
- void * pCounter;
+ void *pCounter;
CARD64 *pbracket_less;
CARD64 *pbracket_greater;
{
@@ -2480,7 +2480,7 @@ ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater)
}
static void
-SyncInitServerTime()
+SyncInitServerTime(void)
{
CARD64 resolution;
@@ -2502,14 +2502,14 @@ static XSyncValue *pIdleTimeValueLess;
static XSyncValue *pIdleTimeValueGreater;
static void
-IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return)
+IdleTimeQueryValue (void *pCounter, CARD64 *pValue_return)
{
CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
XSyncIntsToValue (pValue_return, idle, 0);
}
static void
-IdleTimeBlockHandler (pointer env, struct timeval **wt, pointer LastSelectMask)
+IdleTimeBlockHandler (void *env, struct timeval **wt, void *LastSelectMask)
{
XSyncValue idle, old_idle;
SyncTriggerList *list = IdleTimeCounter->pTriglist;
@@ -2584,9 +2584,9 @@ IdleTimeBlockHandler (pointer env, struct timeval **wt, pointer LastSelectMask)
}
static void
-IdleTimeWakeupHandler (pointer env,
+IdleTimeWakeupHandler (void * env,
int rc,
- pointer LastSelectMask)
+ void * LastSelectMask)
{
XSyncValue idle;
@@ -2598,14 +2598,14 @@ IdleTimeWakeupHandler (pointer env,
if ((pIdleTimeValueGreater &&
XSyncValueGreaterOrEqual (idle, *pIdleTimeValueGreater)) ||
(pIdleTimeValueLess &&
- XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)))
+ XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)))
{
SyncChangeCounter (IdleTimeCounter, idle);
}
}
static void
-IdleTimeBracketValues (pointer pCounter,
+IdleTimeBracketValues (void *pCounter,
CARD64 *pbracket_less,
CARD64 *pbracket_greater)
{
diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c
index d8cae74ef..08ce9e5d9 100644
--- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c
+++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c
@@ -66,6 +66,7 @@
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include "misc.h"
+#include "os.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "dixfontstr.h"
diff --git a/nx-X11/programs/Xserver/Xext/xres.c b/nx-X11/programs/Xserver/Xext/xres.c
index 03597ad95..977ea4ce6 100644
--- a/nx-X11/programs/Xserver/Xext/xres.c
+++ b/nx-X11/programs/Xserver/Xext/xres.c
@@ -17,6 +17,9 @@
#include "swaprep.h"
#include <nx-X11/extensions/XResproto.h>
#include "pixmapstr.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+
#include "protocol-versions.h"
static int
@@ -171,13 +174,54 @@ ProcXResQueryClientResources (ClientPtr client)
return (client->noClientException);
}
+static unsigned long
+ResGetApproxPixmapBytes (PixmapPtr pix)
+{
+ unsigned long nPixels;
+ int bytesPerPixel;
+
+ bytesPerPixel = pix->drawable.bitsPerPixel>>3;
+ nPixels = pix->drawable.width * pix->drawable.height;
+
+ /* Divide by refcnt as pixmap could be shared between clients,
+ * so total pixmap mem is shared between these.
+ */
+ return ( nPixels * bytesPerPixel ) / pix->refcnt;
+}
+
static void
ResFindPixmaps (void * value, XID id, void * cdata)
{
unsigned long *bytes = (unsigned long *)cdata;
PixmapPtr pix = (PixmapPtr)value;
- *bytes += (pix->devKind * pix->drawable.height);
+ *bytes += ResGetApproxPixmapBytes(pix);
+}
+
+static void
+ResFindWindowPixmaps (void * value, XID id, void * cdata)
+{
+ unsigned long *bytes = (unsigned long *)cdata;
+ WindowPtr pWin = (WindowPtr)value;
+
+ if (pWin->backgroundState == BackgroundPixmap)
+ *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap);
+
+ if (pWin->border.pixmap != NULL && !pWin->borderIsPixel)
+ *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap);
+}
+
+static void
+ResFindGCPixmaps (void * value, XID id, void * cdata)
+{
+ unsigned long *bytes = (unsigned long *)cdata;
+ GCPtr pGC = (GCPtr)value;
+
+ if (pGC->stipple != NULL)
+ *bytes += ResGetApproxPixmapBytes(pGC->stipple);
+
+ if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel)
+ *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
}
static int
@@ -204,6 +248,24 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
(void *)(&bytes));
+ /*
+ * Make sure win background pixmaps also held to account.
+ */
+ FindClientResourcesByType(clients[clientID], RT_WINDOW,
+ ResFindWindowPixmaps,
+ (void *)(&bytes));
+
+ /*
+ * GC Tile & Stipple pixmaps too.
+ */
+ FindClientResourcesByType(clients[clientID], RT_GC,
+ ResFindGCPixmaps,
+ (void *)(&bytes));
+
+#ifdef COMPOSITE
+ /* FIXME: include composite pixmaps too */
+#endif
+
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c
index a392599ea..b05d31ba5 100644
--- a/nx-X11/programs/Xserver/Xext/xtest.c
+++ b/nx-X11/programs/Xserver/Xext/xtest.c
@@ -168,12 +168,10 @@ ProcXTestFakeInput(client)
register ClientPtr client;
{
REQUEST(xXTestFakeInputReq);
- int nev;
- int n;
+ int nev, n, type;
xEvent *ev;
DeviceIntPtr dev = NULL;
WindowPtr root;
- int type;
#ifdef XINPUT
Bool extension = FALSE;
deviceValuator *dv = NULL;
@@ -437,6 +435,8 @@ ProcXTestFakeInput(client)
(root->drawable.pScreen,
ev->u.keyButtonPointer.rootX,
ev->u.keyButtonPointer.rootY, FALSE);
+ dev->valuator->lastx = ev->u.keyButtonPointer.rootX;
+ dev->valuator->lasty = ev->u.keyButtonPointer.rootY;
break;
case ButtonPress:
case ButtonRelease:
diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c
index 5f65c3fcd..54ab4ac48 100644
--- a/nx-X11/programs/Xserver/Xext/xvdisp.c
+++ b/nx-X11/programs/Xserver/Xext/xvdisp.c
@@ -381,10 +381,8 @@ ProcXvQueryAdaptors(ClientPtr client)
xvFormat format;
xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep;
- int totalSize;
- int na;
+ int totalSize, na, nf;
XvAdaptorPtr pa;
- int nf;
XvFormatPtr pf;
WindowPtr pWin;
ScreenPtr pScreen;
@@ -539,9 +537,9 @@ ProcXvQueryEncodings(ClientPtr client)
static int
ProcXvPutVideo(ClientPtr client)
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
XvPortPtr pPort;
- register GCPtr pGC;
+ GCPtr pGC;
int status;
REQUEST(xvPutVideoReq);
@@ -585,9 +583,9 @@ ProcXvPutVideo(ClientPtr client)
static int
ProcXvPutStill(ClientPtr client)
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
XvPortPtr pPort;
- register GCPtr pGC;
+ GCPtr pGC;
int status;
REQUEST(xvPutStillReq);
@@ -632,9 +630,9 @@ ProcXvPutStill(ClientPtr client)
static int
ProcXvGetVideo(ClientPtr client)
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
XvPortPtr pPort;
- register GCPtr pGC;
+ GCPtr pGC;
int status;
REQUEST(xvGetVideoReq);
@@ -679,9 +677,9 @@ ProcXvGetVideo(ClientPtr client)
static int
ProcXvGetStill(ClientPtr client)
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
XvPortPtr pPort;
- register GCPtr pGC;
+ GCPtr pGC;
int status;
REQUEST(xvGetStillReq);
@@ -725,7 +723,7 @@ ProcXvGetStill(ClientPtr client)
static int
ProcXvSelectVideoNotify(ClientPtr client)
{
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
@@ -831,7 +829,7 @@ static int
ProcXvStopVideo(ClientPtr client)
{
int status;
- register DrawablePtr pDraw;
+ DrawablePtr pDraw;
XvPortPtr pPort;
REQUEST(xvStopVideoReq);
REQUEST_SIZE_MATCH(xvStopVideoReq);
diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c
index c1492fdc6..02e3b0eda 100644
--- a/nx-X11/programs/Xserver/Xext/xvmain.c
+++ b/nx-X11/programs/Xserver/Xext/xvmain.c
@@ -153,7 +153,7 @@ static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
*/
void
-XvExtensionInit()
+XvExtensionInit(void)
{
ExtensionEntry *extEntry;
@@ -205,7 +205,7 @@ XvExtensionInit()
}
static Bool
-CreateResourceTypes()
+CreateResourceTypes(void)
{
diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c
index fcd170efd..b24a3c2c8 100644
--- a/nx-X11/programs/Xserver/Xext/xvmc.c
+++ b/nx-X11/programs/Xserver/Xext/xvmc.c
@@ -668,7 +668,7 @@ SProcXvMCDispatch (ClientPtr client)
}
void
-XvMCExtensionInit()
+XvMCExtensionInit(void)
{
ExtensionEntry *extEntry;