aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xext/panoramiX.c2
-rw-r--r--xorg-server/Xext/shm.c10
-rw-r--r--xorg-server/Xext/xace.c12
-rw-r--r--xorg-server/Xext/xf86bigfont.c12
-rw-r--r--xorg-server/Xext/xres.c2
-rw-r--r--xorg-server/Xext/xtest.c2
-rw-r--r--xorg-server/Xi/chgdctl.c5
-rw-r--r--xorg-server/Xi/exevents.c14
-rw-r--r--xorg-server/configure.ac14
-rw-r--r--xorg-server/dix/devices.c8
-rw-r--r--xorg-server/dix/dixfonts.c9
-rw-r--r--xorg-server/dix/events.c24
-rw-r--r--xorg-server/fb/fbblt.c12
-rw-r--r--xorg-server/fb/fbbltone.c8
-rw-r--r--xorg-server/hw/xfree86/os-support/bus/nobus.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/agp_noop.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c4
-rw-r--r--xorg-server/hw/xfree86/os-support/stub/stub_init.c6
-rw-r--r--xorg-server/hw/xfree86/sdksyms.sh1
-rw-r--r--xorg-server/hw/xwin/Makefile.am2
-rw-r--r--xorg-server/hw/xwin/winms.h4
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c2
-rw-r--r--xorg-server/hw/xwin/winshaddd.c18
-rw-r--r--xorg-server/hw/xwin/winshadddnl.c64
-rw-r--r--xorg-server/hw/xwin/winwindow.h9
-rw-r--r--xorg-server/include/Makefile.am2
-rw-r--r--xorg-server/include/dix-config.h.in3
-rw-r--r--xorg-server/include/dix.h12
-rw-r--r--xorg-server/include/dixfont.h39
-rw-r--r--xorg-server/include/dixfontstubs.h45
-rw-r--r--xorg-server/mi/mibitblt.c6
-rw-r--r--xorg-server/mi/mispans.c4
-rw-r--r--xorg-server/os/xsha1.c30
-rw-r--r--xorg-server/randr/randrstr.h8
-rw-r--r--xorg-server/render/picturestr.h8
-rw-r--r--xorg-server/xfixes/cursor.c145
-rw-r--r--xorg-server/xkb/ddxList.c2
-rw-r--r--xorg-server/xkb/maprules.c1
-rw-r--r--xorg-server/xkb/xkb.c27
-rw-r--r--xorg-server/xkb/xkbPrKeyEv.c4
-rw-r--r--xorg-server/xkb/xkbtext.c1
-rw-r--r--xorg-server/xkb/xkmread.c2
-rw-r--r--xorg-server/xorg-server.m498
43 files changed, 365 insertions, 320 deletions
diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c
index 1c7197d5d..be475f7f4 100644
--- a/xorg-server/Xext/panoramiX.c
+++ b/xorg-server/Xext/panoramiX.c
@@ -592,8 +592,6 @@ PanoramiXExtensionInit(void)
}
-extern Bool CreateConnectionBlock(void);
-
Bool
PanoramiXCreateConnectionBlock(void)
{
diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c
index 3fa04b921..55960907b 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -135,11 +135,11 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
#define VERIFY_SHMSEG(shmseg,shmdesc,client) \
{ \
- int rc; \
- rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
- client, DixReadAccess); \
- if (rc != Success) \
- return rc; \
+ int tmprc; \
+ tmprc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
+ client, DixReadAccess); \
+ if (tmprc != Success) \
+ return tmprc; \
}
#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \
diff --git a/xorg-server/Xext/xace.c b/xorg-server/Xext/xace.c
index b2e7ddaf0..026d3c5cf 100644
--- a/xorg-server/Xext/xace.c
+++ b/xorg-server/Xext/xace.c
@@ -47,18 +47,18 @@ XaceHookDispatch(ClientPtr client, int major)
if (major < 128) {
/* Call the core dispatch hook */
- XaceCoreDispatchRec rec = { client, Success /* default allow */ };
- CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
- return rec.status;
+ XaceCoreDispatchRec drec = { client, Success /* default allow */ };
+ CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec);
+ return drec.status;
}
else {
/* Call the extension dispatch hook */
ExtensionEntry *ext = GetExtensionEntry(major);
- XaceExtAccessRec rec = { client, ext, DixUseAccess, Success };
+ XaceExtAccessRec erec = { client, ext, DixUseAccess, Success };
if (ext)
- CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec);
+ CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec);
/* On error, pretend extension doesn't exist */
- return (rec.status == Success) ? Success : BadRequest;
+ return (erec.status == Success) ? Success : BadRequest;
}
}
diff --git a/xorg-server/Xext/xf86bigfont.c b/xorg-server/Xext/xf86bigfont.c
index faf81f7dc..46b3242d1 100644
--- a/xorg-server/Xext/xf86bigfont.c
+++ b/xorg-server/Xext/xf86bigfont.c
@@ -296,8 +296,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
#endif
};
if (client->swapped) {
- char tmp;
-
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swaps(&reply.majorVersion);
@@ -313,8 +311,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
static void
swapCharInfo(xCharInfo * pCI)
{
- char tmp;
-
swaps(&pCI->leftSideBearing);
swaps(&pCI->rightSideBearing);
swaps(&pCI->characterWidth);
@@ -585,8 +581,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
reply->shmid = shmid;
reply->shmsegoffset = 0;
if (client->swapped) {
- char tmp;
-
swaps(&reply->sequenceNumber);
swapl(&reply->length);
swapCharInfo(&reply->minBounds);
@@ -613,8 +607,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
prFP->name = pFP->name;
prFP->value = pFP->value;
if (client->swapped) {
- char tmp;
-
swapl(&prFP->name);
swapl(&prFP->value);
}
@@ -636,8 +628,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
for (j = 0; j < nCharInfos; j++, ps++) {
*ps = pIndex2UniqIndex[j];
if (client->swapped) {
- char tmp;
-
swaps(ps);
}
}
@@ -673,7 +663,6 @@ static int
SProcXF86BigfontQueryVersion(ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
- char tmp;
swaps(&stuff->length);
return ProcXF86BigfontQueryVersion(client);
@@ -683,7 +672,6 @@ static int
SProcXF86BigfontQueryFont(ClientPtr client)
{
REQUEST(xXF86BigfontQueryFontReq);
- char tmp;
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
diff --git a/xorg-server/Xext/xres.c b/xorg-server/Xext/xres.c
index 7d21ad7e9..445abcab8 100644
--- a/xorg-server/Xext/xres.c
+++ b/xorg-server/Xext/xres.c
@@ -190,8 +190,6 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
ht_destroy(ctx->visitedResources);
}
-extern void ResExtensionInit(void);
-
static int
ProcXResQueryVersion(ClientPtr client)
{
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c
index c593372e7..2abdc7f58 100644
--- a/xorg-server/Xext/xtest.c
+++ b/xorg-server/Xext/xtest.c
@@ -57,8 +57,6 @@
#include "extinit.h"
-extern int DeviceValuator;
-
/* XTest events are sent during request processing and may be interruped by
* a SIGIO. We need a separate event list to avoid events overwriting each
* other's memory */
diff --git a/xorg-server/Xi/chgdctl.c b/xorg-server/Xi/chgdctl.c
index 7daf58461..31d3a57f3 100644
--- a/xorg-server/Xi/chgdctl.c
+++ b/xorg-server/Xi/chgdctl.c
@@ -187,7 +187,10 @@ ProcXChangeDeviceControl(ClientPtr client)
case DEVICE_ENABLE:
e = (xDeviceEnableCtl *) &stuff[1];
- status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e);
+ if (IsXTestDevice(dev, NULL))
+ status = !Success;
+ else
+ status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e);
if (status == Success) {
if (e->enable)
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 4cbeb3796..4248b9a86 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -1559,6 +1559,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
uint32_t touchid;
int type = ev->any.type;
int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED);
+ DeviceIntPtr kbd;
if (!t)
return;
@@ -1568,9 +1569,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
else
touchid = ev->device_event.touchid;
- if (emulate_pointer)
- UpdateDeviceState(dev, &ev->device_event);
-
if (type == ET_TouchBegin) {
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
emulate_pointer);
@@ -1598,7 +1596,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!ti) {
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
"grabbed touchpoint %d\n",
- dev->name, type, touchid);
+ dev->name, touchid);
return;
}
@@ -1617,9 +1615,14 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
* events which _only_ emulate motion just work normally */
if (emulate_pointer && ev->any.type != ET_TouchUpdate)
DeliverEmulatedMotionEvent(dev, ti, ev);
+
if (emulate_pointer && IsMaster(dev))
CheckMotion(&ev->device_event, dev);
+ kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
+ event_set_state(NULL, kbd, &ev->device_event);
+ ev->device_event.corestate = event_get_corestate(NULL, kbd);
+
/* Make sure we have a valid window trace for event delivery; must be
* called after event type mutation. Touch end events are always processed
* in order to end touch records. */
@@ -1641,6 +1644,9 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (ev->any.type == ET_TouchEnd)
TouchEndTouch(dev, ti);
}
+
+ if (emulate_pointer)
+ UpdateDeviceState(dev, &ev->device_event);
}
/**
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index 86153ec81..38ac240df 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -1360,7 +1360,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
# SHA1 hashing
AC_ARG_WITH([sha1],
- [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
+ [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
[choose SHA1 implementation])])
AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
@@ -1423,6 +1423,18 @@ if test "x$with_sha1" = xlibsha1; then
[Use libsha1 for SHA1])
SHA1_LIBS=-lsha1
fi
+AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
+if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
+ with_sha1=libnettle
+fi
+if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
+ AC_MSG_ERROR([libnettle requested but not found])
+fi
+if test "x$with_sha1" = xlibnettle; then
+ AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
+ [Use libnettle SHA1 functions])
+ SHA1_LIBS=-lnettle
+fi
AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
with_sha1=libgcrypt
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index fd4916a3a..613323fa2 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -145,9 +145,11 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1)
return BadValue;
- /* Don't allow disabling of VCP/VCK */
- if ((dev == inputInfo.pointer ||dev ==
- inputInfo.keyboard) &&!(*(CARD8 *) prop->data))
+ /* Don't allow disabling of VCP/VCK or XTest devices */
+ if ((dev == inputInfo.pointer ||
+ dev == inputInfo.keyboard ||
+ IsXTestDevice(dev, NULL))
+ &&!(*(CARD8 *) prop->data))
return BadAccess;
if (!checkonly) {
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index ad218604d..feb765d1c 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -1823,12 +1823,14 @@ InitFonts(void)
register_fpe_functions();
}
+_X_EXPORT
int
GetDefaultPointSize(void)
{
return 120;
}
+_X_EXPORT
FontResolutionPtr
GetClientResolutions(int *num)
{
@@ -1861,6 +1863,7 @@ GetClientResolutions(int *num)
* should be called (only once!) by each type of fpe when initialized
*/
+_X_EXPORT
int
RegisterFPEFunctions(NameCheckFunc name_func,
InitFpeFunc init_func,
@@ -1932,24 +1935,28 @@ find_old_font(XID id)
return (FontPtr) pFont;
}
+_X_EXPORT
Font
GetNewFontClientID(void)
{
return FakeClientID(0);
}
+_X_EXPORT
int
StoreFontClientFont(FontPtr pfont, Font id)
{
return AddResource(id, RT_NONE, (pointer) pfont);
}
+_X_EXPORT
void
DeleteFontClientID(Font id)
{
FreeResource(id, RT_NONE);
}
+_X_EXPORT
int
client_auth_generation(ClientPtr client)
{
@@ -1959,6 +1966,7 @@ client_auth_generation(ClientPtr client)
static int fs_handlers_installed = 0;
static unsigned int last_server_gen;
+_X_EXPORT
int
init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
{
@@ -1977,6 +1985,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
return Successful;
}
+_X_EXPORT
void
remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler,
Bool all)
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index ddb5b343d..e790bfc20 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -2027,19 +2027,19 @@ DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win,
*/
static Bool
GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
- xEvent *events, Mask filter, InputClients ** clients)
+ xEvent *events, Mask filter, InputClients ** iclients)
{
int rc = 0;
if (core_get_type(events) != 0)
- *clients = (InputClients *) wOtherClients(win);
+ *iclients = (InputClients *) wOtherClients(win);
else if (xi2_get_type(events) != 0) {
OtherInputMasks *inputMasks = wOtherInputMasks(win);
/* Has any client selected for the event? */
if (!WindowXI2MaskIsset(dev, win, events))
goto out;
- *clients = inputMasks->inputClients;
+ *iclients = inputMasks->inputClients;
}
else {
OtherInputMasks *inputMasks = wOtherInputMasks(win);
@@ -2048,7 +2048,7 @@ GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
if (!inputMasks || !(inputMasks->inputEvents[dev->id] & filter))
goto out;
- *clients = inputMasks->inputClients;
+ *iclients = inputMasks->inputClients;
}
rc = 1;
@@ -2110,12 +2110,12 @@ DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events,
int count, Mask filter, GrabPtr grab,
ClientPtr *client_return, Mask *mask_return)
{
- InputClients *clients;
+ InputClients *iclients;
- if (!GetClientsForDelivery(dev, win, events, filter, &clients))
+ if (!GetClientsForDelivery(dev, win, events, filter, &iclients))
return EVENT_SKIP;
- return DeliverEventToInputClients(dev, clients, win, events, count, filter,
+ return DeliverEventToInputClients(dev, iclients, win, events, count, filter,
grab, client_return, mask_return);
}
@@ -4417,7 +4417,7 @@ int
EventSuppressForWindow(WindowPtr pWin, ClientPtr client,
Mask mask, Bool *checkOptional)
{
- int i, free;
+ int i, freed;
if (mask & ~PropagateMask) {
client->errorValue = mask;
@@ -4428,14 +4428,14 @@ EventSuppressForWindow(WindowPtr pWin, ClientPtr client,
if (!mask)
i = 0;
else {
- for (i = DNPMCOUNT, free = 0; --i > 0;) {
+ for (i = DNPMCOUNT, freed = 0; --i > 0;) {
if (!DontPropagateRefCnts[i])
- free = i;
+ freed = i;
else if (mask == DontPropagateMasks[i])
break;
}
- if (!i && free) {
- i = free;
+ if (!i && freed) {
+ i = freed;
DontPropagateMasks[i] = mask;
}
}
diff --git a/xorg-server/fb/fbblt.c b/xorg-server/fb/fbblt.c
index 17bd6986b..72a05f61a 100644
--- a/xorg-server/fb/fbblt.c
+++ b/xorg-server/fb/fbblt.c
@@ -73,21 +73,21 @@ fbBlt(FbBits * srcLine,
if (alu == GXcopy && pm == FB_ALLONES && !careful &&
!(srcX & 7) && !(dstX & 7) && !(width & 7)) {
int i;
- CARD8 *src = (CARD8 *) srcLine;
- CARD8 *dst = (CARD8 *) dstLine;
+ CARD8 *tmpsrc = (CARD8 *) srcLine;
+ CARD8 *tmpdst = (CARD8 *) dstLine;
srcStride *= sizeof(FbBits);
dstStride *= sizeof(FbBits);
width >>= 3;
- src += (srcX >> 3);
- dst += (dstX >> 3);
+ tmpsrc += (srcX >> 3);
+ tmpdst += (dstX >> 3);
if (!upsidedown)
for (i = 0; i < height; i++)
- MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
else
for (i = height - 1; i >= 0; i--)
- MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
return;
}
diff --git a/xorg-server/fb/fbbltone.c b/xorg-server/fb/fbbltone.c
index eb7cf9483..bfcb5a263 100644
--- a/xorg-server/fb/fbbltone.c
+++ b/xorg-server/fb/fbbltone.c
@@ -739,12 +739,12 @@ fbBltPlane(FbBits * src,
pm = fbReplicatePixel(planeMask, srcBpp);
if (srcBpp == 24) {
- int w = 24;
+ int tmpw = 24;
rot0 = FbFirst24Rot(srcX);
- if (srcX + w > FB_UNIT)
- w = FB_UNIT - srcX;
- srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, w);
+ if (srcX + tmpw > FB_UNIT)
+ tmpw = FB_UNIT - srcX;
+ srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, tmpw);
}
else {
rot0 = 0;
diff --git a/xorg-server/hw/xfree86/os-support/bus/nobus.c b/xorg-server/hw/xfree86/os-support/bus/nobus.c
index dca58fee2..dc36ecd0a 100644
--- a/xorg-server/hw/xfree86/os-support/bus/nobus.c
+++ b/xorg-server/hw/xfree86/os-support/bus/nobus.c
@@ -1,5 +1,5 @@
static void
-__noop_to_appease_ar__()
+__noop_to_appease_ar__(void)
{
return;
}
diff --git a/xorg-server/hw/xfree86/os-support/shared/agp_noop.c b/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
index 9c6ed4b8d..da486c051 100644
--- a/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/agp_noop.c
@@ -47,7 +47,7 @@ xf86GARTCloseScreen(int screenNum)
}
Bool
-xf86AgpGARTSupported()
+xf86AgpGARTSupported(void)
{
return FALSE;
}
diff --git a/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c b/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
index 30688c0b5..eeacee9cc 100644
--- a/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
+++ b/xorg-server/hw/xfree86/os-support/shared/ioperm_noop.c
@@ -36,13 +36,13 @@
#include "xf86_OSlib.h"
Bool
-xf86EnableIO()
+xf86EnableIO(void)
{
return TRUE;
}
void
-xf86DisableIO()
+xf86DisableIO(void)
{
return;
}
diff --git a/xorg-server/hw/xfree86/os-support/stub/stub_init.c b/xorg-server/hw/xfree86/os-support/stub/stub_init.c
index 629675d68..d3e0c3f29 100644
--- a/xorg-server/hw/xfree86/os-support/stub/stub_init.c
+++ b/xorg-server/hw/xfree86/os-support/stub/stub_init.c
@@ -5,12 +5,12 @@
#include "xf86_OSlib.h"
void
-xf86OpenConsole()
+xf86OpenConsole(void)
{
}
void
-xf86CloseConsole()
+xf86CloseConsole(void)
{
}
@@ -21,6 +21,6 @@ xf86ProcessArgument(int argc, char *argv[], int i)
}
void
-xf86UseMsg()
+xf86UseMsg(void)
{
}
diff --git a/xorg-server/hw/xfree86/sdksyms.sh b/xorg-server/hw/xfree86/sdksyms.sh
index fa1989379..48b48b5db 100644
--- a/xorg-server/hw/xfree86/sdksyms.sh
+++ b/xorg-server/hw/xfree86/sdksyms.sh
@@ -259,6 +259,7 @@ cat > sdksyms.c << EOF
#include "dixevents.h"
#include "dixfont.h"
#include "dixfontstr.h"
+#include "dixfontstubs.h"
#include "dixgrabs.h"
#include "dixstruct.h"
#include "exevents.h"
diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am
index 99dc55631..3fcaf9d0b 100644
--- a/xorg-server/hw/xwin/Makefile.am
+++ b/xorg-server/hw/xwin/Makefile.am
@@ -147,6 +147,8 @@ XWin_SOURCES = $(SRCS)
INCLUDES = -I$(top_srcdir)/miext/rootless
+XWIN_SYS_LIBS += -ldxguid
+
XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
XWin_LDFLAGS = -mwindows -static
diff --git a/xorg-server/hw/xwin/winms.h b/xorg-server/hw/xwin/winms.h
index 4355baeb8..5282fc982 100644
--- a/xorg-server/hw/xwin/winms.h
+++ b/xorg-server/hw/xwin/winms.h
@@ -42,7 +42,11 @@
#include <X11/Xwindows.h>
#include <windowsx.h>
+#pragma push_macro("Status")
+#undef Status
+#define Status wStatus
#include "ddraw.h"
+#pragma pop_macro("Status")
#undef CreateWindow
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index ac9d57976..42925e36d 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -55,8 +55,6 @@
#include <X11/Xwindows.h>
/* Local headers */
-#include "objbase.h"
-#include "ddraw.h"
#include "winwindow.h"
#include "winprefs.h"
#include "window.h"
diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c
index 4c77cc05c..3afc57cd0 100644
--- a/xorg-server/hw/xwin/winshaddd.c
+++ b/xorg-server/hw/xwin/winshaddd.c
@@ -37,24 +37,6 @@
#include "win.h"
/*
- * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
- * so we have to redefine it here.
- */
-#ifdef DEFINE_GUID
-#undef DEFINE_GUID
-#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif /* DEFINE_GUID */
-
-/*
- * FIXME: Headers are broken, IID_IDirectDraw2 has to be defined
- * here manually. Should be handled by ddraw.h
- */
-#ifndef IID_IDirectDraw2
-DEFINE_GUID(IID_IDirectDraw2, 0xB3A6F3E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00,
- 0xAA, 0x00, 0xB9, 0x33, 0x56);
-#endif /* IID_IDirectDraw2 */
-
-/*
* Local prototypes
*/
diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c
index c0879752a..e7306151e 100644
--- a/xorg-server/hw/xwin/winshadddnl.c
+++ b/xorg-server/hw/xwin/winshadddnl.c
@@ -36,24 +36,6 @@
#endif
#include "win.h"
-/*
- * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
- * so we have to redefine it here.
- */
-#ifdef DEFINE_GUID
-#undef DEFINE_GUID
-#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-#endif /* DEFINE_GUID */
-
-/*
- * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
- * here manually. Should be handled by ddraw.h
- */
-#ifndef IID_IDirectDraw4
-DEFINE_GUID(IID_IDirectDraw4, 0x9c59509a, 0x39bd, 0x11d1, 0x8c, 0x4a, 0x00,
- 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
-#endif /* IID_IDirectDraw4 */
-
#define FAIL_MSG_MAX_BLT 10
/*
@@ -526,50 +508,6 @@ winFreeFBShadowDDNL(ScreenPtr pScreen)
pScreenInfo->pfb = NULL;
}
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
-/*
- * Create a DirectDraw surface for the new multi-window window
- */
-
-static
- Bool
-winFinishCreateWindowsWindowDDNL(WindowPtr pWin)
-{
- winWindowPriv(pWin);
- winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
- HRESULT ddrval = DD_OK;
- DDSURFACEDESC2 ddsd;
- int iWidth, iHeight;
- int iX, iY;
-
- winDebug("winFinishCreateWindowsWindowDDNL!\n\n");
-
- iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN);
- iY = pWin->drawable.y + GetSystemMetrics(SM_YVIRTUALSCREEN);
-
- iWidth = pWin->drawable.width;
- iHeight = pWin->drawable.height;
-
- /* Describe the primary surface */
- ZeroMemory(&ddsd, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
- ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- ddsd.dwHeight = iHeight;
- ddsd.dwWidth = iWidth;
-
- /* Create the primary surface */
- ddrval = IDirectDraw4_CreateSurface(pScreenPriv->pdd4,
- &ddsd, &pWinPriv->pddsPrimary4, NULL);
- if (FAILED(ddrval)) {
- ErrorF("winFinishCreateWindowsWindowDDNL - Could not create primary "
- "surface: %08x\n", (unsigned int) ddrval);
- return FALSE;
- }
- return TRUE;
-}
-#endif
-
/*
* Transfer the damaged regions of the shadow framebuffer to the display.
*/
@@ -1278,7 +1216,7 @@ winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen)
pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
#ifdef XWIN_MULTIWINDOW
pScreenPriv->pwinFinishCreateWindowsWindow
- = winFinishCreateWindowsWindowDDNL;
+ = (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA;
#endif
return TRUE;
diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h
index a5919ee4d..49a720a67 100644
--- a/xorg-server/hw/xwin/winwindow.h
+++ b/xorg-server/hw/xwin/winwindow.h
@@ -81,15 +81,6 @@ typedef struct {
#ifdef XWIN_GLX_WINDOWS
Bool fWglUsed;
#endif
-
- /* Privates used by primary fb DirectDraw server */
- LPDDSURFACEDESC pddsdPrimary;
-
- /* Privates used by shadow fb DirectDraw Nonlocking server */
- LPDIRECTDRAWSURFACE4 pddsPrimary4;
-
- /* Privates used by both shadow fb DirectDraw servers */
- LPDIRECTDRAWCLIPPER pddcPrimary;
} winPrivWinRec, *winPrivWinPtr;
#ifdef XWIN_MULTIWINDOW
diff --git a/xorg-server/include/Makefile.am b/xorg-server/include/Makefile.am
index 33116f284..5cdea1d15 100644
--- a/xorg-server/include/Makefile.am
+++ b/xorg-server/include/Makefile.am
@@ -69,6 +69,6 @@ AM_CFLAGS = $(DIX_CFLAGS)
EXTRA_DIST = \
dix-config-apple-verbatim.h \
- eventconvert.h eventstr.h inpututils.h \
+ dixfontstubs.h eventconvert.h eventstr.h inpututils.h \
protocol-versions.h \
xsha1.h
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index 578f249b3..b270a3238 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -157,6 +157,9 @@
/* Define to use libgcrypt SHA1 functions */
#undef HAVE_SHA1_IN_LIBGCRYPT
+/* Define to use libnettle SHA1 functions */
+#undef HAVE_SHA1_IN_LIBNETTLE
+
/* Define to use libsha1 for SHA1 */
#undef HAVE_SHA1_IN_LIBSHA1
diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h
index 74123b51b..171e56e11 100644
--- a/xorg-server/include/dix.h
+++ b/xorg-server/include/dix.h
@@ -88,12 +88,12 @@ SOFTWARE.
#define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\
{\
- int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
- if (rc != Success)\
- return rc;\
- rc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
- if (rc != Success)\
- return rc;\
+ int tmprc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
+ if (tmprc != Success)\
+ return tmprc;\
+ tmprc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
+ if (tmprc != Success)\
+ return tmprc;\
if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
return BadMatch;\
}\
diff --git a/xorg-server/include/dixfont.h b/xorg-server/include/dixfont.h
index 3d09eb5ae..0a5f105c0 100644
--- a/xorg-server/include/dixfont.h
+++ b/xorg-server/include/dixfont.h
@@ -28,6 +28,7 @@ SOFTWARE.
#include <X11/fonts/font.h>
#include "closure.h"
#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontproto.h>
#define NullDIXFontProp ((DIXFontPropPtr)0)
@@ -143,42 +144,4 @@ extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ );
extern _X_EXPORT void register_fpe_functions(void);
-/*
- * libXfont stubs.
- */
-extern _X_EXPORT int client_auth_generation(ClientPtr client);
-
-extern _X_EXPORT void DeleteFontClientID(Font id);
-
-extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num);
-
-extern _X_EXPORT int GetDefaultPointSize(void);
-
-extern _X_EXPORT Font GetNewFontClientID(void);
-
-extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
- BlockHandlerProcPtr block_handler);
-
-extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
- InitFpeFunc init_func,
- FreeFpeFunc free_func,
- ResetFpeFunc reset_func,
- OpenFontFunc open_func,
- CloseFontFunc close_func,
- ListFontsFunc list_func,
- StartLfwiFunc start_lfwi_func,
- NextLfwiFunc next_lfwi_func,
- WakeupFpeFunc wakeup_func,
- ClientDiedFunc client_died,
- LoadGlyphsFunc load_glyphs,
- StartLaFunc start_list_alias_func,
- NextLaFunc next_list_alias_func,
- SetPathFunc set_path_func);
-
-extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
- BlockHandlerProcPtr blockHandler,
- Bool all);
-
-extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
-
#endif /* DIXFONT_H */
diff --git a/xorg-server/include/dixfontstubs.h b/xorg-server/include/dixfontstubs.h
new file mode 100644
index 000000000..0454ffa6c
--- /dev/null
+++ b/xorg-server/include/dixfontstubs.h
@@ -0,0 +1,45 @@
+#ifndef DIXFONTSTUBS_H
+#define DIXFONTSTUBS_H 1
+
+/*
+ * libXfont stubs replacements
+ * This header exists solely for the purpose of sdksyms generation;
+ * source code should #include "dixfonts.h" instead, which pulls in these
+ * declarations from <X11/fonts/fontproto.h>
+ */
+extern _X_EXPORT int client_auth_generation(ClientPtr client);
+
+extern _X_EXPORT void DeleteFontClientID(Font id);
+
+extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num);
+
+extern _X_EXPORT int GetDefaultPointSize(void);
+
+extern _X_EXPORT Font GetNewFontClientID(void);
+
+extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
+ BlockHandlerProcPtr block_handler);
+
+extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
+ InitFpeFunc init_func,
+ FreeFpeFunc free_func,
+ ResetFpeFunc reset_func,
+ OpenFontFunc open_func,
+ CloseFontFunc close_func,
+ ListFontsFunc list_func,
+ StartLfwiFunc start_lfwi_func,
+ NextLfwiFunc next_lfwi_func,
+ WakeupFpeFunc wakeup_func,
+ ClientDiedFunc client_died,
+ LoadGlyphsFunc load_glyphs,
+ StartLaFunc start_list_alias_func,
+ NextLaFunc next_list_alias_func,
+ SetPathFunc set_path_func);
+
+extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
+ BlockHandlerProcPtr blockHandler,
+ Bool all);
+
+extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
+
+#endif
diff --git a/xorg-server/mi/mibitblt.c b/xorg-server/mi/mibitblt.c
index b9873c16d..b0d14ae55 100644
--- a/xorg-server/mi/mibitblt.c
+++ b/xorg-server/mi/mibitblt.c
@@ -614,7 +614,7 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
if (format == ZPixmap) {
if ((((1LL << depth) - 1) & planeMask) != (1LL << depth) - 1) {
ChangeGCVal gcv;
- xPoint pt;
+ xPoint xpt;
pGC = GetScratchGC(depth, pDraw->pScreen);
if (!pGC)
@@ -629,9 +629,9 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
* Clear the pixmap before doing anything else
*/
ValidateGC((DrawablePtr) pPixmap, pGC);
- pt.x = pt.y = 0;
+ xpt.x = xpt.y = 0;
width = w;
- (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &pt, &width,
+ (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &xpt, &width,
TRUE);
/* alu is already GXCopy */
diff --git a/xorg-server/mi/mispans.c b/xorg-server/mi/mispans.c
index 0f89880e2..11c8a43d0 100644
--- a/xorg-server/mi/mispans.c
+++ b/xorg-server/mi/mispans.c
@@ -453,8 +453,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
(int *) realloc(newspans->widths,
ysizes[index] * sizeof(int));
if (!newpoints || !newwidths) {
- int i;
-
for (i = 0; i < ylength; i++) {
free(yspans[i].points);
free(yspans[i].widths);
@@ -485,8 +483,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
points = malloc(count * sizeof(DDXPointRec));
widths = malloc(count * sizeof(int));
if (!points || !widths) {
- int i;
-
for (i = 0; i < ylength; i++) {
free(yspans[i].points);
free(yspans[i].widths);
diff --git a/xorg-server/os/xsha1.c b/xorg-server/os/xsha1.c
index fa66c7a06..24c0aa284 100644
--- a/xorg-server/os/xsha1.c
+++ b/xorg-server/os/xsha1.c
@@ -116,6 +116,36 @@ x_sha1_final(void *ctx, unsigned char result[20])
return 1;
}
+#elif defined(HAVE_SHA1_IN_LIBNETTLE) /* Use libnettle for SHA1 */
+
+#include <nettle/sha.h>
+
+void *
+x_sha1_init(void)
+{
+ struct sha1_ctx *ctx = malloc(sizeof(*ctx));
+
+ if (!ctx)
+ return NULL;
+ sha1_init(ctx);
+ return ctx;
+}
+
+int
+x_sha1_update(void *ctx, void *data, int size)
+{
+ sha1_update(ctx, size, data);
+ return 1;
+}
+
+int
+x_sha1_final(void *ctx, unsigned char result[20])
+{
+ sha1_digest(ctx, 20, result);
+ free(ctx);
+ return 1;
+}
+
#elif defined(HAVE_SHA1_IN_LIBGCRYPT) /* Use libgcrypt for SHA1 */
#include <gcrypt.h>
diff --git a/xorg-server/randr/randrstr.h b/xorg-server/randr/randrstr.h
index 212b0a9be..a16302f4d 100644
--- a/xorg-server/randr/randrstr.h
+++ b/xorg-server/randr/randrstr.h
@@ -933,6 +933,14 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
pointer value, Bool sendevent, Bool pending);
extern _X_EXPORT int
+ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
+ Bool pending, Bool range, Bool immutable,
+ int num_values, INT32 *values);
+
+extern _X_EXPORT Bool
+ RRPostProviderPendingProperties(RRProviderPtr provider);
+
+extern _X_EXPORT int
ProcRRGetProviderProperty(ClientPtr client);
extern _X_EXPORT int
diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h
index dc00f41ff..5644f28cf 100644
--- a/xorg-server/render/picturestr.h
+++ b/xorg-server/render/picturestr.h
@@ -363,10 +363,10 @@ extern _X_EXPORT RESTYPE GlyphSetType;
#define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)
#define VERIFY_PICTURE(pPicture, pid, client, mode) {\
- int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\
- PictureType, client, mode);\
- if (rc != Success)\
- return rc;\
+ int tmprc = dixLookupResourceByType((pointer)&(pPicture), pid,\
+ PictureType, client, mode);\
+ if (tmprc != Success)\
+ return tmprc;\
}
#define VERIFY_ALPHA(pPicture, pid, client, mode) {\
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 4eee59246..7c223ddc5 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -56,6 +56,7 @@
#include "windowstr.h"
#include "xace.h"
#include "list.h"
+#include "exglobals.h"
static RESTYPE CursorClientType;
static RESTYPE CursorHideCountType;
@@ -118,6 +119,8 @@ struct PointerBarrierClient {
ScreenPtr screen;
struct PointerBarrier barrier;
struct xorg_list entry;
+ int num_devices;
+ int *device_ids; /* num_devices */
};
/*
@@ -196,7 +199,7 @@ CursorCloseScreen(ScreenPtr pScreen)
Bool ret;
_X_UNUSED CloseScreenProcPtr close_proc;
_X_UNUSED DisplayCursorProcPtr display_proc;
- ConstrainCursorHarderProcPtr constrain_proc;
+ _X_UNUSED ConstrainCursorHarderProcPtr constrain_proc;
Unwrap(cs, pScreen, CloseScreen, close_proc);
Unwrap(cs, pScreen, DisplayCursor, display_proc);
@@ -1132,6 +1135,31 @@ barrier_is_blocking(const struct PointerBarrier * barrier,
return rc;
}
+static BOOL
+barrier_blocks_device(struct PointerBarrierClient *client,
+ DeviceIntPtr dev)
+{
+ int i;
+ int master_id;
+
+ /* Clients with no devices are treated as
+ * if they specified XIAllDevices. */
+ if (client->num_devices == 0)
+ return TRUE;
+
+ master_id = GetMaster(dev, POINTER_OR_FLOAT)->id;
+
+ for (i = 0; i < client->num_devices; i++) {
+ int device_id = client->device_ids[i];
+ if (device_id == XIAllDevices ||
+ device_id == XIAllMasterDevices ||
+ device_id == master_id)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/**
* Find the nearest barrier that is blocking movement from x1/y1 to x2/y2.
*
@@ -1143,7 +1171,8 @@ barrier_is_blocking(const struct PointerBarrier * barrier,
* @return The barrier nearest to the movement origin that blocks this movement.
*/
static struct PointerBarrier *
-barrier_find_nearest(CursorScreenPtr cs, int dir,
+barrier_find_nearest(CursorScreenPtr cs, DeviceIntPtr dev,
+ int dir,
int x1, int y1, int x2, int y2)
{
struct PointerBarrierClient *c;
@@ -1157,6 +1186,9 @@ barrier_find_nearest(CursorScreenPtr cs, int dir,
if (!barrier_is_blocking_direction(b, dir))
continue;
+ if (!barrier_blocks_device(c, dev))
+ continue;
+
if (barrier_is_blocking(b, x1, y1, x2, y2, &distance)) {
if (min_distance > distance) {
min_distance = distance;
@@ -1204,6 +1236,7 @@ CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
mode == Relative) {
int ox, oy;
int dir;
+ int i;
struct PointerBarrier *nearest = NULL;
/* where are we coming from */
@@ -1218,8 +1251,12 @@ CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
*/
dir = barrier_get_direction(ox, oy, *x, *y);
- nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y);
- if (nearest) {
+#define MAX_BARRIERS 2
+ for (i = 0; i < MAX_BARRIERS; i++) {
+ nearest = barrier_find_nearest(cs, dev, dir, ox, oy, *x, *y);
+ if (!nearest)
+ break;
+
barrier_clamp_to_barrier(nearest, dir, x, y);
if (barrier_is_vertical(nearest)) {
@@ -1230,11 +1267,6 @@ CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
dir &= ~(BarrierNegativeY | BarrierPositiveY);
oy = *y;
}
-
- nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y);
- if (nearest) {
- barrier_clamp_to_barrier(nearest, dir, x, y);
- }
}
}
@@ -1245,28 +1277,67 @@ CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,
}
}
-static struct PointerBarrierClient *
+static int
CreatePointerBarrierClient(ScreenPtr screen, ClientPtr client,
- xXFixesCreatePointerBarrierReq * stuff)
+ xXFixesCreatePointerBarrierReq * stuff,
+ PointerBarrierClientPtr *client_out)
{
CursorScreenPtr cs = GetCursorScreen(screen);
- struct PointerBarrierClient *ret = malloc(sizeof(*ret));
-
- if (ret) {
- ret->screen = screen;
- ret->barrier.x1 = min(stuff->x1, stuff->x2);
- ret->barrier.x2 = max(stuff->x1, stuff->x2);
- ret->barrier.y1 = min(stuff->y1, stuff->y2);
- ret->barrier.y2 = max(stuff->y1, stuff->y2);
- ret->barrier.directions = stuff->directions & 0x0f;
- if (barrier_is_horizontal(&ret->barrier))
- ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX);
- if (barrier_is_vertical(&ret->barrier))
- ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY);
- xorg_list_add(&ret->entry, &cs->barriers);
+ int err;
+ int size;
+ int i;
+ CARD16 *in_devices;
+ struct PointerBarrierClient *ret;
+
+ size = sizeof(*ret) + sizeof(int) * stuff->num_devices;
+ ret = malloc(size);
+
+ *client_out = NULL;
+
+ if (!ret) {
+ return BadAlloc;
}
- return ret;
+ ret->screen = screen;
+ ret->num_devices = stuff->num_devices;
+
+ in_devices = (CARD16 *) &stuff[1];
+ for (i = 0; i < stuff->num_devices; i++) {
+ int device_id = in_devices[i];
+ DeviceIntPtr device;
+
+ if ((err = dixLookupDevice (&device, device_id,
+ client, DixReadAccess))) {
+ client->errorValue = device_id;
+ goto error;
+ }
+
+ if (!IsMaster (device)) {
+ client->errorValue = device_id;
+ err = BadDevice;
+ goto error;
+ }
+
+ ret->device_ids[i] = device_id;
+ }
+
+ ret->barrier.x1 = min(stuff->x1, stuff->x2);
+ ret->barrier.x2 = max(stuff->x1, stuff->x2);
+ ret->barrier.y1 = min(stuff->y1, stuff->y2);
+ ret->barrier.y2 = max(stuff->y1, stuff->y2);
+ ret->barrier.directions = stuff->directions & 0x0f;
+ if (barrier_is_horizontal(&ret->barrier))
+ ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX);
+ if (barrier_is_vertical(&ret->barrier))
+ ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY);
+ xorg_list_add(&ret->entry, &cs->barriers);
+
+ *client_out = ret;
+ return Success;
+
+ error:
+ free(ret);
+ return err;
}
int
@@ -1279,7 +1350,7 @@ ProcXFixesCreatePointerBarrier(ClientPtr client)
REQUEST(xXFixesCreatePointerBarrierReq);
- REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
LEGAL_NEW_RESOURCE(stuff->barrier, client);
err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
@@ -1288,10 +1359,6 @@ ProcXFixesCreatePointerBarrier(ClientPtr client)
return err;
}
- /* This sure does need fixing. */
- if (stuff->num_devices)
- return BadImplementation;
-
b.x1 = stuff->x1;
b.x2 = stuff->x2;
b.y1 = stuff->y1;
@@ -1304,9 +1371,9 @@ ProcXFixesCreatePointerBarrier(ClientPtr client)
if (barrier_is_horizontal(&b) && barrier_is_vertical(&b))
return BadValue;
- if (!(barrier = CreatePointerBarrierClient(pWin->drawable.pScreen,
- client, stuff)))
- return BadAlloc;
+ if ((err = CreatePointerBarrierClient(pWin->drawable.pScreen,
+ client, stuff, &barrier)))
+ return err;
if (!AddResource(stuff->barrier, PointerBarrierType, &barrier->barrier))
return BadAlloc;
@@ -1318,9 +1385,13 @@ int
SProcXFixesCreatePointerBarrier(ClientPtr client)
{
REQUEST(xXFixesCreatePointerBarrierReq);
+ int i;
+ CARD16 *in_devices = (CARD16 *) &stuff[1];
swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
+ swaps(&stuff->num_devices);
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
+
swapl(&stuff->barrier);
swapl(&stuff->window);
swaps(&stuff->x1);
@@ -1328,6 +1399,10 @@ SProcXFixesCreatePointerBarrier(ClientPtr client)
swaps(&stuff->x2);
swaps(&stuff->y2);
swapl(&stuff->directions);
+ for (i = 0; i < stuff->num_devices; i++) {
+ swaps(in_devices + i);
+ }
+
return ProcXFixesVector[stuff->xfixesReqType] (client);
}
diff --git a/xorg-server/xkb/ddxList.c b/xorg-server/xkb/ddxList.c
index 79f46379c..729c5aecf 100644
--- a/xorg-server/xkb/ddxList.c
+++ b/xorg-server/xkb/ddxList.c
@@ -131,8 +131,6 @@ XkbDDXListComponent(DeviceIntPtr dev,
file = list->pattern[what];
map = strrchr(file, '(');
if (map != NULL) {
- char *tmp;
-
map++;
tmp = strrchr(map, ')');
if ((tmp == NULL) || (tmp[1] != '\0')) {
diff --git a/xorg-server/xkb/maprules.c b/xorg-server/xkb/maprules.c
index c6900eccb..5462763d1 100644
--- a/xorg-server/xkb/maprules.c
+++ b/xorg-server/xkb/maprules.c
@@ -864,6 +864,7 @@ XkbRF_GetComponents(XkbRF_RulesPtr rules,
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Append);
XkbRF_ApplyPartialMatches(rules, names);
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option);
+ XkbRF_ApplyPartialMatches(rules, names);
if (names->keycodes)
names->keycodes = XkbRF_SubstituteVars(names->keycodes, &mdefs);
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 4440a98c1..efb178c7c 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -57,10 +57,10 @@ static RESTYPE RT_XKBCLIENT;
#define CHK_DEVICE(dev, id, client, access_mode, lf) {\
int why;\
- int rc = lf(&(dev), id, client, access_mode, &why);\
- if (rc != Success) {\
+ int tmprc = lf(&(dev), id, client, access_mode, &why);\
+ if (tmprc != Success) {\
client->errorValue = _XkbErrCode2(why, id);\
- return rc;\
+ return tmprc;\
}\
}
@@ -1026,22 +1026,22 @@ XkbWriteKeyTypes(XkbDescPtr xkb,
buf = (char *) &wire[1];
if (wire->nMapEntries > 0) {
- xkbKTMapEntryWireDesc *wire;
+ xkbKTMapEntryWireDesc *ewire;
XkbKTMapEntryPtr entry;
- wire = (xkbKTMapEntryWireDesc *) buf;
+ ewire = (xkbKTMapEntryWireDesc *) buf;
entry = type->map;
- for (n = 0; n < type->map_count; n++, wire++, entry++) {
- wire->active = entry->active;
- wire->mask = entry->mods.mask;
- wire->level = entry->level;
- wire->realMods = entry->mods.real_mods;
- wire->virtualMods = entry->mods.vmods;
+ for (n = 0; n < type->map_count; n++, ewire++, entry++) {
+ ewire->active = entry->active;
+ ewire->mask = entry->mods.mask;
+ ewire->level = entry->level;
+ ewire->realMods = entry->mods.real_mods;
+ ewire->virtualMods = entry->mods.vmods;
if (client->swapped) {
- swaps(&wire->virtualMods);
+ swaps(&ewire->virtualMods);
}
}
- buf = (char *) wire;
+ buf = (char *) ewire;
if (type->preserve != NULL) {
xkbModsWireDesc *pwire;
XkbModsPtr preserve;
@@ -2903,7 +2903,6 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
}
if (req->groups != 0) {
- unsigned i, bit;
xkbModsWireDesc *wire = (xkbModsWireDesc *) data;
for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) {
diff --git a/xorg-server/xkb/xkbPrKeyEv.c b/xorg-server/xkb/xkbPrKeyEv.c
index 32411838d..b24fd6cb7 100644
--- a/xorg-server/xkb/xkbPrKeyEv.c
+++ b/xorg-server/xkb/xkbPrKeyEv.c
@@ -104,13 +104,13 @@ XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd)
return;
}
if (rg->currentDown != 0) {
- int key = event->detail.key;
+ int tmpkey = event->detail.key;
event->type = ET_KeyRelease;
event->detail.key = rg->currentDown;
XkbHandleActions(keybd, keybd, event);
event->type = ET_KeyPress;
- event->detail.key = key;
+ event->detail.key = tmpkey;
}
rg->currentDown = key;
}
diff --git a/xorg-server/xkb/xkbtext.c b/xorg-server/xkb/xkbtext.c
index f66a08f75..fdf1d1790 100644
--- a/xorg-server/xkb/xkbtext.c
+++ b/xorg-server/xkb/xkbtext.c
@@ -1266,7 +1266,6 @@ XkbBehaviorText(XkbDescPtr xkb, XkbBehavior * behavior, unsigned format)
}
else if (type == XkbKB_RadioGroup) {
int g;
- char *tmp;
g = ((behavior->data) & (~XkbKB_RGAllowNone)) + 1;
if (XkbKB_RGAllowNone & behavior->data) {
diff --git a/xorg-server/xkb/xkmread.c b/xorg-server/xkb/xkmread.c
index 45da965dc..258bb91b5 100644
--- a/xorg-server/xkb/xkmread.c
+++ b/xorg-server/xkb/xkmread.c
@@ -772,8 +772,6 @@ ReadXkmSymbols(FILE * file, XkbDescPtr xkb)
memset((char *) typeName, 0, XkbNumKbdGroups * sizeof(Atom));
memset((char *) type, 0, XkbNumKbdGroups * sizeof(XkbKeyTypePtr));
if (wireMap.flags & XkmKeyHasTypes) {
- register int g;
-
for (g = 0; g < XkbNumKbdGroups; g++) {
if ((wireMap.flags & (1 << g)) &&
((tmp = XkmGetCountedString(file, buf, 100)) > 0)) {
diff --git a/xorg-server/xorg-server.m4 b/xorg-server/xorg-server.m4
index 80d6da01e..18255b91a 100644
--- a/xorg-server/xorg-server.m4
+++ b/xorg-server/xorg-server.m4
@@ -1,49 +1,49 @@
-dnl Copyright 2005 Red Hat, Inc
-dnl
-dnl Permission to use, copy, modify, distribute, and sell this software and its
-dnl documentation for any purpose is hereby granted without fee, provided that
-dnl the above copyright notice appear in all copies and that both that
-dnl copyright notice and this permission notice appear in supporting
-dnl documentation.
-dnl
-dnl The above copyright notice and this permission notice shall be included
-dnl in all copies or substantial portions of the Software.
-dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-dnl OTHER DEALINGS IN THE SOFTWARE.
-dnl
-dnl Except as contained in this notice, the name of the copyright holders shall
-dnl not be used in advertising or otherwise to promote the sale, use or
-dnl other dealings in this Software without prior written authorization
-dnl from the copyright holders.
-dnl
-
-# XORG_DRIVER_CHECK_EXT()
-# --------------------------
-# Checks for the $1 define in xorg-server.h (from the sdk). If it
-# is defined, then add $1 to $REQUIRED_MODULES.
-
-AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include "xorg-server.h"
-#if !defined $1
-#error $1 not defined
-#endif
- ]])],
- [_EXT_CHECK=yes],
- [_EXT_CHECK=no])
- CFLAGS="$SAVE_CFLAGS"
- AC_MSG_CHECKING([if $1 is defined])
- AC_MSG_RESULT([$_EXT_CHECK])
- if test "$_EXT_CHECK" != no; then
- REQUIRED_MODULES="$REQUIRED_MODULES $2"
- fi
-])
+dnl Copyright 2005 Red Hat, Inc
+dnl
+dnl Permission to use, copy, modify, distribute, and sell this software and its
+dnl documentation for any purpose is hereby granted without fee, provided that
+dnl the above copyright notice appear in all copies and that both that
+dnl copyright notice and this permission notice appear in supporting
+dnl documentation.
+dnl
+dnl The above copyright notice and this permission notice shall be included
+dnl in all copies or substantial portions of the Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+dnl OTHER DEALINGS IN THE SOFTWARE.
+dnl
+dnl Except as contained in this notice, the name of the copyright holders shall
+dnl not be used in advertising or otherwise to promote the sale, use or
+dnl other dealings in this Software without prior written authorization
+dnl from the copyright holders.
+dnl
+
+# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
+# --------------------------
+# Checks for the MACRO define in xorg-server.h (from the sdk). If it
+# is defined, then add the given PROTO to $REQUIRED_MODULES.
+
+AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include "xorg-server.h"
+#if !defined $1
+#error $1 not defined
+#endif
+ ]])],
+ [_EXT_CHECK=yes],
+ [_EXT_CHECK=no])
+ CFLAGS="$SAVE_CFLAGS"
+ AC_MSG_CHECKING([if $1 is defined])
+ AC_MSG_RESULT([$_EXT_CHECK])
+ if test "$_EXT_CHECK" != no; then
+ REQUIRED_MODULES="$REQUIRED_MODULES $2"
+ fi
+])