aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Imakefile9
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c5
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c20
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c755
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h168
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h104
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c20
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c2
10 files changed, 51 insertions, 1038 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index d0efa71e6..be5dd9032 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -93,7 +93,7 @@
#include <X11/cursorfont.h>
#include "Shadow.h"
-#include "Xrandr.h"
+#include <X11/extensions/Xrandr.h>
#include "NXlib.h"
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
index 4d409dc41..794864cf3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile
+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
@@ -24,7 +24,6 @@ SRCS = NXwindow.c \
NXmiexpose.c \
NXresource.c \
NXmiwindow.c \
- NXxrandr.c \
NXdamage.c \
NXmitrap.c \
Args.c \
@@ -87,7 +86,6 @@ OBJS = NXwindow.o \
NXmiexpose.o \
NXresource.o \
NXmiwindow.o \
- NXxrandr.o \
NXdamage.o \
NXmitrap.o \
Args.o \
@@ -134,7 +132,6 @@ OBJS = NXwindow.o \
$(OBJS1)
VFBINCLUDES = -I../../fb -I../../mfb -I../../render
-LIBXRANDRINCLUDES= -I../../../../lib/Xrandr
INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \
-I../../../../extras/Mesa/include \
@@ -143,7 +140,7 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../
-I../../miext/damage -I../../miext/cw \
-I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \
-I$(EXTINCSRC) -I$(XINCLUDESRC) \
- $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \
+ $(VFBINCLUDES) \
`pkg-config --cflags-only-I libxml-2.0`
#ifdef SunArchitecture
INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \
@@ -154,7 +151,7 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../
-I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \
-I../../miext/damage -I../../miext/cw \
-I$(EXTINCSRC) -I$(XINCLUDESRC) \
- $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \
+ $(VFBINCLUDES) \
`pkg-config --cflags-only-I libxml-2.0`
#else
#ifdef cygwinArchitecture
@@ -165,7 +162,7 @@ INCLUDES = -I. -I$(XBUILDINCDIR) \
-I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \
-I../../../../extras/Mesa/include \
-I$(EXTINCSRC) -I$(XINCLUDESRC) \
- $(VFBINCLUDES) $(LIBXRANDRINCLUDES) \
+ $(VFBINCLUDES) \
`pkg-config --cflags-only-I libxml-2.0`
#endif
#endif
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index 3d9ee8c7f..0ed7277a1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -2618,7 +2618,9 @@ ProcPutImage(register ClientPtr client)
tmpImage = (char *)&stuff[1];
lengthProto = length;
-
+ if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height))
+ return BadLength;
+
if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) +
(sizeof(xPutImageReq) >> 2)) != client->req_len)
return BadLength;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
index 922443633..5622f8cee 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -1694,6 +1694,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
GC *pGC;
unsigned char *data;
ITclosurePtr new_closure;
+ ITclosurePtr old_closure;
/* We're putting the client to sleep. We need to
save some state. Similar problem to that handled
@@ -1706,6 +1707,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
err = BadAlloc;
goto bail;
}
+ old_closure = c;
*new_closure = *c;
c = new_closure;
@@ -1713,6 +1715,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
if (!data)
{
xfree(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
@@ -1724,6 +1727,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
{
xfree(c->data);
xfree(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
@@ -1742,6 +1746,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
FreeScratchGC(pGC);
xfree(c->data);
xfree(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index 89e790135..c2f6527a6 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -387,10 +387,11 @@ ProcRenderQueryVersion (ClientPtr client)
register int n;
REQUEST(xRenderQueryVersionReq);
+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
+
pRenderClient->major_version = stuff->majorVersion;
pRenderClient->minor_version = stuff->minorVersion;
- REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -2531,6 +2532,7 @@ SProcRenderQueryVersion (ClientPtr client)
{
register int n;
REQUEST(xRenderQueryVersionReq);
+ REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
swaps(&stuff->length, n);
swapl(&stuff->majorVersion, n);
@@ -2543,6 +2545,7 @@ SProcRenderQueryPictFormats (ClientPtr client)
{
register int n;
REQUEST(xRenderQueryPictFormatsReq);
+ REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
swaps(&stuff->length, n);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2552,6 +2555,7 @@ SProcRenderQueryPictIndexValues (ClientPtr client)
{
register int n;
REQUEST(xRenderQueryPictIndexValuesReq);
+ REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
swaps(&stuff->length, n);
swapl(&stuff->format, n);
return (*ProcRenderVector[stuff->renderReqType]) (client);
@@ -2568,6 +2572,7 @@ SProcRenderCreatePicture (ClientPtr client)
{
register int n;
REQUEST(xRenderCreatePictureReq);
+ REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
swaps(&stuff->length, n);
swapl(&stuff->pid, n);
swapl(&stuff->drawable, n);
@@ -2582,6 +2587,7 @@ SProcRenderChangePicture (ClientPtr client)
{
register int n;
REQUEST(xRenderChangePictureReq);
+ REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
swapl(&stuff->mask, n);
@@ -2594,6 +2600,7 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
{
register int n;
REQUEST(xRenderSetPictureClipRectanglesReq);
+ REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
SwapRestS(stuff);
@@ -2605,6 +2612,7 @@ SProcRenderFreePicture (ClientPtr client)
{
register int n;
REQUEST(xRenderFreePictureReq);
+ REQUEST_SIZE_MATCH(xRenderFreePictureReq);
swaps(&stuff->length, n);
swapl(&stuff->picture, n);
return (*ProcRenderVector[stuff->renderReqType]) (client);
@@ -2615,6 +2623,7 @@ SProcRenderComposite (ClientPtr client)
{
register int n;
REQUEST(xRenderCompositeReq);
+ REQUEST_SIZE_MATCH(xRenderCompositeReq);
swaps(&stuff->length, n);
swapl(&stuff->src, n);
swapl(&stuff->mask, n);
@@ -2635,6 +2644,7 @@ SProcRenderScale (ClientPtr client)
{
register int n;
REQUEST(xRenderScaleReq);
+ REQUEST_SIZE_MATCH(xRenderScaleReq);
swaps(&stuff->length, n);
swapl(&stuff->src, n);
swapl(&stuff->dst, n);
@@ -2740,6 +2750,7 @@ SProcRenderCreateGlyphSet (ClientPtr client)
{
register int n;
REQUEST(xRenderCreateGlyphSetReq);
+ REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
swaps(&stuff->length, n);
swapl(&stuff->gsid, n);
swapl(&stuff->format, n);
@@ -2751,6 +2762,7 @@ SProcRenderReferenceGlyphSet (ClientPtr client)
{
register int n;
REQUEST(xRenderReferenceGlyphSetReq);
+ REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
swaps(&stuff->length, n);
swapl(&stuff->gsid, n);
swapl(&stuff->existing, n);
@@ -2762,6 +2774,7 @@ SProcRenderFreeGlyphSet (ClientPtr client)
{
register int n;
REQUEST(xRenderFreeGlyphSetReq);
+ REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
swaps(&stuff->length, n);
swapl(&stuff->glyphset, n);
return (*ProcRenderVector[stuff->renderReqType]) (client);
@@ -2776,6 +2789,7 @@ SProcRenderAddGlyphs (ClientPtr client)
void *end;
xGlyphInfo *gi;
REQUEST(xRenderAddGlyphsReq);
+ REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
swaps(&stuff->length, n);
swapl(&stuff->glyphset, n);
swapl(&stuff->nglyphs, n);
@@ -2812,6 +2826,7 @@ SProcRenderFreeGlyphs (ClientPtr client)
{
register int n;
REQUEST(xRenderFreeGlyphsReq);
+ REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
swaps(&stuff->length, n);
swapl(&stuff->glyphset, n);
SwapRestL(stuff);
@@ -2830,7 +2845,8 @@ SProcRenderCompositeGlyphs (ClientPtr client)
int size;
REQUEST(xRenderCompositeGlyphsReq);
-
+ REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq);
+
switch (stuff->renderReqType) {
default: size = 1; break;
case X_RenderCompositeGlyphs16: size = 2; break;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c
deleted file mode 100644
index 37b2c74fd..000000000
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/**************************************************************************/
-/* */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
-/* */
-/* NXAGENT, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present */
-/* software is allowed according to terms specified in the file LICENSE */
-/* which comes in the source distribution. */
-/* */
-/* Check http://www.nomachine.com/licensing.html for applicability. */
-/* */
-/* NX and NoMachine are trademarks of Medialogic S.p.A. */
-/* */
-/* All rights reserved. */
-/* */
-/**************************************************************************/
-
-/*
- * $XFree86: xc/lib/Xrandr/Xrandr.c,v 1.13tsi Exp $
- *
- * Copyright © 2000 Compaq Computer Corporation, Inc.
- * Copyright © 2002 Hewlett Packard Company, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq or HP not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. HP makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Jim Gettys, HP Labs, HP.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <X11/Xlib.h>
-/* we need to be able to manipulate the Display structure on events */
-#include <X11/Xlibint.h>
-#include <X11/extensions/render.h>
-#include <X11/extensions/Xrender.h>
-
-#include "NXxrandrint.h"
-
-XExtensionInfo XRRExtensionInfo;
-char XRRExtensionName[] = RANDR_NAME;
-
-static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire);
-static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire);
-
-static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, Window window);
-
-static int
-XRRCloseDisplay (Display *dpy, XExtCodes *codes);
-
-static /* const */ XExtensionHooks rr_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- XRRCloseDisplay, /* close_display */
- XRRWireToEvent, /* wire_to_event */
- XRREventToWire, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
-{
- XExtDisplayInfo *info = XRRFindDisplay(dpy);
- XRRScreenChangeNotifyEvent *aevent;
- xRRScreenChangeNotifyEvent *awire;
-
- RRCheckExtension(dpy, info, False);
-
- switch ((wire->u.u.type & 0x7F) - info->codes->first_event)
- {
- case RRScreenChangeNotify:
- awire = (xRRScreenChangeNotifyEvent *) wire;
- aevent = (XRRScreenChangeNotifyEvent *) event;
- aevent->type = awire->type & 0x7F;
- aevent->serial = _XSetLastRequestRead(dpy,
- (xGenericReply *) wire);
- aevent->send_event = (awire->type & 0x80) != 0;
- aevent->display = dpy;
- aevent->window = awire->window;
- aevent->root = awire->root;
- aevent->timestamp = awire->timestamp;
- aevent->config_timestamp = awire->configTimestamp;
- aevent->size_index = awire->sizeID;
- aevent->subpixel_order = awire->subpixelOrder;
- aevent->rotation = awire->rotation;
- aevent->width = awire->widthInPixels;
- aevent->height = awire->heightInPixels;
- aevent->mwidth = awire->widthInMillimeters;
- aevent->mheight = awire->heightInMillimeters;
- return True;
- }
-
- return False;
-}
-
-static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
-{
- XExtDisplayInfo *info = XRRFindDisplay(dpy);
- XRRScreenChangeNotifyEvent *aevent;
- xRRScreenChangeNotifyEvent *awire;
-
- RRCheckExtension(dpy, info, False);
-
- switch ((event->type & 0x7F) - info->codes->first_event)
- {
- case RRScreenChangeNotify:
- awire = (xRRScreenChangeNotifyEvent *) wire;
- aevent = (XRRScreenChangeNotifyEvent *) event;
- awire->type = aevent->type | (aevent->send_event ? 0x80 : 0);
- awire->rotation = (CARD8) aevent->rotation;
- awire->sequenceNumber = aevent->serial & 0xFFFF;
- awire->timestamp = aevent->timestamp;
- awire->configTimestamp = aevent->config_timestamp;
- awire->root = aevent->root;
- awire->window = aevent->window;
- awire->sizeID = aevent->size_index;
- awire->subpixelOrder = aevent->subpixel_order;
- awire->widthInPixels = aevent->width;
- awire->heightInPixels = aevent->height;
- awire->widthInMillimeters = aevent->mwidth;
- awire->heightInMillimeters = aevent->mheight;
- return True;
- }
- return False;
-}
-
-XExtDisplayInfo *
-XRRFindDisplay (Display *dpy)
-{
- XExtDisplayInfo *dpyinfo;
- XRandRInfo *xrri;
- int i, numscreens;
-
- dpyinfo = XextFindDisplay (&XRRExtensionInfo, dpy);
- if (!dpyinfo) {
- dpyinfo = XextAddDisplay (&XRRExtensionInfo, dpy,
- XRRExtensionName,
- &rr_extension_hooks,
- RRNumberEvents, 0);
- numscreens = ScreenCount(dpy);
- xrri = Xmalloc (sizeof(XRandRInfo) +
- sizeof(char *) * numscreens);
- xrri->config = (XRRScreenConfiguration **)(xrri + 1);
- for(i = 0; i < numscreens; i++)
- xrri->config[i] = NULL;
- xrri->major_version = -1;
- dpyinfo->data = (char *) xrri;
- }
- return dpyinfo;
-}
-
-static int
-XRRCloseDisplay (Display *dpy, XExtCodes *codes)
-{
- int i;
- XRRScreenConfiguration **configs;
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
- XRandRInfo *xrri;
-
- LockDisplay(dpy);
- /*
- * free cached data
- */
- if (XextHasExtension(info)) {
- xrri = (XRandRInfo *) info->data;
- if (xrri) {
- configs = xrri->config;
-
- for (i = 0; i < ScreenCount(dpy); i++) {
- if (configs[i] != NULL) XFree (configs[i]);
- }
- XFree (xrri);
- }
- }
- UnlockDisplay(dpy);
- return XextRemoveDisplay (&XRRExtensionInfo, dpy);
-}
-
-
-Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation)
-{
- *current_rotation = config->current_rotation;
- return config->rotations;
-}
-
-XRRScreenSize *XRRConfigSizes(XRRScreenConfiguration *config, int *nsizes)
-{
- *nsizes = config->nsizes;
- return config->sizes;
-}
-
-short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates)
-{
- short *r = config->rates;
- int nents = config->nrates;
-
- /* Skip over the intervening rate lists */
- while (sizeID > 0 && nents > 0)
- {
- int i = (*r + 1);
- r += i;
- nents -= i;
- sizeID--;
- }
- if (!nents)
- {
- *nrates = 0;
- return 0;
- }
- *nrates = (int) *r;
- return r + 1;
-}
-
-Time XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp)
-{
- *config_timestamp = config->config_timestamp;
- return config->timestamp;
-}
-
-
-SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
- Rotation *rotation)
-{
- *rotation = (Rotation) config->current_rotation;
- return (SizeID) config->current_size;
-}
-
-short XRRConfigCurrentRate (XRRScreenConfiguration *config)
-{
- return config->current_rate;
-}
-
-/*
- * Go get the screen configuration data and salt it away for future use;
- * returns NULL if extension not supported
- */
-static XRRScreenConfiguration *_XRRValidateCache (Display *dpy, int screen)
-{
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
- XRRScreenConfiguration **configs;
- XRandRInfo *xrri;
-
- if (XextHasExtension(info)) {
- xrri = (XRandRInfo *) info->data;
- configs = xrri->config;
-
- if (configs[screen] == NULL)
- configs[screen] = _XRRGetScreenInfo (dpy, RootWindow(dpy, screen));
- return configs[screen];
- } else {
- return NULL;
- }
-}
-
-/* given a screen, return the information from the (possibly) cached data */
-Rotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation)
-{
- XRRScreenConfiguration *config;
- Rotation cr;
- LockDisplay(dpy);
- if ((config = _XRRValidateCache(dpy, screen))) {
- *current_rotation = config->current_rotation;
- cr = config->rotations;
- UnlockDisplay(dpy);
- return cr;
- }
- else {
- UnlockDisplay(dpy);
- *current_rotation = RR_Rotate_0;
- return 0; /* no rotations supported */
- }
-}
-
-/* given a screen, return the information from the (possibly) cached data */
-XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes)
-{
- XRRScreenConfiguration *config;
- XRRScreenSize *sizes;
-
- LockDisplay(dpy);
- if ((config = _XRRValidateCache(dpy, screen))) {
- *nsizes = config->nsizes;
- sizes = config->sizes;
- UnlockDisplay(dpy);
- return sizes;
- }
- else {
- UnlockDisplay(dpy);
- *nsizes = 0;
- return NULL;
- }
-}
-
-short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates)
-{
- XRRScreenConfiguration *config;
- short *rates;
-
- LockDisplay(dpy);
- if ((config = _XRRValidateCache(dpy, screen))) {
- rates = XRRConfigRates (config, sizeID, nrates);
- UnlockDisplay(dpy);
- return rates;
- }
- else {
- UnlockDisplay(dpy);
- *nrates = 0;
- return NULL;
- }
-}
-
-/* given a screen, return the information from the (possibly) cached data */
-Time XRRTimes (Display *dpy, int screen, Time *config_timestamp)
-{
- XRRScreenConfiguration *config;
- Time ts;
-
- LockDisplay(dpy);
- if ((config = _XRRValidateCache(dpy, screen))) {
- *config_timestamp = config->config_timestamp;
- ts = config->timestamp;
- UnlockDisplay(dpy);
- return ts;
- } else {
- UnlockDisplay(dpy);
- return CurrentTime;
- }
-}
-
-int XRRRootToScreen(Display *dpy, Window root)
-{
- int snum;
- for (snum = 0; snum < ScreenCount(dpy); snum++) {
- if (RootWindow(dpy, snum) == root) return snum;
- }
- return -1;
-}
-
-
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep)
-{
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
-
- if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
- return True;
- } else {
- return False;
- }
-}
-
-static Bool
-_XRRHasRates (int major, int minor)
-{
- return major > 1 || (major == 1 && minor >= 1);
-}
-
-Status XRRQueryVersion (Display *dpy,
- int *major_versionp,
- int *minor_versionp)
-{
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
- xRRQueryVersionReply rep;
- xRRQueryVersionReq *req;
- XRandRInfo *xrri;
-
- RRCheckExtension (dpy, info, 0);
-
- xrri = (XRandRInfo *) info->data;
-
- /*
- * only get the version information from the server if we don't have it already
- */
- if (xrri->major_version == -1) {
- LockDisplay (dpy);
- GetReq (RRQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRQueryVersion;
- req->majorVersion = RANDR_MAJOR;
- req->minorVersion = RANDR_MINOR;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- xrri->major_version = rep.majorVersion;
- xrri->minor_version = rep.minorVersion;
- xrri->has_rates = _XRRHasRates (xrri->major_version, xrri->minor_version);
- }
- *major_versionp = xrri->major_version;
- *minor_versionp = xrri->minor_version;
- UnlockDisplay (dpy);
- SyncHandle ();
- return 1;
-}
-
-typedef struct _randrVersionState {
- unsigned long version_seq;
- Bool error;
- int major_version;
- int minor_version;
-} _XRRVersionState;
-
-static Bool
-_XRRVersionHandler (Display *dpy,
- xReply *rep,
- char *buf,
- int len,
- XPointer data)
-{
- xRRQueryVersionReply replbuf;
- xRRQueryVersionReply *repl;
- _XRRVersionState *state = (_XRRVersionState *) data;
-
- if (dpy->last_request_read != state->version_seq)
- return False;
- if (rep->generic.type == X_Error)
- {
- state->error = True;
- return False;
- }
- repl = (xRRQueryVersionReply *)
- _XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len,
- (SIZEOF(xRRQueryVersionReply) - SIZEOF(xReply)) >> 2,
- True);
- state->major_version = repl->majorVersion;
- state->minor_version = repl->minorVersion;
- return True;
-}
-/* need a version that does not hold the display lock */
-static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, Window window)
-{
- XExtDisplayInfo *info = XRRFindDisplay(dpy);
- xRRGetScreenInfoReply rep;
- xRRGetScreenInfoReq *req;
- _XAsyncHandler async;
- _XRRVersionState async_state;
- int nbytes, nbytesRead, rbytes;
- int i;
- xScreenSizes size;
- struct _XRRScreenConfiguration *scp;
- XRRScreenSize *ssp;
- short *rates;
- xRRQueryVersionReq *vreq;
- XRandRInfo *xrri;
- Bool getting_version = False;
-
- RRCheckExtension (dpy, info, 0);
-
- xrri = (XRandRInfo *) info->data;
-
- if (xrri->major_version == -1)
- {
- /* hide a version query in the request */
- GetReq (RRQueryVersion, vreq);
- vreq->reqType = info->codes->major_opcode;
- vreq->randrReqType = X_RRQueryVersion;
- vreq->majorVersion = RANDR_MAJOR;
- vreq->minorVersion = RANDR_MINOR;
-
- async_state.version_seq = dpy->request;
- async_state.error = False;
- async.next = dpy->async_handlers;
- async.handler = _XRRVersionHandler;
- async.data = (XPointer) &async_state;
- dpy->async_handlers = &async;
-
- getting_version = True;
- }
-
- GetReq (RRGetScreenInfo, req);
- req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRGetScreenInfo;
- req->window = window;
-
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
- {
- if (getting_version)
- DeqAsyncHandler (dpy, &async);
- SyncHandle ();
- return NULL;
- }
- if (getting_version)
- {
- DeqAsyncHandler (dpy, &async);
- if (async_state.error)
- {
- SyncHandle();
- }
- xrri->major_version = async_state.major_version;
- xrri->minor_version = async_state.minor_version;
- xrri->has_rates = _XRRHasRates (xrri->minor_version, xrri->major_version);
- }
-
- /*
- * Make the reply compatible with v1.1
- */
- if (!xrri->has_rates)
- {
- rep.rate = 0;
- rep.nrateEnts = 0;
- }
-
- nbytes = (long) rep.length << 2;
-
- nbytesRead = (long) (rep.nSizes * SIZEOF (xScreenSizes) +
- ((rep.nrateEnts + 1)& ~1) * 2 /* SIZEOF (CARD16) */);
-
- /*
- * first we must compute how much space to allocate for
- * randr library's use; we'll allocate the structures in a single
- * allocation, on cleanlyness grounds.
- */
-
- rbytes = sizeof (XRRScreenConfiguration) +
- (rep.nSizes * sizeof (XRRScreenSize) +
- rep.nrateEnts * sizeof (int));
-
- scp = (struct _XRRScreenConfiguration *) Xmalloc(rbytes);
- if (scp == NULL) {
- _XEatData (dpy, (unsigned long) nbytes);
- SyncHandle ();
- return NULL;
- }
-
-
- ssp = (XRRScreenSize *)(scp + 1);
- rates = (short *) (ssp + rep.nSizes);
-
- /* set up the screen configuration structure */
- scp->screen =
- ScreenOfDisplay (dpy, XRRRootToScreen(dpy, rep.root));
-
- scp->sizes = ssp;
- scp->rates = rates;
- scp->rotations = rep.setOfRotations;
- scp->current_size = rep.sizeID;
- scp->current_rate = rep.rate;
- scp->current_rotation = rep.rotation;
- scp->timestamp = rep.timestamp;
- scp->config_timestamp = rep.configTimestamp;
- scp->nsizes = rep.nSizes;
- scp->nrates = rep.nrateEnts;
-
- /*
- * Time to unpack the data from the server.
- */
-
- /*
- * First the size information
- */
- for (i = 0; i < rep.nSizes; i++) {
- _XReadPad (dpy, (char *) &size, SIZEOF (xScreenSizes));
-
- ssp[i].width = size.widthInPixels;
- ssp[i].height = size.heightInPixels;
- ssp[i].mwidth = size.widthInMillimeters;
- ssp[i].mheight = size.heightInMillimeters;
- }
- /*
- * And the rates
- */
- _XRead16Pad (dpy, rates, 2 /* SIZEOF (CARD16) */ * rep.nrateEnts);
-
- /*
- * Skip any extra data
- */
- if (nbytes > nbytesRead)
- _XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
-
- return (XRRScreenConfiguration *)(scp);
-}
-
-XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy, Window window)
-{
- XRRScreenConfiguration *config;
- XRRFindDisplay(dpy);
- LockDisplay (dpy);
- config = _XRRGetScreenInfo(dpy, window);
- UnlockDisplay (dpy);
- SyncHandle ();
- return config;
-}
-
-
-void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config)
-{
- Xfree (config);
-}
-
-
-/*
- * in protocol version 0.1, routine added to allow selecting for new events.
- */
-
-void XRRSelectInput (Display *dpy, Window window, int mask)
-{
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
- xRRSelectInputReq *req;
-
- RRSimpleCheckExtension (dpy, info);
-
- LockDisplay (dpy);
- GetReq (RRSelectInput, req);
- req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRSelectInput;
- req->window = window;
- req->enable = 0;
- if (mask) req->enable = mask;
- UnlockDisplay (dpy);
- SyncHandle ();
- return;
-}
-
-Status XRRSetScreenConfigAndRate (Display *dpy,
- XRRScreenConfiguration *config,
- Drawable draw,
- int size_index,
- Rotation rotation,
- short rate,
- Time timestamp)
-{
- XExtDisplayInfo *info = XRRFindDisplay (dpy);
- xRRSetScreenConfigReply rep;
- XRandRInfo *xrri;
- int major, minor;
-
- RRCheckExtension (dpy, info, 0);
-
- /* Make sure has_rates is set */
- if (!XRRQueryVersion (dpy, &major, &minor))
- return 0;
-
- LockDisplay (dpy);
- xrri = (XRandRInfo *) info->data;
- if (xrri->has_rates)
- {
- xRRSetScreenConfigReq *req;
- GetReq (RRSetScreenConfig, req);
- req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRSetScreenConfig;
- req->drawable = draw;
- req->sizeID = size_index;
- req->rotation = rotation;
- req->timestamp = timestamp;
- req->configTimestamp = config->config_timestamp;
- req->rate = rate;
- }
- else
- {
- xRR1_0SetScreenConfigReq *req;
- GetReq (RR1_0SetScreenConfig, req);
- req->reqType = info->codes->major_opcode;
- req->randrReqType = X_RRSetScreenConfig;
- req->drawable = draw;
- req->sizeID = size_index;
- req->rotation = rotation;
- req->timestamp = timestamp;
- req->configTimestamp = config->config_timestamp;
- }
-
- (void) _XReply (dpy, (xReply *) &rep, 0, xTrue);
-
- if (rep.status == RRSetConfigSuccess) {
- /* if we succeed, set our view of reality to what we set it to */
- config->config_timestamp = rep.newConfigTimestamp;
- config->timestamp = rep.newTimestamp;
- config->screen = ScreenOfDisplay (dpy, XRRRootToScreen(dpy, rep.root));
- config->current_size = size_index;
- config->current_rotation = rotation;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- return(rep.status);
-}
-
-Status XRRSetScreenConfig (Display *dpy,
- XRRScreenConfiguration *config,
- Drawable draw,
- int size_index,
- Rotation rotation, Time timestamp)
-{
- return XRRSetScreenConfigAndRate (dpy, config, draw, size_index,
- rotation, 0, timestamp);
-}
-
-int XRRUpdateConfiguration(XEvent *event)
-{
- XRRScreenChangeNotifyEvent *scevent;
- XConfigureEvent *rcevent;
- Display *dpy = event->xany.display;
- XExtDisplayInfo *info;
- XRandRInfo *xrri;
- int snum;
-
- /* first, see if it is a vanilla configure notify event */
- if (event->type == ConfigureNotify) {
- rcevent = (XConfigureEvent *) event;
- snum = XRRRootToScreen(dpy, rcevent->window);
- dpy->screens[snum].width = rcevent->width;
- dpy->screens[snum].height = rcevent->height;
- return 1;
- }
-
- info = XRRFindDisplay(dpy);
- RRCheckExtension (dpy, info, 0);
-
- switch (event->type - info->codes->first_event) {
- case RRScreenChangeNotify:
- scevent = (XRRScreenChangeNotifyEvent *) event;
- snum = XRRRootToScreen(dpy,
- ((XRRScreenChangeNotifyEvent *) event)->root);
- dpy->screens[snum].width = scevent->width;
- dpy->screens[snum].height = scevent->height;
- dpy->screens[snum].mwidth = scevent->mwidth;
- dpy->screens[snum].mheight = scevent->mheight;
- XRenderSetSubpixelOrder (dpy, snum, scevent->subpixel_order);
- break;
- default:
- return 0;
- }
- xrri = (XRandRInfo *) info->data;
- /*
- * so the next time someone wants some data, it will be fetched;
- * it might be better to force the round trip immediately, but
- * I dislike pounding the server simultaneously when not necessary
- */
- if (xrri->config[snum] != NULL) {
- XFree (xrri->config[snum]);
- xrri->config[snum] = NULL;
- }
- return 1;
-}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h
deleted file mode 100644
index 160dc6517..000000000
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/**************************************************************************/
-/* */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
-/* */
-/* NXAGENT, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present */
-/* software is allowed according to terms specified in the file LICENSE */
-/* which comes in the source distribution. */
-/* */
-/* Check http://www.nomachine.com/licensing.html for applicability. */
-/* */
-/* NX and NoMachine are trademarks of Medialogic S.p.A. */
-/* */
-/* All rights reserved. */
-/* */
-/**************************************************************************/
-
-/*
- * $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
- *
- * Copyright © 2000 Compaq Computer Corporation, Inc.
- * Copyright © 2002 Hewlett-Packard Company, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. HP makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Jim Gettys, HP Labs, HP.
- */
-
-#ifndef _XRANDR_H_
-#define _XRANDR_H_
-
-#include <X11/extensions/randr.h>
-
-#include <X11/Xfuncproto.h>
-
-_XFUNCPROTOBEGIN
-
-
-typedef struct {
- int width, height;
- int mwidth, mheight;
-} XRRScreenSize;
-
-/*
- * Events.
- */
-
-typedef struct {
- int type; /* event base */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* window which selected for this event */
- Window root; /* Root window for changed screen */
- Time timestamp; /* when the screen change occurred */
- Time config_timestamp; /* when the last configuration change */
- SizeID size_index;
- SubpixelOrder subpixel_order;
- Rotation rotation;
- int width;
- int height;
- int mwidth;
- int mheight;
-} XRRScreenChangeNotifyEvent;
-
-
-/* internal representation is private to the library */
-typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
-
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep);
-Status XRRQueryVersion (Display *dpy,
- int *major_versionp,
- int *minor_versionp);
-
-XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
- Drawable draw);
-
-void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config);
-
-/*
- * Note that screen configuration changes are only permitted if the client can
- * prove it has up to date configuration information. We are trying to
- * insist that it become possible for screens to change dynamically, so
- * we want to ensure the client knows what it is talking about when requesting
- * changes.
- */
-Status XRRSetScreenConfig (Display *dpy,
- XRRScreenConfiguration *config,
- Drawable draw,
- int size_index,
- Rotation rotation,
- Time timestamp);
-
-/* added in v1.1, sorry for the lame name */
-Status XRRSetScreenConfigAndRate (Display *dpy,
- XRRScreenConfiguration *config,
- Drawable draw,
- int size_index,
- Rotation rotation,
- short rate,
- Time timestamp);
-
-
-Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation);
-
-Time XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp);
-
-XRRScreenSize *XRRConfigSizes(XRRScreenConfiguration *config, int *nsizes);
-
-short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates);
-
-SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
- Rotation *rotation);
-
-short XRRConfigCurrentRate (XRRScreenConfiguration *config);
-
-int XRRRootToScreen(Display *dpy, Window root);
-
-/*
- * returns the screen configuration for the specified screen; does a lazy
- * evalution to delay getting the information, and caches the result.
- * These routines should be used in preference to XRRGetScreenInfo
- * to avoid unneeded round trips to the X server. These are new
- * in protocol version 0.1.
- */
-
-
-XRRScreenConfiguration *XRRScreenConfig(Display *dpy, int screen);
-XRRScreenConfiguration *XRRConfig(Screen *screen);
-void XRRSelectInput(Display *dpy, Window window, int mask);
-
-/*
- * the following are always safe to call, even if RandR is not implemented
- * on a screen
- */
-
-
-Rotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation);
-XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes);
-short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates);
-Time XRRTimes (Display *dpy, int screen, Time *config_timestamp);
-
-
-/*
- * intended to take RRScreenChangeNotify, or
- * ConfigureNotify (on the root window)
- * returns 1 if it is an event type it understands, 0 if not
- */
-int XRRUpdateConfiguration(XEvent *event);
-
-_XFUNCPROTOEND
-
-#endif /* _XRANDR_H_ */
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h
deleted file mode 100644
index 97ae77e29..000000000
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/**************************************************************************/
-/* */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
-/* */
-/* NXAGENT, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present */
-/* software is allowed according to terms specified in the file LICENSE */
-/* which comes in the source distribution. */
-/* */
-/* Check http://www.nomachine.com/licensing.html for applicability. */
-/* */
-/* NX and NoMachine are trademarks of Medialogic S.p.A. */
-/* */
-/* All rights reserved. */
-/* */
-/**************************************************************************/
-
-/*
- * $XFree86: xc/lib/Xrandr/Xrandrint.h,v 1.2 2001/06/07 15:33:43 keithp Exp $
- *
- *
- * Copyright © 2000, Compaq Computer Corporation,
- * Copyright © 2002, Hewlett Packard, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq or HP not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. HP makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
- */
-
-#ifndef _XRANDRINT_H_
-#define _XRANDRINT_H_
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-#include <X11/Xlibint.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include <X11/extensions/randr.h>
-#include <X11/extensions/randrproto.h>
-#include "NXxrandr.h"
-
-extern XExtensionInfo XrandrExtensionInfo;
-extern char XrandrExtensionName[];
-
-#define RRCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, XRRExtensionName, val)
-#define RRSimpleCheckExtension(dpy,i) \
- XextSimpleCheckExtension (dpy, i, XRRExtensionName)
-
-XExtDisplayInfo *XRRFindDisplay (Display *dpy);
-
-
-/* deliberately opaque internal data structure; can be extended,
- but not reordered */
-struct _XRRScreenConfiguration {
- Screen *screen; /* the root window in GetScreenInfo */
- XRRScreenSize *sizes;
- Rotation rotations;
- Rotation current_rotation;
- int nsizes;
- int current_size;
- short current_rate;
- Time timestamp;
- Time config_timestamp;
- int subpixel_order; /* introduced in randr v0.1 */
- short *rates; /* introduced in randr v1.1 */
- int nrates;
-};
-
-/*
- * if a configure notify on the root is recieved, or
- * an XRRScreenChangeNotify is recieved,
- * XRRUpdateConfiguration should be called to update the X library's
- * view of the screen configuration; it will also invalidate the cache
- * provided by XRRScreenConfig and XRRConfig, and force a round trip
- * when next used. Returns invalid status if not an event type
- * the library routine understand.
- */
-
-/* we cache one screen configuration/screen */
-
-typedef struct _XRandRInfo {
- XRRScreenConfiguration **config;
- int major_version, minor_version; /* major_version = -1 means we don't know */
- Bool has_rates; /* Server supports refresh rates */
-} XRandRInfo;
-
-#endif /* _XRANDRINT_H_ */
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
index b8543f7a6..cfce34463 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
@@ -1423,6 +1423,7 @@ SProcXvQueryExtension(ClientPtr client)
{
register char n;
REQUEST(xvQueryExtensionReq);
+ REQUEST_SIZE_MATCH(xvQueryExtensionReq);
swaps(&stuff->length, n);
return ProcXvQueryExtension(client);
}
@@ -1432,6 +1433,7 @@ SProcXvQueryAdaptors(ClientPtr client)
{
register char n;
REQUEST(xvQueryAdaptorsReq);
+ REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
swaps(&stuff->length, n);
swapl(&stuff->window, n);
return ProcXvQueryAdaptors(client);
@@ -1442,6 +1444,7 @@ SProcXvQueryEncodings(ClientPtr client)
{
register char n;
REQUEST(xvQueryEncodingsReq);
+ REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
return ProcXvQueryEncodings(client);
@@ -1452,6 +1455,7 @@ SProcXvGrabPort(ClientPtr client)
{
register char n;
REQUEST(xvGrabPortReq);
+ REQUEST_SIZE_MATCH(xvGrabPortReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->time, n);
@@ -1463,6 +1467,7 @@ SProcXvUngrabPort(ClientPtr client)
{
register char n;
REQUEST(xvUngrabPortReq);
+ REQUEST_SIZE_MATCH(xvUngrabPortReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->time, n);
@@ -1474,6 +1479,7 @@ SProcXvPutVideo(ClientPtr client)
{
register char n;
REQUEST(xvPutVideoReq);
+ REQUEST_SIZE_MATCH(xvPutVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1494,6 +1500,7 @@ SProcXvPutStill(ClientPtr client)
{
register char n;
REQUEST(xvPutStillReq);
+ REQUEST_SIZE_MATCH(xvPutStillReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1514,6 +1521,7 @@ SProcXvGetVideo(ClientPtr client)
{
register char n;
REQUEST(xvGetVideoReq);
+ REQUEST_SIZE_MATCH(xvGetVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1534,6 +1542,7 @@ SProcXvGetStill(ClientPtr client)
{
register char n;
REQUEST(xvGetStillReq);
+ REQUEST_SIZE_MATCH(xvGetStillReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1554,6 +1563,7 @@ SProcXvPutImage(ClientPtr client)
{
register char n;
REQUEST(xvPutImageReq);
+ REQUEST_AT_LEAST_SIZE(xvPutImageReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1578,6 +1588,7 @@ SProcXvShmPutImage(ClientPtr client)
{
register char n;
REQUEST(xvShmPutImageReq);
+ REQUEST_SIZE_MATCH(xvShmPutImageReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1605,6 +1616,7 @@ SProcXvSelectVideoNotify(ClientPtr client)
{
register char n;
REQUEST(xvSelectVideoNotifyReq);
+ REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
swaps(&stuff->length, n);
swapl(&stuff->drawable, n);
return ProcXvSelectVideoNotify(client);
@@ -1615,6 +1627,7 @@ SProcXvSelectPortNotify(ClientPtr client)
{
register char n;
REQUEST(xvSelectPortNotifyReq);
+ REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
return ProcXvSelectPortNotify(client);
@@ -1625,6 +1638,7 @@ SProcXvStopVideo(ClientPtr client)
{
register char n;
REQUEST(xvStopVideoReq);
+ REQUEST_SIZE_MATCH(xvStopVideoReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->drawable, n);
@@ -1636,6 +1650,7 @@ SProcXvSetPortAttribute(ClientPtr client)
{
register char n;
REQUEST(xvSetPortAttributeReq);
+ REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->attribute, n);
@@ -1647,6 +1662,7 @@ SProcXvGetPortAttribute(ClientPtr client)
{
register char n;
REQUEST(xvGetPortAttributeReq);
+ REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swapl(&stuff->attribute, n);
@@ -1658,6 +1674,7 @@ SProcXvQueryBestSize(ClientPtr client)
{
register char n;
REQUEST(xvQueryBestSizeReq);
+ REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
swaps(&stuff->vid_w, n);
@@ -1672,6 +1689,7 @@ SProcXvQueryPortAttributes(ClientPtr client)
{
register char n;
REQUEST(xvQueryPortAttributesReq);
+ REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
return ProcXvQueryPortAttributes(client);
@@ -1682,6 +1700,7 @@ SProcXvQueryImageAttributes(ClientPtr client)
{
register char n;
REQUEST(xvQueryImageAttributesReq);
+ REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
swaps(&stuff->length, n);
swapl(&stuff->id, n);
swaps(&stuff->width, n);
@@ -1694,6 +1713,7 @@ SProcXvListImageFormats(ClientPtr client)
{
register char n;
REQUEST(xvListImageFormatsReq);
+ REQUEST_SIZE_MATCH(xvListImageFormatsReq);
swaps(&stuff->length, n);
swapl(&stuff->port, n);
return ProcXvListImageFormats(client);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index d0608a900..37296e80f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -77,7 +77,7 @@ is" without express or implied warranty.
#include "Shadow.h"
#include "Utils.h"
-#include "Xrandr.h"
+#include <X11/extensions/Xrandr.h>
#define GC XlibGC
#define Font XlibFont