summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xext/security.c4
-rw-r--r--Xext/shm.c2
-rw-r--r--Xext/xace.c4
-rw-r--r--Xext/xselinux_ext.c6
-rw-r--r--Xext/xselinux_hooks.c4
-rw-r--r--Xi/exevents.c2
-rw-r--r--Xi/xichangehierarchy.c15
-rw-r--r--Xi/xipassivegrab.c10
-rw-r--r--configure.ac19
-rw-r--r--dix/dispatch.c33
-rw-r--r--dix/dixutils.c7
-rw-r--r--dix/events.c2
-rw-r--r--dix/extension.c14
-rw-r--r--hw/dmx/examples/Makefile.am56
-rw-r--r--hw/kdrive/linux/keyboard.c6
-rw-r--r--hw/kdrive/linux/ms.c4
-rw-r--r--hw/kdrive/linux/ps2.c4
-rw-r--r--hw/xfree86/common/xf86Xinput.c11
-rw-r--r--hw/xquartz/bundle/Info.plist.cpp8
-rw-r--r--include/dixstruct.h1
-rw-r--r--include/extension.h2
-rw-r--r--mi/mibitblt.c2
-rw-r--r--os/backtrace.c6
-rw-r--r--os/client.c118
-rw-r--r--record/record.c8
-rw-r--r--render/animcur.c3
-rw-r--r--xfixes/cursor.c4
27 files changed, 229 insertions, 126 deletions
diff --git a/Xext/security.c b/Xext/security.c
index 8673880d1..aa78e540d 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -148,9 +148,7 @@ SecurityLabelInitial(void)
static _X_INLINE const char *
SecurityLookupRequestName(ClientPtr client)
{
- int major = ((xReq *)client->requestBuffer)->reqType;
- int minor = MinorOpcodeOfRequest(client);
- return LookupRequestName(major, minor);
+ return LookupRequestName(client->majorOp, client->minorOp);
}
diff --git a/Xext/shm.c b/Xext/shm.c
index 4141a8fe6..d2ae08772 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -482,7 +482,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
{
PixmapPtr pPixmap;
- if (format == ZPixmap || depth == 1) {
+ if (format == ZPixmap || (format == XYPixmap && depth == 1)) {
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
diff --git a/Xext/xace.c b/Xext/xace.c
index c757cad05..ef69fe363 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -101,6 +101,10 @@ int XaceHook(int hook, ...)
} u;
int *prv = NULL; /* points to return value from callback */
va_list ap; /* argument list */
+
+ if (!XaceHooks[hook])
+ return Success;
+
va_start(ap, hook);
/* Marshal arguments for passing to callback.
diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index 374571c4b..85ca2dc8e 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -528,12 +528,6 @@ ProcSELinuxDispatch(ClientPtr client)
static int
SProcSELinuxQueryVersion(ClientPtr client)
{
- REQUEST(SELinuxQueryVersionReq);
- int n;
-
- REQUEST_SIZE_MATCH(SELinuxQueryVersionReq);
- swaps(&stuff->client_major, n);
- swaps(&stuff->client_minor, n);
return ProcSELinuxQueryVersion(client);
}
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index f1d8e5d2f..0d4c9ab11 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -263,8 +263,8 @@ SELinuxAudit(void *auditdata,
if (client) {
REQUEST(xReq);
if (stuff) {
- major = stuff->reqType;
- minor = MinorOpcodeOfRequest(client);
+ major = client->majorOp;
+ minor = client->minorOp;
}
}
if (audit->id)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index dcb496fd4..9d43564f8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -927,7 +927,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++)
if (BitIsOn(mouse->button->down, i))
- SetBit(event->buttons, i);
+ SetBit(event->buttons, mouse->button->map[i]);
if (kbd && kbd->key)
{
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 96ead6fcd..3facadd92 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -202,6 +202,19 @@ unwind:
return rc;
}
+static void
+disable_clientpointer(DeviceIntPtr dev)
+{
+ int i;
+
+ for (i = 0; i < currentMaxClients; i++)
+ {
+ ClientPtr client = clients[i];
+ if (client && client->clientPtr == dev)
+ client->clientPtr = NULL;
+ }
+}
+
static int
remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
int flags[MAXDEVICES])
@@ -252,6 +265,8 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
if (rc != Success)
goto unwind;
+ disable_clientpointer(ptr);
+
/* Disabling sends the devices floating, reattach them if
* desired. */
if (r->return_mode == XIAttachToMaster)
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 5cdd8aca6..af46282c8 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -140,11 +140,17 @@ ProcXIPassiveGrabDevice(ClientPtr client)
memset(&param, 0, sizeof(param));
param.grabtype = GRABTYPE_XI2;
param.ownerEvents = stuff->owner_events;
- param.this_device_mode = stuff->grab_mode;
- param.other_devices_mode = stuff->paired_device_mode;
param.grabWindow = stuff->grab_window;
param.cursor = stuff->cursor;
+ if (IsKeyboardDevice(dev)) {
+ param.this_device_mode = stuff->grab_mode;
+ param.other_devices_mode = stuff->paired_device_mode;
+ } else {
+ param.this_device_mode = stuff->paired_device_mode;
+ param.other_devices_mode = stuff->grab_mode;
+ }
+
if (stuff->cursor != None)
{
status = dixLookupResourceByType(&tmp, stuff->cursor,
diff --git a/configure.ac b/configure.ac
index 09662089e..9738f8f8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-12-16"
+AC_INIT([xorg-server], 1.11.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-01-27"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
@@ -999,6 +999,13 @@ if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
else
CLIENTIDS=no
fi
+if test "x$CLIENTIDS" = xyes; then
+ case $host_os in
+ openbsd*)
+ SYS_LIBS="$SYS_LIBS -lkvm"
+ ;;
+ esac
+fi
AC_MSG_RESULT([$CLIENTIDS])
AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
@@ -2030,12 +2037,10 @@ if test "$KDRIVE" = yes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
fi
- PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
if test "x$XEPHYR" = xauto; then
- XEPHYR=$xephyr
- fi
- if test "x$XEPHYR" = xyes && test "x$xephyr" = xno; then
- AC_MSG_ERROR([Xephyr dependencies missing])
+ PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"])
+ elif test "x$XEPHYR" = xyes ; then
+ PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS)
fi
# Xephyr needs nanosleep() which is in librt on Solaris
diff --git a/dix/dispatch.c b/dix/dispatch.c
index c17f42563..d822bb7fa 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -342,8 +342,6 @@ DisableLimitedSchedulingLatency(void)
SmartScheduleLatencyLimited = 0;
}
-#define MAJOROP ((xReq *)client->requestBuffer)->reqType
-
void
Dispatch(void)
{
@@ -424,22 +422,33 @@ Dispatch(void)
}
client->sequence++;
+ client->majorOp = ((xReq *)client->requestBuffer)->reqType;
+ client->minorOp = 0;
+ if (client->majorOp >= EXTENSION_BASE) {
+ ExtensionEntry *ext = GetExtensionEntry(client->majorOp);
+ if (ext)
+ client->minorOp = ext->MinorOpcode(client);
+ }
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
- ((xReq *)client->requestBuffer)->length,
- client->index, client->requestBuffer);
+ if (XSERVER_REQUEST_START_ENABLED())
+ XSERVER_REQUEST_START(LookupMajorName(client->majorOp),
+ client->majorOp,
+ ((xReq *)client->requestBuffer)->length,
+ client->index, client->requestBuffer);
#endif
if (result > (maxBigRequestSize << 2))
result = BadLength;
else {
- result = XaceHookDispatch(client, MAJOROP);
+ result = XaceHookDispatch(client, client->majorOp);
if (result == Success)
- result = (* client->requestVector[MAJOROP])(client);
+ result = (* client->requestVector[client->majorOp])(client);
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
- client->sequence, client->index, result);
+ if (XSERVER_REQUEST_DONE_ENABLED())
+ XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp),
+ client->majorOp, client->sequence,
+ client->index, result);
#endif
if (client->noClientException != Success)
@@ -449,8 +458,8 @@ Dispatch(void)
}
else if (result != Success)
{
- SendErrorToClient(client, MAJOROP,
- MinorOpcodeOfRequest(client),
+ SendErrorToClient(client, client->majorOp,
+ client->minorOp,
client->errorValue, result);
break;
}
@@ -472,8 +481,6 @@ Dispatch(void)
SmartScheduleLatencyLimited = 0;
}
-#undef MAJOROP
-
static int VendorRelease = VENDOR_RELEASE;
static char *VendorString = VENDOR_NAME;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 1e3134663..cfb03974d 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
int rc;
*pDraw = NULL;
- client->errorValue = id;
-
- if (id == INVALID)
- return BadDrawable;
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
+ if (rc != Success)
+ client->errorValue = id;
+
if (rc == BadValue)
return BadDrawable;
if (rc != Success)
diff --git a/dix/events.c b/dix/events.c
index 8e7f9c324..7d2d0e3ee 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1356,7 +1356,7 @@ ScreenRestructured (ScreenPtr pScreen)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
- if (!DevHasCursor(pDev))
+ if (!IsFloating(pDev) && !DevHasCursor(pDev))
continue;
/* GrabDevice doesn't have a confineTo field, so we don't need to
diff --git a/dix/extension.c b/dix/extension.c
index c7bbac5ff..b677cdb86 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -228,20 +228,6 @@ StandardMinorOpcode(ClientPtr client)
return ((xReq *)client->requestBuffer)->data;
}
-unsigned short
-MinorOpcodeOfRequest(ClientPtr client)
-{
- unsigned char major;
-
- major = ((xReq *)client->requestBuffer)->reqType;
- if (major < EXTENSION_BASE)
- return 0;
- major -= EXTENSION_BASE;
- if (major >= NumExtensions)
- return 0;
- return (*extensions[major]->MinorOpcode)(client);
-}
-
void
CloseDownExtensions(void)
{
diff --git a/hw/dmx/examples/Makefile.am b/hw/dmx/examples/Makefile.am
index 229bb57fc..d055ddc71 100644
--- a/hw/dmx/examples/Makefile.am
+++ b/hw/dmx/examples/Makefile.am
@@ -10,60 +10,60 @@ bin_PROGRAMS = \
noinst_PROGRAMS = xinput xtest evi res xled xbell $(EV_PROG)
dmxinfo_SOURCES = dmxinfo.c
-dmxinfo_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxinfo_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxinfo_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxinfo_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxwininfo_SOURCES = dmxwininfo.c
-dmxwininfo_LDADD = @DMXXMUEXAMPLES_DEP_LIBS@
-dmxwininfo_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+dmxwininfo_LDADD = $(DMXXMUEXAMPLES_DEP_LIBS)
+dmxwininfo_CFLAGS = $(DMXXMUEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxreconfig_SOURCES = dmxreconfig.c
-dmxreconfig_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxreconfig_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxreconfig_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxreconfig_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxresize_SOURCES = dmxresize.c
-dmxresize_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxresize_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxresize_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxresize_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxaddscreen_SOURCES = dmxaddscreen.c
-dmxaddscreen_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxaddscreen_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxaddscreen_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxaddscreen_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxrmscreen_SOURCES = dmxrmscreen.c
-dmxrmscreen_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxrmscreen_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxrmscreen_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxrmscreen_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxaddinput_SOURCES = dmxaddinput.c
-dmxaddinput_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxaddinput_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxaddinput_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxaddinput_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
dmxrminput_SOURCES = dmxrminput.c
-dmxrminput_LDADD = @DMXEXAMPLES_DEP_LIBS@
-dmxrminput_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+dmxrminput_LDADD = $(DMXEXAMPLES_DEP_LIBS)
+dmxrminput_CFLAGS = $(DMXEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xinput_SOURCES = xinput.c
-xinput_LDADD = @DMXXIEXAMPLES_DEP_LIBS@
-xinput_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+xinput_LDADD = $(DMXXIEXAMPLES_DEP_LIBS)
+xinput_CFLAGS = $(DMXXIEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xtest_SOURCES = xtest.c
-xtest_LDADD = @XTSTEXAMPLES_DEP_LIBS@
-xtest_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+xtest_LDADD = $(XTSTEXAMPLES_DEP_LIBS)
+xtest_CFLAGS = $(XTSTEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
evi_SOURCES = evi.c
-evi_LDADD = @X11EXAMPLES_DEP_LIBS@
-evi_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+evi_LDADD = $(X11EXAMPLES_DEP_LIBS)
+evi_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
res_SOURCES = res.c
-res_LDADD = @XRESEXAMPLES_DEP_LIBS@
-res_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+res_LDADD = $(XRESEXAMPLES_DEP_LIBS)
+res_CFLAGS = $(XRESEXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xled_SOURCES = xled.c
-xled_LDADD = @X11EXAMPLES_DEP_LIBS@
-xled_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+xled_LDADD = $(X11EXAMPLES_DEP_LIBS)
+xled_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
xbell_SOURCES = xbell.c
-xbell_LDADD = @X11EXAMPLES_DEP_LIBS@
-xbell_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+xbell_LDADD = $(X11EXAMPLES_DEP_LIBS)
+xbell_CFLAGS = $(X11EXAMPLES_DEP_CFLAGS) $(CWARNFLAGS)
ev_SOURCES = ev.c
ev_LDADD =
diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index f5f9d9b8a..ba2637b58 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -692,7 +692,7 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
return !Success;
fd = LinuxConsoleFd;
- ki->driverPrivate = (void *) fd;
+ ki->driverPrivate = (void *) (intptr_t) fd;
ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
tcgetattr (fd, &LinuxTermios);
@@ -724,7 +724,7 @@ LinuxKeyboardDisable (KdKeyboardInfo *ki)
if (!ki)
return;
- fd = (int) ki->driverPrivate;
+ fd = (int) (intptr_t) ki->driverPrivate;
KdUnregisterFd(ki, fd, FALSE);
ioctl(fd, KDSKBMODE, LinuxKbdTrans);
@@ -753,7 +753,7 @@ LinuxKeyboardLeds (KdKeyboardInfo *ki, int leds)
if (!ki)
return;
- ioctl ((int)ki->driverPrivate, KDSETLED, leds & 7);
+ ioctl ((int)(intptr_t)ki->driverPrivate, KDSETLED, leds & 7);
}
KdKeyboardDriver LinuxKeyboardDriver = {
diff --git a/hw/kdrive/linux/ms.c b/hw/kdrive/linux/ms.c
index b6151cd90..176e12550 100644
--- a/hw/kdrive/linux/ms.c
+++ b/hw/kdrive/linux/ms.c
@@ -152,7 +152,7 @@ MsEnable (KdPointerInfo *pi)
}
if (KdRegisterFd (port, MsRead, pi))
return TRUE;
- pi->driverPrivate = (void *)port;
+ pi->driverPrivate = (void *)(intptr_t)port;
return Success;
@@ -164,7 +164,7 @@ MsEnable (KdPointerInfo *pi)
static void
MsDisable (KdPointerInfo *pi)
{
- KdUnregisterFd (pi, (int)pi->driverPrivate, TRUE);
+ KdUnregisterFd (pi, (int)(intptr_t)pi->driverPrivate, TRUE);
}
static void
diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c
index 465b963f2..b62d769f2 100644
--- a/hw/kdrive/linux/ps2.c
+++ b/hw/kdrive/linux/ps2.c
@@ -159,7 +159,7 @@ Ps2Enable (KdPointerInfo *pi)
return BadAlloc;
}
- pi->driverPrivate = (void *)fd;
+ pi->driverPrivate = (void *)(intptr_t)fd;
return Success;
}
@@ -168,7 +168,7 @@ Ps2Enable (KdPointerInfo *pi)
static void
Ps2Disable (KdPointerInfo *pi)
{
- KdUnregisterFd (pi, (int)pi->driverPrivate, TRUE);
+ KdUnregisterFd (pi, (int)(intptr_t)pi->driverPrivate, TRUE);
}
static void
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index d22fdc8b9..6625545a6 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -939,15 +939,16 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
pInfo->attrs = DuplicateInputAttributes(attrs);
}
- if (!pInfo->driver || !pInfo->name) {
- xf86Msg(X_INFO, "No input driver/identifier specified (ignoring)\n");
+ if (!pInfo->name) {
+ xf86Msg(X_INFO, "No identifier specified, ignoring this device.\n");
rval = BadRequest;
goto unwind;
}
- if (!pInfo->name) {
- xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n");
- rval = BadMatch;
+ if (!pInfo->driver) {
+ xf86Msg(X_INFO, "No input driver specified, ignoring this device.\n");
+ xf86Msg(X_INFO, "This device may have been added with another device file.\n");
+ rval = BadRequest;
goto unwind;
}
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index a4b8e1926..60251f76a 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>2.7.0</string>
+ <string>2.7.1</string>
<key>CFBundleVersion</key>
- <string>2.7.0</string>
+ <string>2.7.1</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
@@ -37,9 +37,9 @@
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>
- <string>© 2003-2011 Apple Inc.
+ <string>© 2003-2012 Apple Inc.
© 2003 XFree86 Project, Inc.
-© 2003-2011 X.org Foundation, Inc.
+© 2003-2012 X.org Foundation, Inc.
</string>
<key>NSMainNibFile</key>
<string>main</string>
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 443e8b0ae..94eb526c5 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -123,6 +123,7 @@ typedef struct _Client {
DeviceIntPtr clientPtr;
ClientIdPtr clientIds;
+ unsigned short majorOp, minorOp;
} ClientRec;
/*
diff --git a/include/extension.h b/include/extension.h
index 29a11c300..9249951a8 100644
--- a/include/extension.h
+++ b/include/extension.h
@@ -52,8 +52,6 @@ _XFUNCPROTOBEGIN
extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client*/);
-extern _X_EXPORT unsigned short MinorOpcodeOfRequest(ClientPtr /*client*/);
-
extern _X_EXPORT Bool EnableDisableExtension(char *name, Bool enable);
extern _X_EXPORT void EnableDisableExtensionError(char *name, Bool enable);
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 49e17bde6..6e0055758 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -648,7 +648,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
depth = pDraw->depth;
if(format == ZPixmap)
{
- if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
+ if ( (((1LL<<depth)-1)&planeMask) != (1LL<<depth)-1 )
{
ChangeGCVal gcv;
xPoint pt;
diff --git a/os/backtrace.c b/os/backtrace.c
index 7ca6dab6d..f3255c738 100644
--- a/os/backtrace.c
+++ b/os/backtrace.c
@@ -44,7 +44,11 @@ void xorg_backtrace(void)
ErrorF("\nBacktrace:\n");
size = backtrace(array, 64);
for (i = 0; i < size; i++) {
- dladdr(array[i], &info);
+ int rc = dladdr(array[i], &info);
+ if (rc == 0) {
+ ErrorF("%d: ?? [%p]\n", i, array[i]);
+ continue;
+ }
mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";
if (info.dli_saddr)
ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,
diff --git a/os/client.c b/os/client.c
index b5349778b..fbccf22ed 100644
--- a/os/client.c
+++ b/os/client.c
@@ -59,6 +59,20 @@
#include "os.h"
#include "dixstruct.h"
+#ifdef __sun
+#include <errno.h>
+#include <procfs.h>
+#endif
+
+#ifdef __OpenBSD__
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+
+#include <kvm.h>
+#include <limits.h>
+#endif
+
/**
* Try to determine a PID for a client from its connection
* information. This should be called only once when new client has
@@ -117,8 +131,6 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
{
char path[PATH_MAX + 1];
int totsize = 0;
- int cmdsize = 0;
- int argsize = 0;
int fd = 0;
if (cmdname)
@@ -129,6 +141,80 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
if (pid == -1)
return;
+#ifdef __sun /* Solaris */
+ /* Solaris does not support /proc/pid/cmdline, but makes information
+ * similar to what ps shows available in a binary structure in the
+ * /proc/pid/psinfo file. */
+ if (snprintf(path, sizeof(path), "/proc/%d/psinfo", pid) < 0)
+ return;
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
+ {
+ ErrorF ("Failed to open %s: %s\n", path, strerror(errno));
+ return;
+ }
+ else
+ {
+ psinfo_t psinfo = { 0 };
+ char *sp;
+
+ totsize = read(fd, &psinfo, sizeof(psinfo_t));
+ close(fd);
+ if (totsize <= 0)
+ return;
+
+ /* pr_psargs is the first PRARGSZ (80) characters of the command
+ * line string - assume up to the first space is the command name,
+ * since it's not delimited. While there is also pr_fname, that's
+ * more limited, giving only the first 16 chars of the basename of
+ * the file that was exec'ed, thus cutting off many long gnome
+ * command names, or returning "isapython2.6" for all python scripts.
+ */
+ psinfo.pr_psargs[PRARGSZ-1] = '\0';
+ sp = strchr(psinfo.pr_psargs, ' ');
+ if (sp)
+ *sp++ = '\0';
+
+ if (cmdname)
+ *cmdname = strdup(psinfo.pr_psargs);
+
+ if (cmdargs && sp)
+ *cmdargs = strdup(sp);
+ }
+#elif defined(__OpenBSD__)
+ /* on OpenBSD use kvm_getargv() */
+ {
+ kvm_t *kd;
+ char errbuf[_POSIX2_LINE_MAX];
+ char **argv;
+ struct kinfo_proc *kp;
+ size_t len = 0;
+ int i, n;
+
+ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, errbuf);
+ if (kd == NULL)
+ return;
+ kp = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &n);
+ if (n != 1)
+ return;
+ argv = kvm_getargv(kd, kp, 0);
+ *cmdname = strdup(argv[0]);
+ i = 1;
+ while (argv[i] != NULL) {
+ len += strlen(argv[i]) + 1;
+ i++;
+ }
+ *cmdargs = calloc(1, len);
+ i = 1;
+ while (argv[i] != NULL) {
+ strlcat(*cmdargs, argv[i], len);
+ strlcat(*cmdargs, " ", len);
+ i++;
+ }
+ kvm_close(kd);
+ }
+#else /* Linux using /proc/pid/cmdline */
+
/* Check if /proc/pid/cmdline exists. It's not supported on all
* operating systems. */
if (snprintf(path, sizeof(path), "/proc/%d/cmdline", pid) < 0)
@@ -146,23 +232,20 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
path[totsize - 1] = '\0';
/* Contruct the process name without arguments. */
- cmdsize = strlen(path) + 1;
if (cmdname)
{
- char *name = malloc(cmdsize);
- if (name)
- {
- strncpy(name, path, cmdsize);
- name[cmdsize - 1] = '\0';
- *cmdname = name;
- }
+ *cmdname = strdup(path);
}
/* Construct the arguments for client process. */
- argsize = totsize - cmdsize;
- if (cmdargs && (argsize > 0))
+ if (cmdargs)
{
- char *args = malloc(argsize);
+ int cmdsize = strlen(path) + 1;
+ int argsize = totsize - cmdsize;
+ char *args = NULL;
+
+ if (argsize > 0)
+ args = malloc(argsize);
if (args)
{
int i = 0;
@@ -175,6 +258,7 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
*cmdargs = args;
}
}
+#endif
}
/**
@@ -198,9 +282,9 @@ void ReserveClientIds(struct _Client *client)
DetermineClientCmd(client->clientIds->pid, &client->clientIds->cmdname, &client->clientIds->cmdargs);
DebugF("client(%lx): Reserved pid(%d).\n",
- client->clientAsMask, client->clientIds->pid);
+ (unsigned long) client->clientAsMask, client->clientIds->pid);
DebugF("client(%lx): Reserved cmdname(%s) and cmdargs(%s).\n",
- client->clientAsMask,
+ (unsigned long) client->clientAsMask,
client->clientIds->cmdname ? client->clientIds->cmdname : "NULL",
client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL");
#endif /* CLIENTIDS */
@@ -222,9 +306,9 @@ void ReleaseClientIds(struct _Client *client)
return;
DebugF("client(%lx): Released pid(%d).\n",
- client->clientAsMask, client->clientIds->pid);
+ (unsigned long) client->clientAsMask, client->clientIds->pid);
DebugF("client(%lx): Released cmdline(%s) and cmdargs(%s).\n",
- client->clientAsMask,
+ (unsigned long) client->clientAsMask,
client->clientIds->cmdname ? client->clientIds->cmdname : "NULL",
client->clientIds->cmdargs ? client->clientIds->cmdargs : "NULL");
diff --git a/record/record.c b/record/record.c
index 93383cee4..778849a6e 100644
--- a/record/record.c
+++ b/record/record.c
@@ -554,7 +554,7 @@ RecordARequest(ClientPtr client)
}
else /* extension, check minor opcode */
{
- int minorop = MinorOpcodeOfRequest(client);
+ int minorop = client->minorOp;
int numMinOpInfo;
RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo;
@@ -611,12 +611,9 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
RecordContextPtr pContext;
RecordClientsAndProtocolPtr pRCAP;
int eci;
- int majorop;
ReplyInfoRec *pri = (ReplyInfoRec *)calldata;
ClientPtr client = pri->client;
- REQUEST(xReq);
- majorop = stuff->reqType;
for (eci = 0; eci < numEnabledContexts; eci++)
{
pContext = ppAllContexts[eci];
@@ -624,6 +621,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
NULL);
if (pRCAP)
{
+ int majorop = client->majorOp;
if (pContext->continuedReply)
{
RecordAProtocolElement(pContext, client, XRecordFromServer,
@@ -644,7 +642,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
}
else /* extension, check minor opcode */
{
- int minorop = MinorOpcodeOfRequest(client);
+ int minorop = client->minorOp;
int numMinOpInfo;
RecordMinorOpPtr pMinorOpInfo = pRCAP->pReplyMinOpInfo;
assert (pMinorOpInfo);
diff --git a/render/animcur.c b/render/animcur.c
index 31cbab9a6..8d4a9c2ef 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -208,6 +208,9 @@ AnimCurDisplayCursor (DeviceIntPtr pDev,
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
Bool ret;
+ if (IsFloating(pDev))
+ return FALSE;
+
Unwrap (as, pScreen, DisplayCursor);
if (IsAnimCur(pCursor))
{
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index ecbed4016..7b01c8b52 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -179,9 +179,9 @@ CursorDisplayCursor (DeviceIntPtr pDev,
ev.type = XFixesEventBase + XFixesCursorNotify;
ev.subtype = XFixesDisplayCursorNotify;
ev.window = e->pWindow->drawable.id;
- ev.cursorSerial = pCursor->serialNumber;
+ ev.cursorSerial = pCursor ? pCursor->serialNumber : 0;
ev.timestamp = currentTime.milliseconds;
- ev.name = pCursor->name;
+ ev.name = pCursor ? pCursor->name : None;
WriteEventsToClient (e->pClient, 1, (xEvent *) &ev);
}
}