summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2011-04-22 17:03:27 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-04-22 17:03:27 +0100
commitecd7b4bb7d143aba7a7e701dd355b23beb2a59f8 (patch)
tree7b9b9ac2205d2494b8b4fe1056b4d0951be632bc
parent9ce5da7b4c600c74f7cea58d0bb0789f365547e1 (diff)
parenta73311f8304193f9245fb077f173bf1e1d52e040 (diff)
Merge commit 'xorg-server-1.10.1' into cygwin-release-1.10xserver-cygwin-1.10.1-1
Conflicts: glx/glapi.c
-rw-r--r--Xext/geext.c2
-rw-r--r--Xext/xtest.c5
-rw-r--r--Xi/exevents.c10
-rw-r--r--Xi/extinit.c7
-rw-r--r--Xi/getprop.c2
-rw-r--r--Xi/getselev.c6
-rw-r--r--Xi/xichangehierarchy.c2
-rw-r--r--Xi/xipassivegrab.c4
-rw-r--r--Xi/xiproperty.c4
-rw-r--r--Xi/xiquerydevice.c7
-rw-r--r--config/hal.c6
-rw-r--r--config/udev.c10
-rw-r--r--configure.ac11
-rw-r--r--dix/colormap.c2
-rw-r--r--dix/devices.c2
-rw-r--r--dix/dixfonts.c18
-rw-r--r--dix/eventconvert.c23
-rw-r--r--dix/events.c7
-rw-r--r--dix/extension.c5
-rw-r--r--dix/getevents.c4
-rw-r--r--fb/fboverlay.c8
-rw-r--r--fb/fbscreen.c4
-rw-r--r--glx/glapi.h2
-rw-r--r--glx/glthread.h2
-rw-r--r--hw/dmx/doc/Makefile.am147
-rw-r--r--hw/xfree86/common/xf86Config.c42
-rw-r--r--hw/xfree86/common/xf86Helper.c1
-rw-r--r--hw/xfree86/common/xf86Init.c4
-rw-r--r--hw/xfree86/common/xf86Option.c77
-rw-r--r--hw/xfree86/common/xf86Xinput.c5
-rw-r--r--hw/xfree86/doc/man/xorg.conf.man13
-rw-r--r--hw/xfree86/dri2/dri2.c9
-rw-r--r--hw/xfree86/loader/Makefile.am9
-rw-r--r--hw/xfree86/loader/loadmod.c6
-rw-r--r--hw/xfree86/modes/xf86Crtc.c21
-rw-r--r--hw/xfree86/vbe/vbe.c2
-rw-r--r--hw/xquartz/X11Application.h3
-rw-r--r--hw/xquartz/X11Application.m29
-rw-r--r--hw/xquartz/bundle/Info.plist.cpp4
-rw-r--r--hw/xquartz/bundle/Resources/English.lproj/Localizable.stringsbin2698 -> 4410 bytes
-rw-r--r--hw/xquartz/pbproxy/x-selection.h2
-rw-r--r--hw/xquartz/quartz.c2
-rw-r--r--hw/xquartz/quartz.h2
-rw-r--r--hw/xquartz/quartzRandR.c27
-rw-r--r--hw/xquartz/xpr/xprAppleWM.c2
-rw-r--r--hw/xquartz/xpr/xprFrame.c4
-rw-r--r--hw/xquartz/xpr/xprScreen.c34
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/xkbsrv.h5
-rw-r--r--mi/micmap.c2
-rw-r--r--mi/midispcur.c10
-rw-r--r--mi/mipointer.c1
-rw-r--r--mi/mispans.c2
-rw-r--r--mi/mizerline.c6
-rw-r--r--miext/damage/damage.c6
-rw-r--r--os/utils.c21
-rw-r--r--render/render.c25
-rw-r--r--xfixes/region.c2
-rw-r--r--xkb/XKBAlloc.c19
-rw-r--r--xkb/XKBGAlloc.c4
-rw-r--r--xkb/ddxList.c4
-rw-r--r--xkb/ddxLoad.c22
-rw-r--r--xkb/xkb.c23
-rw-r--r--xkb/xkbActions.c11
64 files changed, 523 insertions, 241 deletions
diff --git a/Xext/geext.c b/Xext/geext.c
index b37c1a0bd..a6fbb0947 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -185,7 +185,7 @@ SGEGenericEvent(xEvent* from, xEvent* to)
xGenericEvent* gefrom = (xGenericEvent*)from;
xGenericEvent* geto = (xGenericEvent*)to;
- if (gefrom->extension > MAXEXTENSIONS)
+ if ((gefrom->extension & 0x7f) > MAXEXTENSIONS)
{
ErrorF("GE: Invalid extension offset for event.\n");
return;
diff --git a/Xext/xtest.c b/Xext/xtest.c
index b26bc3387..6780aa62a 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -374,10 +374,7 @@ ProcXTestFakeInput(ClientPtr client)
if (!dev->valuator)
return BadDevice;
- /* broken lib, XI events have root uninitialized */
- if (extension || ev->u.keyButtonPointer.root == None)
- root = GetCurrentRootWindow(dev);
- else
+ if (!(extension || ev->u.keyButtonPointer.root == None))
{
rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root,
client, DixGetAttrAccess);
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 327873e29..35f96e6cd 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1280,7 +1280,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
DeliverEventsToWindow(dev, pWin, (xEvent *) & event, 1,
DeviceFocusChangeMask, NullGrab);
- if ((type == DeviceFocusIn) &&
+ if ((event.type == DeviceFocusIn) &&
(wOtherInputMasks(pWin)) &&
(wOtherInputMasks(pWin)->inputEvents[dev->id] & DeviceStateNotifyMask))
{
@@ -1630,14 +1630,18 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx)
if (!others)
return BadAlloc;
if (!pWin->optional->inputMasks && !MakeInputMasks(pWin))
- return BadAlloc;
+ goto bail;
others->mask[mskidx] = mask;
others->resource = FakeClientID(client->index);
others->next = pWin->optional->inputMasks->inputClients;
pWin->optional->inputMasks->inputClients = others;
if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin))
- return BadAlloc;
+ goto bail;
return Success;
+
+bail:
+ free(others);
+ return BadAlloc;
}
static Bool
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 82df7eb02..ec815c913 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -49,6 +49,7 @@ SOFTWARE.
* Dispatch routines and initialization routines for the X input extension.
*
*/
+#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
#define NUMTYPES 15
@@ -410,7 +411,7 @@ static int
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data])
+ if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest;
return (*ProcIVector[stuff->data])(client);
@@ -429,7 +430,7 @@ static int
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > IREQUESTS || !SProcIVector[stuff->data])
+ if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest;
return (*SProcIVector[stuff->data])(client);
@@ -863,6 +864,8 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
{
case XI_Enter:
case XI_Leave:
+ case XI_FocusIn:
+ case XI_FocusOut:
SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to);
break;
case XI_DeviceChanged:
diff --git a/Xi/getprop.c b/Xi/getprop.c
index ba98fc80f..5e102627d 100644
--- a/Xi/getprop.c
+++ b/Xi/getprop.c
@@ -115,7 +115,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
if ((others = wOtherInputMasks(pWin)) != 0) {
for (i = 0; i < EMASKSIZE; i++)
- tbuf = ClassFromMask(NULL, others->dontPropagateMask[i], i,
+ ClassFromMask(NULL, others->dontPropagateMask[i], i,
&count, COUNT);
if (count) {
rep.count = count;
diff --git a/Xi/getselev.c b/Xi/getselev.c
index d63b661cd..7304738b3 100644
--- a/Xi/getselev.c
+++ b/Xi/getselev.c
@@ -118,13 +118,13 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
if ((pOthers = wOtherInputMasks(pWin)) != 0) {
for (others = pOthers->inputClients; others; others = others->next)
for (i = 0; i < EMASKSIZE; i++)
- tclient = ClassFromMask(NULL, others->mask[i], i,
+ ClassFromMask(NULL, others->mask[i], i,
&rep.all_clients_count, COUNT);
for (others = pOthers->inputClients; others; others = others->next)
if (SameClient(others, client)) {
for (i = 0; i < EMASKSIZE; i++)
- tclient = ClassFromMask(NULL, others->mask[i], i,
+ ClassFromMask(NULL, others->mask[i], i,
&rep.this_client_count, COUNT);
break;
}
@@ -152,8 +152,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
if (total_length) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, total_length, buf);
- free(buf);
}
+ free(buf);
return Success;
}
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index b9cdedf77..21c74ed7a 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -70,6 +70,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
ev = calloc(1, sizeof(xXIHierarchyEvent) +
MAXDEVICES * sizeof(xXIHierarchyInfo));
+ if (!ev)
+ return;
ev->type = GenericEvent;
ev->extension = IReqCode;
ev->evtype = XI_HierarchyChanged;
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index e99b6e554..4b71c688a 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -194,7 +194,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
info->status = status;
info->modifiers = *modifiers;
rep.num_modifiers++;
- rep.length++;
+ rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
}
}
@@ -202,7 +202,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
if (rep.num_modifiers)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed);
+ WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed);
}
free(modifiers_failed);
return ret;
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 17835e2cd..83ce93014 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -1051,11 +1051,11 @@ SProcXChangeDeviceProperty (ClientPtr client)
char n;
REQUEST(xChangeDevicePropertyReq);
+ REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
swaps(&stuff->length, n);
swapl(&stuff->property, n);
swapl(&stuff->type, n);
swapl(&stuff->nUnits, n);
- REQUEST_SIZE_MATCH(xChangeDevicePropertyReq);
return (ProcXChangeDeviceProperty(client));
}
@@ -1295,12 +1295,12 @@ SProcXIChangeProperty(ClientPtr client)
char n;
REQUEST(xXIChangePropertyReq);
+ REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
swaps(&stuff->length, n);
swaps(&stuff->deviceid, n);
swapl(&stuff->property, n);
swapl(&stuff->type, n);
swapl(&stuff->num_items, n);
- REQUEST_SIZE_MATCH(xXIChangePropertyReq);
return (ProcXIChangeProperty(client));
}
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index fdd2c051d..f8d6c13fa 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -107,8 +107,10 @@ ProcXIQueryDevice(ClientPtr client)
}
info = calloc(1, len);
- if (!info)
+ if (!info) {
+ free(skip);
return BadAlloc;
+ }
memset(&rep, 0, sizeof(xXIQueryDeviceReply));
rep.repType = X_Reply;
@@ -153,8 +155,9 @@ ProcXIQueryDevice(ClientPtr client)
}
}
+ len = rep.length * 4;
WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
- WriteToClient(client, rep.length * 4, ptr);
+ WriteToClient(client, len, ptr);
free(ptr);
free(skip);
return rc;
diff --git a/config/hal.c b/config/hal.c
index 0b848a0f7..297520aa6 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -392,10 +392,10 @@ unwind:
free(driver);
free(name);
free(config_info);
- while (!dev && (tmpo = options)) {
+ while ((tmpo = options)) {
options = tmpo->next;
- free(tmpo->key);
- free(tmpo->value);
+ free(tmpo->key); /* NULL if dev != NULL */
+ free(tmpo->value); /* NULL if dev != NULL */
free(tmpo);
}
diff --git a/config/udev.c b/config/udev.c
index ab27c98a5..9ac34ee50 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -197,10 +197,10 @@ device_added(struct udev_device *udev_device)
unwind:
free(config_info);
- while (!dev && (tmpo = options)) {
+ while ((tmpo = options)) {
options = tmpo->next;
- free(tmpo->key);
- free(tmpo->value);
+ free(tmpo->key); /* NULL if dev != NULL */
+ free(tmpo->value); /* NULL if dev != NULL */
free(tmpo);
}
@@ -255,6 +255,10 @@ wakeup_handler(pointer data, int err, pointer read_mask)
device_added(udev_device);
else if (!strcmp(action, "remove"))
device_removed(udev_device);
+ else if (!strcmp(action, "change")) {
+ device_removed(udev_device);
+ device_added(udev_device);
+ }
}
udev_device_unref(udev_device);
}
diff --git a/configure.ac b/configure.ac
index 8c97d7095..711637bfe 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.10.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-2-25"
+AC_INIT([xorg-server], 1.10.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-04-15"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
@@ -599,7 +599,10 @@ AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerate
[AIGLX=yes])
AX_TLS
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
- [GLX_USE_TLS=$enableval],
+ [GLX_USE_TLS=$enableval
+ if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
+ AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
+ fi],
[GLX_USE_TLS=no
if test "${ac_cv_tls}" != "none" ; then
GLX_USE_TLS=yes
@@ -1926,7 +1929,7 @@ if test "x$XQUARTZ" = xyes; then
AC_CHECK_LIB([Xplugin],[xp_init],[:])
- CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
+ CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
diff --git a/dix/colormap.c b/dix/colormap.c
index 2e9a80647..0e1feb6c4 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1879,6 +1879,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
{
for (p = ppixTemp; p < ppixTemp + npix; p++)
pmap->red[*p].refcnt = 0;
+ free(ppixTemp);
return BadAlloc;
}
pmap->clientPixelsRed[client] = ppix;
@@ -2104,6 +2105,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
{
for (z++ ; z < npixShared; z++)
free(ppshared[z]);
+ free(psharedList);
return FALSE;
}
}
diff --git a/dix/devices.c b/dix/devices.c
index 89294aacb..55f22cbaf 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -938,6 +938,8 @@ CloseDevice(DeviceIntPtr dev)
}
free(dev->deviceGrab.sync.event);
+ free(dev->config_info); /* Allocated in xf86ActivateDevice. */
+ dev->config_info = NULL;
dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
}
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index d8f15290b..fbac124da 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -66,16 +66,10 @@ Equipment Corporation.
#include "dixfont.h"
#include "xace.h"
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
#ifdef XF86BIGFONT
#include "xf86bigfontsrv.h"
#endif
-#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics
-
extern pointer fosNaturalParams;
extern FontPtr defaultFont;
@@ -391,14 +385,6 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
int i;
FontPtr cached = (FontPtr)0;
-#ifdef FONTDEBUG
- char *f;
- f = malloc(lenfname + 1);
- memmove(f, pfontname, lenfname);
- f[lenfname] = '\0';
- ErrorF("[dix] OpenFont: fontname is \"%s\"\n", f);
- free(f);
-#endif
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
return BadName;
if (patternCache)
@@ -1829,8 +1815,10 @@ SetDefaultFontPath(char *path)
/* get enough for string, plus values -- use up commas */
len = strlen(temp_path) + 1;
nump = cp = newpath = malloc(len);
- if (!newpath)
+ if (!newpath) {
+ free(temp_path);
return BadAlloc;
+ }
pp = (unsigned char *) temp_path;
cp++;
while (*pp) {
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index dd1ca460b..a73c67129 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -371,27 +371,20 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
state |= (dev && dev->button) ? (dev->button->state) : 0;
}
- /* FIXME: non-continuous valuator data in internal events*/
for (i = 0; i < num_valuators; i += 6, xv++) {
+ INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array
+ int j;
+
xv->type = DeviceValuator;
xv->first_valuator = first_valuator + i;
xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i);
xv->deviceid = ev->deviceid;
xv->device_state = state;
- switch (xv->num_valuators) {
- case 6:
- xv->valuator5 = ev->valuators.data[xv->first_valuator + 5];
- case 5:
- xv->valuator4 = ev->valuators.data[xv->first_valuator + 4];
- case 4:
- xv->valuator3 = ev->valuators.data[xv->first_valuator + 3];
- case 3:
- xv->valuator2 = ev->valuators.data[xv->first_valuator + 2];
- case 2:
- xv->valuator1 = ev->valuators.data[xv->first_valuator + 1];
- case 1:
- xv->valuator0 = ev->valuators.data[xv->first_valuator + 0];
- }
+
+ /* Unset valuators in masked valuator events have the proper data values
+ * in the case of an absolute axis in between two set valuators. */
+ for (j = 0; j < xv->num_valuators; j++)
+ valuators[j] = ev->valuators.data[xv->first_valuator + j];
if (i + 6 < num_valuators)
xv->deviceid |= MORE_EVENTS;
diff --git a/dix/events.c b/dix/events.c
index 07f8b05ea..f0ea57626 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3872,16 +3872,15 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
switch (grabinfo->sync.state)
{
case FREEZE_BOTH_NEXT_EVENT:
- for (dev = inputInfo.devices; dev; dev = dev->next)
+ dev = GetPairedDevice(thisDev);
+ if (dev)
{
- if (dev == thisDev)
- continue;
FreezeThaw(dev, TRUE);
if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) &&
(CLIENT_BITS(grab->resource) ==
CLIENT_BITS(dev->deviceGrab.grab->resource)))
dev->deviceGrab.sync.state = FROZEN_NO_EVENT;
- else if (GetPairedDevice(thisDev) == dev)
+ else
dev->deviceGrab.sync.other = grab;
}
/* fall through */
diff --git a/dix/extension.c b/dix/extension.c
index 6540b64b0..c7bbac5ff 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -353,9 +353,8 @@ ProcListExtensions(ClientPtr client)
}
WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);
if (reply.length)
- {
WriteToClient(client, total_length, buffer);
- free(buffer);
- }
+
+ free(buffer);
return Success;
}
diff --git a/dix/getevents.c b/dix/getevents.c
index 794df420b..8355040f1 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -205,6 +205,8 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
{
int i;
+ /* Set the data to the previous value for unset absolute axes. The values
+ * may be used when sent as part of an XI 1.x valuator event. */
for (i = 0; i < valuator_mask_size(mask); i++)
{
if (valuator_mask_isset(mask, i))
@@ -216,6 +218,8 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
event->valuators.data_frac[i] =
dev->last.remainder[i] * (1 << 16) * (1 << 16);
}
+ else if (valuator_get_mode(dev, i) == Absolute)
+ event->valuators.data[i] = dev->valuator->axisVal[i];
}
}
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 7fca89c44..45e637078 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -390,12 +390,16 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1,
&defaultVisual, ((unsigned long)1<<(bpp1-1)) |
- ((unsigned long)1<<(bpp2-1)), 8))
+ ((unsigned long)1<<(bpp2-1)), 8)) {
+ free(pScrPriv);
return FALSE;
+ }
if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
depth1, ndepths, depths,
- defaultVisual, nvisuals, visuals))
+ defaultVisual, nvisuals, visuals)) {
+ free(pScrPriv);
return FALSE;
+ }
/* MI thinks there's no frame buffer */
#ifdef MITSHM
ShmRegisterFbFuncs(pScreen);
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 2502efeff..c5b35ac85 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -225,11 +225,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
rootdepth = 0;
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
- {
- free(visuals);
- free(depths);
return FALSE;
- }
if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
rootdepth, ndepths, depths,
defaultVisual, nvisuals, visuals))
diff --git a/glx/glapi.h b/glx/glapi.h
index 8f2cf6621..ab80f7e67 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -83,7 +83,7 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
const extern void *_glapi_Context;
const extern struct _glapi_table *_glapi_Dispatch;
-extern __thread void * _glapi_tls_Context
+extern TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
diff --git a/glx/glthread.h b/glx/glthread.h
index e2765cebb..78f149f9d 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -300,7 +300,7 @@ _glthread_SetTSD(_glthread_TSD *, void *);
#if defined(GLX_USE_TLS)
-extern __thread struct _glapi_table * _glapi_tls_Dispatch
+extern TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
#define GET_DISPATCH() _glapi_tls_Dispatch
diff --git a/hw/dmx/doc/Makefile.am b/hw/dmx/doc/Makefile.am
index 8e7360288..f6d2b97a8 100644
--- a/hw/dmx/doc/Makefile.am
+++ b/hw/dmx/doc/Makefile.am
@@ -32,12 +32,21 @@ DOXYGEN_HEAD=\
DOXYGEN_REST= \
dmx.txt \
scaled.txt \
+ html/annotated.html \
+ html/bc_s.png \
html/ChkNotMaskEv_8c.html \
html/ChkNotMaskEv_8h.html \
html/ChkNotMaskEv_8h_source.html \
html/classes.html \
+ html/closed.png \
+ html/dmx-config_8h.html \
+ html/dmx-config_8h_source.html \
+ html/dmx_8c.html \
html/dmx_8h.html \
html/dmx_8h_source.html \
+ html/dmx__glxvisuals_8c.html \
+ html/dmx__glxvisuals_8h.html \
+ html/dmx__glxvisuals_8h_source.html \
html/dmxarg_8c.html \
html/dmxarg_8h.html \
html/dmxarg_8h_source.html \
@@ -89,7 +98,6 @@ DOXYGEN_REST= \
html/dmxgcops_8c.html \
html/dmxgcops_8h.html \
html/dmxgcops_8h_source.html \
- html/dmx__glxvisuals_8h_source.html \
html/dmxinit_8c.html \
html/dmxinit_8h.html \
html/dmxinit_8h_source.html \
@@ -138,6 +146,7 @@ DOXYGEN_REST= \
html/dmxsync_8c.html \
html/dmxsync_8h.html \
html/dmxsync_8h_source.html \
+ html/dmxtodmx_8c.html \
html/dmxvisual_8c.html \
html/dmxvisual_8h.html \
html/dmxvisual_8h_source.html \
@@ -159,17 +168,119 @@ DOXYGEN_REST= \
html/ftv2node.png \
html/ftv2plastnode.png \
html/ftv2pnode.png \
+ html/ftv2splitbar.png \
html/ftv2vertline.png \
html/functions.html \
+ html/functions_0x62.html \
+ html/functions_0x63.html \
+ html/functions_0x64.html \
+ html/functions_0x65.html \
+ html/functions_0x66.html \
+ html/functions_0x67.html \
+ html/functions_0x68.html \
+ html/functions_0x69.html \
+ html/functions_0x6b.html \
+ html/functions_0x6c.html \
+ html/functions_0x6d.html \
+ html/functions_0x6e.html \
+ html/functions_0x6f.html \
+ html/functions_0x70.html \
+ html/functions_0x72.html \
+ html/functions_0x73.html \
+ html/functions_0x74.html \
+ html/functions_0x75.html \
+ html/functions_0x76.html \
+ html/functions_0x77.html \
+ html/functions_0x78.html \
+ html/functions_0x79.html \
+ html/functions_eval.html \
html/functions_vars.html \
+ html/functions_vars_0x62.html \
+ html/functions_vars_0x63.html \
+ html/functions_vars_0x64.html \
+ html/functions_vars_0x65.html \
+ html/functions_vars_0x66.html \
+ html/functions_vars_0x67.html \
+ html/functions_vars_0x68.html \
+ html/functions_vars_0x69.html \
+ html/functions_vars_0x6b.html \
+ html/functions_vars_0x6c.html \
+ html/functions_vars_0x6d.html \
+ html/functions_vars_0x6e.html \
+ html/functions_vars_0x6f.html \
+ html/functions_vars_0x70.html \
+ html/functions_vars_0x72.html \
+ html/functions_vars_0x73.html \
+ html/functions_vars_0x74.html \
+ html/functions_vars_0x75.html \
+ html/functions_vars_0x76.html \
+ html/functions_vars_0x77.html \
+ html/functions_vars_0x78.html \
+ html/functions_vars_0x79.html \
+ html/globals.html \
+ html/globals_0x61.html \
+ html/globals_0x62.html \
+ html/globals_0x63.html \
+ html/globals_0x64.html \
+ html/globals_0x65.html \
+ html/globals_0x66.html \
+ html/globals_0x67.html \
+ html/globals_0x69.html \
+ html/globals_0x6b.html \
+ html/globals_0x6c.html \
+ html/globals_0x6d.html \
+ html/globals_0x6e.html \
+ html/globals_0x6f.html \
+ html/globals_0x70.html \
+ html/globals_0x71.html \
+ html/globals_0x72.html \
+ html/globals_0x73.html \
+ html/globals_0x74.html \
+ html/globals_0x75.html \
+ html/globals_0x76.html \
+ html/globals_0x78.html \
+ html/globals_0x79.html \
html/globals_defs.html \
+ html/globals_defs_0x62.html \
+ html/globals_defs_0x63.html \
+ html/globals_defs_0x64.html \
+ html/globals_defs_0x65.html \
+ html/globals_defs_0x66.html \
+ html/globals_defs_0x67.html \
+ html/globals_defs_0x6c.html \
+ html/globals_defs_0x6d.html \
+ html/globals_defs_0x6e.html \
+ html/globals_defs_0x6f.html \
+ html/globals_defs_0x70.html \
+ html/globals_defs_0x72.html \
+ html/globals_defs_0x73.html \
+ html/globals_defs_0x74.html \
+ html/globals_defs_0x75.html \
+ html/globals_defs_0x76.html \
html/globals_enum.html \
html/globals_eval.html \
html/globals_func.html \
- html/globals.html \
+ html/globals_func_0x61.html \
+ html/globals_func_0x63.html \
+ html/globals_func_0x64.html \
+ html/globals_func_0x65.html \
+ html/globals_func_0x67.html \
+ html/globals_func_0x69.html \
+ html/globals_func_0x6b.html \
+ html/globals_func_0x6c.html \
+ html/globals_func_0x6d.html \
+ html/globals_func_0x6e.html \
+ html/globals_func_0x6f.html \
+ html/globals_func_0x70.html \
+ html/globals_func_0x73.html \
+ html/globals_func_0x75.html \
+ html/globals_func_0x76.html \
+ html/globals_func_0x78.html \
+ html/globals_func_0x79.html \
html/globals_type.html \
html/globals_vars.html \
html/index.html \
+ html/jquery.js \
html/lnx-keyboard_8c.html \
html/lnx-keyboard_8h.html \
html/lnx-keyboard_8h_source.html \
@@ -179,15 +290,18 @@ DOXYGEN_REST= \
html/lnx-ps2_8c.html \
html/lnx-ps2_8h.html \
html/lnx-ps2_8h_source.html \
- html/main.html \
+ html/nav_f.png \
+ html/nav_h.png \
+ html/navtree.css \
+ html/navtree.js \
+ html/open.png \
+ html/resize.js \
html/struct__dmxArg.html \
html/struct__dmxColormapPriv.html \
- html/structDMXConfigCmdStruct.html \
html/struct__DMXConfigComment.html \
html/struct__DMXConfigDisplay.html \
html/struct__DMXConfigEntry.html \
html/struct__DMXConfigFullDim.html \
- html/structDMXConfigListStruct.html \
html/struct__DMXConfigNumber.html \
html/struct__DMXConfigOption.html \
html/struct__DMXConfigPair.html \
@@ -199,26 +313,33 @@ DOXYGEN_REST= \
html/struct__DMXConfigVirtual.html \
html/struct__DMXConfigWall.html \
html/struct__dmxCursorPriv.html \
- html/structDMXDesktopAttributesRec.html \
html/struct__DMXEventMap.html \
html/struct__dmxFontPriv.html \
html/struct__dmxGCPriv.html \
- html/structdmxGlxVisualPrivate.html \
html/struct__dmxGlyphPriv.html \
- html/structDMXInputAttributesRec.html \
html/struct__DMXInputInfo.html \
html/struct__DMXLocalInitInfo.html \
html/struct__DMXLocalInputInfo.html \
html/struct__dmxPictPriv.html \
html/struct__dmxPixPriv.html \
- html/structDMXScreenAttributesRec.html \
html/struct__DMXScreenInfo.html \
html/struct__DMXStatAvg.html \
html/struct__DMXStatInfo.html \
- html/structDMXWindowAttributesRec.html \
html/struct__dmxWinPriv.html \
html/struct__myPrivate.html \
- html/tree.html \
+ html/structDMXConfigCmdStruct.html \
+ html/structDMXConfigListStruct.html \
+ html/structDMXDesktopAttributesRec.html \
+ html/structdmxGlxVisualPrivate.html \
+ html/structDMXInputAttributesRec.html \
+ html/structDMXScreenAttributesRec.html \
+ html/structDMXWindowAttributesRec.html \
+ html/structstack.html \
+ html/tab_a.png \
+ html/tab_b.png \
+ html/tab_h.png \
+ html/tab_s.png \
+ html/tabs.css \
html/usb-common_8c.html \
html/usb-common_8h.html \
html/usb-common_8h_source.html \
@@ -232,7 +353,9 @@ DOXYGEN_REST= \
html/usb-other_8h.html \
html/usb-other_8h_source.html \
html/usb-private_8h.html \
- html/usb-private_8h_source.html
+ html/usb-private_8h_source.html \
+ html/vdltodmx_8c.html \
+ html/xdmxconfig_8c.html
DOXYGEN_FILES=$(DOXYGEN_HEAD) $(DOXYGEN_REST)
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 49d8fa84a..114bdc3a3 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -309,7 +309,7 @@ xf86ModulelistFromConfig(pointer **optlist)
}
if (found == FALSE) {
XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules;
- ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
+ xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name);
}
}
@@ -318,7 +318,7 @@ xf86ModulelistFromConfig(pointer **optlist)
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
if (ModuleDefaults[i].toLoad == TRUE) {
XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules;
- ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
+ xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
}
}
}
@@ -1224,7 +1224,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Pointer;
devs[count - 1]->options =
- xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
+ xf86addNewOption(devs[count -1]->options,
+ xnfstrdup("CorePointer"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
@@ -1364,7 +1365,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Keyboard;
devs[count - 1]->options =
- xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
+ xf86addNewOption(devs[count - 1]->options,
+ xnfstrdup("CoreKeyboard"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
@@ -1457,8 +1459,9 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
while (irp) {
indp[count] = xf86AllocateInput();
if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
- while(count--)
+ do {
free(indp[count]);
+ } while(count--);
free(indp);
return FALSE;
}
@@ -1483,7 +1486,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
{
XF86ConfAdjacencyPtr adjp;
XF86ConfInactivePtr idp;
- int count = 0;
+ int saved_count, count = 0;
int scrnum;
XF86ConfLayoutPtr l;
MessageType from;
@@ -1551,6 +1554,9 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
scrnum = adjp->adj_scrnum;
if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum,
X_CONFIG)) {
+ do {
+ free(slp[count].screen);
+ } while(count--);
free(slp);
return FALSE;
}
@@ -1639,6 +1645,10 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
}
+ if (!count)
+ saved_count = 1;
+ else
+ saved_count = count;
/*
* Count the number of inactive devices.
*/
@@ -1655,16 +1665,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
idp = conf_layout->lay_inactive_lst;
count = 0;
while (idp) {
- if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) {
- free(gdp);
- return FALSE;
- }
+ if (!configDevice(&gdp[count], idp->inactive_device, FALSE))
+ goto bail;
count++;
idp = (XF86ConfInactivePtr)idp->list.next;
}
if (!configInputDevices(conf_layout, servlayoutp))
- return FALSE;
+ goto bail;
servlayoutp->id = conf_layout->lay_identifier;
servlayoutp->screens = slp;
@@ -1673,6 +1681,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
from = X_DEFAULT;
return TRUE;
+
+bail:
+ do {
+ free(slp[saved_count].screen);
+ } while(saved_count--);
+ free(slp);
+ free(gdp);
+ return FALSE;
}
/*
@@ -1785,9 +1801,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
XF86ConfDisplayPtr dispptr;
XF86ConfAdaptorLinkPtr conf_adaptor;
Bool defaultMonitor = FALSE;
+ XF86ConfScreenRec local_conf_screen;
if (!conf_screen) {
- conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+ memset(&local_conf_screen, 0, sizeof(local_conf_screen));
+ conf_screen = &local_conf_screen;
conf_screen->scrn_identifier = "Default Screen Section";
xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
}
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 1a5bf8a1c..62395aec7 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1931,6 +1931,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
+ free(pEnt);
return pScrn;
}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index e664ce451..0b36163c0 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1414,8 +1414,10 @@ xf86LoadModules(char **list, pointer *optlist)
name = xf86NormalizeName(list[i]);
/* Skip empty names */
- if (name == NULL || *name == '\0')
+ if (name == NULL || *name == '\0') {
+ free(name);
continue;
+ }
/* Replace obsolete keyboard driver with kbd */
if (!xf86NameCmp(name, "keyboard")) {
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 16c27e5ee..480f38694 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -212,7 +212,7 @@ LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed)
return deflt;
}
-static int
+static double
LookupPercentOption(pointer optlist, const char *name, double deflt, Bool markUsed)
{
OptionInfoRec o;
@@ -496,27 +496,33 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
switch (p->type) {
case OPTV_INTEGER:
if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ }
p->found = FALSE;
} else {
p->value.num = strtoul(s, &end, 0);
if (*end == '\0') {
p->found = TRUE;
} else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an integer value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ }
p->found = FALSE;
}
}
break;
case OPTV_STRING:
if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires an string value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an string value\n",
+ p->name);
+ }
p->found = FALSE;
} else {
p->value.str = s;
@@ -529,18 +535,22 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
break;
case OPTV_REAL:
if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point "
+ "value\n", p->name);
+ }
p->found = FALSE;
} else {
p->value.realnum = strtod(s, &end);
if (*end == '\0') {
p->found = TRUE;
} else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a floating point value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point "
+ "value\n", p->name);
+ }
p->found = FALSE;
}
}
@@ -549,8 +559,11 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
if (GetBoolValue(p, s)) {
p->found = TRUE;
} else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a boolean value\n", p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a boolean value\n",
+ p->name);
+ }
p->found = FALSE;
}
break;
@@ -561,8 +574,10 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
* hence 100 looks the same as 100% to the caller of sccanf
*/
if (sscanf(s, "%lf%c", &p->value.realnum, &tmp) != 2 || tmp != '%') {
- xf86DrvMsg(scrnIndex, X_WARNING,
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
"Option \"%s\" requires a percent value\n", p->name);
+ }
p->found = FALSE;
} else {
p->found = TRUE;
@@ -571,9 +586,11 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
break;
case OPTV_FREQ:
if (*s == '\0') {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ }
p->found = FALSE;
} else {
double freq = strtod(s, &end);
@@ -590,17 +607,21 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
!xf86NameCmp(end, "M"))
units = 1000000;
else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ }
p->found = FALSE;
}
if (p->found)
freq *= (double)units;
} else {
- xf86DrvMsg(scrnIndex, X_WARNING,
- "Option \"%s\" requires a frequency value\n",
- p->name);
+ if (markUsed) {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ }
p->found = FALSE;
}
if (p->found) {
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 74365e10b..2bac33a09 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -775,6 +775,8 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
goto unwind;
}
+ xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName, pInfo->name);
+
if (!drv->PreInit) {
xf86Msg(X_ERROR,
"Input driver `%s' has no PreInit function (ignoring)\n",
@@ -817,15 +819,18 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
/* Enable it if it's properly initialised and we're currently in the VT */
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
{
+ OsBlockSignals();
EnableDevice(dev, TRUE);
if (!dev->enabled)
{
+ OsReleaseSignals();
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
rval = BadMatch;
goto unwind;
}
/* send enter/leave event, update sprite window */
CheckMotion(NULL, dev);
+ OsReleaseSignals();
}
*pdev = dev;
diff --git a/hw/xfree86/doc/man/xorg.conf.man b/hw/xfree86/doc/man/xorg.conf.man
index e3fd0eadf..4bec31695 100644
--- a/hw/xfree86/doc/man/xorg.conf.man
+++ b/hw/xfree86/doc/man/xorg.conf.man
@@ -814,11 +814,18 @@ Example: the MIT-SHM extension can be disabled with the following entry:
The config file may have multiple
.B InputDevice
sections.
-Recent X servers employ input hotplugging to add input devices, with the HAL
-backend being the default backend for X servers since 1.4. It is usually not
+Recent X servers employ HAL or udev backends for input device enumeration
+and input hotplugging. It is usually not
necessary to provide
.B InputDevice
-sections in the xorg.conf if hotplugging is enabled.
+sections in the xorg.conf if hotplugging is in use. If hotplugging is
+enabled,
+.B InputDevice
+sections using the
+.B mouse, kbd
+and
+.B vmmouse
+driver will be ignored.
.PP
If hotplugging is disabled, there will normally
be at least two: one for the core (primary) keyboard
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 9ca378fed..10be59953 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -221,11 +221,16 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
if (ref == NULL)
return BadAlloc;
- if (!AddResource(dri2_id, dri2DrawableRes, pPriv))
+ if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) {
+ free(ref);
return BadAlloc;
+ }
if (!DRI2LookupDrawableRef(pPriv, id))
- if (!AddResource(id, dri2DrawableRes, pPriv))
+ if (!AddResource(id, dri2DrawableRes, pPriv)) {
+ FreeResourceByType(dri2_id, dri2DrawableRes, TRUE);
+ free(ref);
return BadAlloc;
+ }
ref->id = id;
ref->dri2_id = dri2_id;
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 7f386ccc0..0e5b304a4 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -12,18 +12,21 @@ EXTRA_DIST = \
loaderProcs.h \
sdksyms.sh
+nodist_libloader_la_SOURCES = \
+ sdksyms.c
+
libloader_la_SOURCES = \
loader.c \
loaderProcs.h \
loadext.c \
loadmod.c \
- os.c \
- sdksyms.c
+ os.c
+
libloader_la_LIBADD = $(DLOPEN_LIBS)
CLEANFILES = sdksyms.c sdksyms.dep
-sdksyms.dep sdksyms.c: sdksyms.sh
+sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
SDKSYMS_DEP = sdksyms.dep
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index eaa99e8c4..46ce68b86 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -532,6 +532,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
FreePathList(pathlist);
FreeSubdirs(subdirs);
FreePatterns(patterns);
+ closedir(d);
return NULL;
}
listing[n] = malloc(len + 1);
@@ -540,6 +541,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
FreePathList(pathlist);
FreeSubdirs(subdirs);
FreePatterns(patterns);
+ closedir(d);
return NULL;
}
strncpy(listing[n], dp->d_name + match[1].rm_so,
@@ -556,6 +558,10 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
}
if (listing)
listing[n] = NULL;
+
+ FreePathList(pathlist);
+ FreeSubdirs(subdirs);
+ FreePatterns(patterns);
return listing;
}
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 86f038aa1..c2814d4cd 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2354,6 +2354,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
int i = scrn->scrnIndex;
Bool have_outputs = TRUE;
Bool ret;
+ Bool success = FALSE;
/* Set up the device options */
config->options = xnfalloc (sizeof (xf86DeviceOptions));
@@ -2412,11 +2413,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
* Set the position of each output
*/
if (!xf86InitialOutputPositions (scrn, modes))
- {
- free(crtcs);
- free(modes);
- return FALSE;
- }
+ goto bailout;
/*
* Set initial panning of each output
@@ -2427,11 +2424,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
* Assign CRTCs to fit output configuration
*/
if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
- {
- free(crtcs);
- free(modes);
- return FALSE;
- }
+ goto bailout;
/* XXX override xf86 common frame computation code */
@@ -2508,7 +2501,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
* Make sure the configuration isn't too small.
*/
if (width < config->minWidth || height < config->minHeight)
- return FALSE;
+ goto bailout;
/*
* Limit the crtc config to virtual[XY] if the driver can't grow the
@@ -2531,10 +2524,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
xf86CVTMode(width, height, 60, 0, 0));
}
-
+ success = TRUE;
+ bailout:
free(crtcs);
free(modes);
- return TRUE;
+ free(enabled);
+ return success;
}
/*
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index bcda5ec35..04132d956 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -395,7 +395,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
i = 0;
while (modes[i] != 0xffff)
i++;
- block->VideoModePtr = malloc(sizeof(CARD16) * i + 1);
+ block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1));
memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
block->VideoModePtr[i] = 0xffff;
diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index b3ad19b53..256ff187a 100644
--- a/hw/xquartz/X11Application.h
+++ b/hw/xquartz/X11Application.h
@@ -73,6 +73,8 @@ void X11ApplicationServerReady (void);
void X11ApplicationShowHideMenubar (int state);
void X11ApplicationLaunchClient (const char *cmd);
+Bool X11ApplicationCanEnterRandR (void);
+
void X11ApplicationMain(int argc, char **argv, char **envp);
#define PREFS_APPSMENU "apps_menu"
@@ -86,6 +88,7 @@ void X11ApplicationMain(int argc, char **argv, char **envp);
#define PREFS_NO_TCP "nolisten_tcp"
#define PREFS_DONE_XINIT_CHECK "done_xinit_check"
#define PREFS_NO_QUIT_ALERT "no_quit_alert"
+#define PREFS_NO_RANDR_ALERT "no_randr_alert"
#define PREFS_OPTION_SENDS_ALT "option_sends_alt"
#define PREFS_FAKE_BUTTON2 "fake_button2"
#define PREFS_FAKE_BUTTON3 "fake_button3"
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index b855c8358..3521517a2 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -883,6 +883,35 @@ void X11ApplicationLaunchClient (const char *cmd) {
[string release];
}
+/* This is a special function in that it is run from the *SERVER* thread and
+ * not the AppKit thread. We want to block entering a screen-capturing RandR
+ * mode until we notify the user about how to get out if the X11 client crashes.
+ */
+Bool X11ApplicationCanEnterRandR(void) {
+ NSString *title, *msg;
+
+ if([X11App prefs_get_boolean:@PREFS_NO_RANDR_ALERT default:NO] || XQuartzShieldingWindowLevel != 0)
+ return TRUE;
+
+ title = NSLocalizedString(@"Enter RandR mode?", @"Dialog title when switching to RandR");
+ msg = NSLocalizedString(@"An application has requested X11 to change the resolution of your display. X11 will restore the display to its previous state when the requesting application requests to return to the previous state. Alternatively, you can use the ⌥⌘A key sequence to force X11 to return to the previous state.",
+ @"Dialog when switching to RandR");
+
+ if(!XQuartzIsRootless)
+ QuartzShowFullscreen(FALSE);
+
+ switch(NSRunAlertPanel(title, msg, NSLocalizedString(@"Allow", @""), NSLocalizedString (@"Cancel", @""), NSLocalizedString (@"Always Allow", @""))) {
+ case NSAlertOtherReturn:
+ [X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES];
+ [X11App prefs_synchronize];
+ case NSAlertDefaultReturn:
+ return YES;
+
+ default:
+ return NO;
+ }
+}
+
static void check_xinitrc (void) {
char *tem, buf[1024];
NSString *msg;
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 0e98218be..4ecf8e49b 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.6.1</string>
+ <string>2.6.2</string>
<key>CFBundleVersion</key>
- <string>2.6.1</string>
+ <string>2.6.2</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
diff --git a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
index 03415026e..bf2089ca1 100644
--- a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
+++ b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
Binary files differ
diff --git a/hw/xquartz/pbproxy/x-selection.h b/hw/xquartz/pbproxy/x-selection.h
index 614c8b091..d4a39e58f 100644
--- a/hw/xquartz/pbproxy/x-selection.h
+++ b/hw/xquartz/pbproxy/x-selection.h
@@ -33,7 +33,9 @@
#include "pbproxy.h"
+#define Cursor X_Cursor
#include <X11/extensions/Xfixes.h>
+#undef Cursor
#include <AppKit/NSPasteboard.h>
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 222a5eab0..11e5a74d7 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -82,6 +82,8 @@ Bool XQuartzIsRootless = TRUE;
Bool XQuartzServerVisible = FALSE;
Bool XQuartzFullscreenMenu = FALSE;
+int32_t XQuartzShieldingWindowLevel = 0;
+
/*
===========================================================================
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index b83391db9..67a7919b2 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -124,6 +124,8 @@ extern Bool XQuartzFullscreenMenu; /* Show the menu bar (autohide) while in FS
extern Bool XQuartzFullscreenDisableHotkeys;
extern Bool XQuartzOptionSendsAlt; /* Alt or Mode_switch? */
+extern int32_t XQuartzShieldingWindowLevel; /* CGShieldingWindowLevel() or 0 */
+
Bool QuartzAddScreen(int index, ScreenPtr pScreen);
Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
void QuartzInitOutput(int argc,char **argv);
diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index 296f9b669..05641a65d 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -40,6 +40,8 @@
#include "quartz.h"
#include "darwin.h"
+#include "X11Application.h"
+
#include <AvailabilityMacros.h>
#include <X11/extensions/randr.h>
@@ -346,6 +348,16 @@ static int QuartzRandRRegisterModeCallback (ScreenPtr pScreen,
static Bool QuartzRandRSetMode(ScreenPtr pScreen, QuartzModeInfoPtr pMode, BOOL doRegister) {
QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0];
+ Bool captureDisplay = (pMode->refresh != FAKE_REFRESH_FULLSCREEN && pMode->refresh != FAKE_REFRESH_ROOTLESS);
+
+ if(XQuartzShieldingWindowLevel == 0 && captureDisplay) {
+ if(!X11ApplicationCanEnterRandR())
+ return FALSE;
+ CGCaptureAllDisplays();
+ XQuartzShieldingWindowLevel = CGShieldingWindowLevel(); // 2147483630
+ DEBUG_LOG("Display captured. ShieldWindowID: %u, Shield level: %d\n",
+ CGShieldingWindowID(screenId), XQuartzShieldingWindowLevel);
+ }
if (pQuartzScreen->currentMode.ref && CFEqual(pMode->ref, pQuartzScreen->currentMode.ref)) {
DEBUG_LOG("Requested RandR resolution matches current CG mode\n");
@@ -369,6 +381,11 @@ static Bool QuartzRandRSetMode(ScreenPtr pScreen, QuartzModeInfoPtr pMode, BOOL
pQuartzScreen->currentMode = *pMode;
CFRetain(pQuartzScreen->currentMode.ref);
+ if(XQuartzShieldingWindowLevel != 0 && !captureDisplay) {
+ CGReleaseAllDisplays();
+ XQuartzShieldingWindowLevel = 0;
+ }
+
return TRUE;
}
@@ -396,16 +413,6 @@ static Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
if (pQuartzScreen->displayCount == 0)
return FALSE;
- if (pQuartzScreen->displayCount > 1) {
- /* RandR operations are not well-defined for an X11 screen spanning
- multiple CG displays. Create two entries for the current virtual
- resolution including/excluding the menu bar. */
-
- QuartzRandRRegisterMode(pScreen, &pQuartzScreen->rootlessMode);
- QuartzRandRRegisterMode(pScreen, &pQuartzScreen->fullscreenMode);
- return TRUE;
- }
-
return QuartzRandREnumerateModes(pScreen, QuartzRandRRegisterModeCallback, NULL);
}
diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c
index 1a3d427b7..21e6f98fa 100644
--- a/hw/xquartz/xpr/xprAppleWM.c
+++ b/hw/xquartz/xpr/xprAppleWM.c
@@ -69,6 +69,8 @@ static int xprSetWindowLevel(
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[level];
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 8ee3a28a6..15598e942 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -173,6 +173,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[pFrame->level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[pFrame->level];
mask |= XP_WINDOW_LEVEL;
@@ -287,6 +289,8 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
if(winRec) {
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[winRec->level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[winRec->level];
mask |= XP_WINDOW_LEVEL;
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index cba358f8b..972278b75 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -196,6 +196,13 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height, ScreenPtr pScr
return;
}
+ /* If the displays are captured, we are in a RandR game mode
+ * on the primary display, so we only want to include the first
+ * display. The others are covered by the shield window.
+ */
+ if (CGDisplayIsCaptured(kCGDirectMainDisplay))
+ displayCount = 1;
+
displayList = malloc(displayCount * sizeof(CGDirectDisplayID));
if(!displayList)
FatalError("Unable to allocate memory for list of displays.\n");
@@ -292,9 +299,34 @@ xprAddScreen(int index, ScreenPtr pScreen)
DEBUG_LOG("index=%d depth=%d\n", index, depth);
if(depth == -1) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+#else
+ CGDisplayModeRef modeRef;
+ CFStringRef encStrRef;
+
+ modeRef = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
+ if(!modeRef)
+ goto have_depth;
+
+ encStrRef = CGDisplayModeCopyPixelEncoding(modeRef);
+ CFRelease(modeRef);
+ if(!encStrRef)
+ goto have_depth;
+
+ if(CFStringCompare(encStrRef, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 24;
+ } else if(CFStringCompare(encStrRef, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 15;
+ } else if(CFStringCompare(encStrRef, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 8;
+ }
+
+ CFRelease(encStrRef);
+#endif
}
+have_depth:
switch(depth) {
case 8: // pseudo-working
dfb->visuals = PseudoColorMask;
@@ -319,7 +351,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
// case 24:
default:
if(depth != 24)
- ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay));
+ ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d)\n", depth, darwinDesiredDepth);
dfb->visuals = TrueColorMask; //LARGE_VISUALS;
dfb->preferredCVC = TrueColor;
dfb->depth = 24;
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 6ab9e11d0..367dbb78b 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -441,6 +441,9 @@
/* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS
+/* If the compiler supports a TLS storage class define it to that here */
+#undef TLS
+
/* Correctly set _XSERVER64 for OSX fat binaries */
#ifdef __APPLE__
#include "dix-config-apple-verbatim.h"
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 9f1507e8e..34ef5745e 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -447,6 +447,11 @@ extern _X_EXPORT void XkbFreeKeyboard(
Bool /* freeDesc */
);
+extern _X_EXPORT void XkbFreeComponentNames(
+ XkbComponentNamesPtr /* names */,
+ Bool /* freeNames */
+);
+
extern _X_EXPORT void XkbSetActionKeyMods(
XkbDescPtr /* xkb */,
XkbAction * /* act */,
diff --git a/mi/micmap.c b/mi/micmap.c
index 41e03006e..7448ef8fd 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -564,6 +564,8 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
{
vid = malloc(nvtype * sizeof (VisualID));
if (!vid) {
+ free(depth);
+ free(visual);
free(preferredCVCs);
return FALSE;
}
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 48feb8823..5a87fa2ba 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -397,7 +397,6 @@ Bool
miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
int x, int y, unsigned long source, unsigned long mask)
{
- miDCScreenPtr pScreenPriv;
miDCCursorPtr pPriv;
miDCBufferPtr pBuffer;
WindowPtr pWin;
@@ -410,8 +409,7 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
if (!pPriv)
return FALSE;
}
- pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miDCScreenKey);
+
pWin = pScreen->root;
pBuffer = miGetDCDevice(pDev, pScreen);
@@ -444,14 +442,11 @@ Bool
miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h)
{
- miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
- pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miDCScreenKey);
pBuffer = miGetDCDevice(pDev, pScreen);
pSave = pBuffer->pSave;
@@ -478,14 +473,11 @@ Bool
miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h)
{
- miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
- pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
- miDCScreenKey);
pBuffer = miGetDCDevice(pDev, pScreen);
pSave = pBuffer->pSave;
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 554397a3b..ca0bae51b 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -512,7 +512,6 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
pScreen = newScreen;
(*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen,
FALSE);
- pScreenPriv = GetScreenPrivate (pScreen);
/* Smash the confine to the new screen */
pPointer->limits.x2 = pScreen->width;
pPointer->limits.y2 = pScreen->height;
diff --git a/mi/mispans.c b/mi/mispans.c
index 53539e515..21ba4da4f 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -458,6 +458,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
}
free(yspans);
free(ysizes);
+ free(newpoints);
+ free(newwidths);
miDisposeSpanGroup (spanGroup);
return;
}
diff --git a/mi/mizerline.c b/mi/mizerline.c
index 07cfbe113..7077b5198 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -157,9 +157,11 @@ miZeroLine(
list_len = (height >= width) ? height : width;
pspanInit = malloc(list_len * sizeof(DDXPointRec));
pwidthInit = malloc(list_len * sizeof(int));
- if (!pspanInit || !pwidthInit)
+ if (!pspanInit || !pwidthInit) {
+ free(pspanInit);
+ free(pwidthInit);
return;
-
+ }
Nspans = 0;
new_span = TRUE;
spans = pspanInit - 1;
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 566995c41..0fe1fb603 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -89,7 +89,11 @@ getDrawableDamageRef (DrawablePtr pDrawable)
ScreenPtr pScreen = pDrawable->pScreen;
pPixmap = 0;
- if (pScreen->GetWindowPixmap)
+ if (pScreen->GetWindowPixmap
+#ifdef ROOTLESS_WORKAROUND
+ && ((WindowPtr)pDrawable)->viewable
+#endif
+ )
pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable);
if (!pPixmap)
diff --git a/os/utils.c b/os/utils.c
index 3dfa8a43b..9d39f7016 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1280,10 +1280,7 @@ System(char *command)
perror("signal");
return -1;
}
-
-#ifdef DEBUG
- ErrorF("System: `%s'\n", command);
-#endif
+ DebugF("System: `%s'\n", command);
switch (pid = fork()) {
case -1: /* error */
@@ -1342,6 +1339,9 @@ Popen(char *command, char *type)
/* Ignore the smart scheduler while this is going on */
old_alarm = OsSignal(SIGALRM, SIG_IGN);
if (old_alarm == SIG_ERR) {
+ close(pdes[0]);
+ close(pdes[1]);
+ free(cur);
perror("signal");
return NULL;
}
@@ -1395,9 +1395,7 @@ Popen(char *command, char *type)
cur->next = pidlist;
pidlist = cur;
-#ifdef DEBUG
- ErrorF("Popen: `%s', fp = %p\n", command, iop);
-#endif
+ DebugF("Popen: `%s', fp = %p\n", command, iop);
return iop;
}
@@ -1472,9 +1470,7 @@ Fopen(char *file, char *type)
cur->next = pidlist;
pidlist = cur;
-#ifdef DEBUG
- ErrorF("Fopen(%s), fp = %p\n", file, iop);
-#endif
+ DebugF("Fopen(%s), fp = %p\n", file, iop);
return iop;
#else
@@ -1503,10 +1499,7 @@ Pclose(pointer iop)
int pstat;
int pid;
-#ifdef DEBUG
- ErrorF("Pclose: fp = %p\n", iop);
-#endif
-
+ DebugF("Pclose: fp = %p\n", iop);
fclose(iop);
for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next)
diff --git a/render/render.c b/render/render.c
index 702955818..50f809c65 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1372,8 +1372,10 @@ ProcRenderCompositeGlyphs (ClientPtr client)
else
{
listsBase = (GlyphListPtr) malloc(nlist * sizeof (GlyphListRec));
- if (!listsBase)
- return BadAlloc;
+ if (!listsBase) {
+ rc = BadAlloc;
+ goto bail;
+ }
}
buffer = (CARD8 *) (stuff + 1);
glyphs = glyphsBase;
@@ -1392,13 +1394,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
GlyphSetType, client,
DixUseAccess);
if (rc != Success)
- {
- if (glyphsBase != glyphsLocal)
- free(glyphsBase);
- if (listsBase != listsLocal)
- free(listsBase);
- return rc;
- }
+ goto bail;
}
buffer += 4;
}
@@ -1436,8 +1432,10 @@ ProcRenderCompositeGlyphs (ClientPtr client)
lists++;
}
}
- if (buffer > end)
- return BadLength;
+ if (buffer > end) {
+ rc = BadLength;
+ goto bail;
+ }
CompositeGlyphs (stuff->op,
pSrc,
@@ -1448,13 +1446,14 @@ ProcRenderCompositeGlyphs (ClientPtr client)
nlist,
listsBase,
glyphsBase);
+ rc = Success;
+bail:
if (glyphsBase != glyphsLocal)
free(glyphsBase);
if (listsBase != listsLocal)
free(listsBase);
-
- return Success;
+ return rc;
}
static int
diff --git a/xfixes/region.c b/xfixes/region.c
index 81ead4d1c..f49349629 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -757,13 +757,11 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
PicturePtr pPicture;
RegionPtr pRegion;
ScreenPtr pScreen;
- PictureScreenPtr ps;
REQUEST(xXFixesSetPictureClipRegionReq);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
pScreen = pPicture->pDrawable->pScreen;
- ps = GetPictureScreen (pScreen);
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin,
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
index bffd60fce..b70ac1705 100644
--- a/xkb/XKBAlloc.c
+++ b/xkb/XKBAlloc.c
@@ -333,3 +333,22 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
free(xkb);
return;
}
+
+
+/***====================================================================***/
+
+void
+XkbFreeComponentNames(XkbComponentNamesPtr names, Bool freeNames)
+{
+ if (names)
+ {
+ free(names->keycodes);
+ free(names->types);
+ free(names->compat);
+ free(names->symbols);
+ free(names->geometry);
+ memset(names, 0, sizeof(XkbComponentNamesRec));
+ }
+ if (freeNames)
+ free(names);
+}
diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index 3ec9edab8..f49aead02 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -659,11 +659,11 @@ register XkbPropertyPtr prop;
}
prop= &geom->properties[geom->num_properties];
prop->name= malloc(strlen(name)+1);
- if (!name)
+ if (!prop->name)
return NULL;
strcpy(prop->name,name);
prop->value= malloc(strlen(value)+1);
- if (!value) {
+ if (!prop->value) {
free(prop->name);
prop->name= NULL;
return NULL;
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 9623cb6aa..3d301d88e 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -222,8 +222,10 @@ char tmpname[PATH_MAX];
list->nFound[what]= 0;
free(buf);
buf = malloc(PATH_MAX * sizeof(char));
- if (!buf)
+ if (!buf) {
+ fclose(in);
return BadAlloc;
+ }
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
unsigned flags;
register unsigned int i;
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index ac587fc9d..a93569846 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -446,23 +446,23 @@ XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbComponentNamesPtr kccg
static XkbDescPtr
XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, int need)
{
- XkbDescPtr xkb;
+ XkbDescPtr xkb = NULL;
unsigned int provided;
- XkbComponentNamesRec kccgst;
+ XkbComponentNamesRec kccgst = {0};
char name[PATH_MAX];
- if (!XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst))
- return NULL;
-
- provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need,
- &xkb, name, PATH_MAX);
- if ((need & provided) != need) {
- if (xkb) {
- XkbFreeKeyboard(xkb, 0, TRUE);
- xkb = NULL;
+ if (XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) {
+ provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need,
+ &xkb, name, PATH_MAX);
+ if ((need & provided) != need) {
+ if (xkb) {
+ XkbFreeKeyboard(xkb, 0, TRUE);
+ xkb = NULL;
+ }
}
}
+ XkbFreeComponentNames(&kccgst, FALSE);
return xkb;
}
diff --git a/xkb/xkb.c b/xkb/xkb.c
index a57139f35..a8d0e801c 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -4310,7 +4310,7 @@ ProcXkbSetNames(ClientPtr client)
static char *
XkbWriteCountedString(char *wire,char *str,Bool swap)
{
- CARD16 len,*pLen;
+ CARD16 len,*pLen, paddedLen;
if (!str)
return wire;
@@ -4322,8 +4322,9 @@ XkbWriteCountedString(char *wire,char *str,Bool swap)
register int n;
swaps(pLen,n);
}
- memcpy(&wire[2],str,len);
- wire+= ((2+len+3)/4)*4;
+ paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len);
+ strncpy(&wire[sizeof(len)],str,paddedLen);
+ wire+= sizeof(len)+paddedLen;
return wire;
}
@@ -4434,6 +4435,7 @@ xkbShapeWireDesc * shapeWire;
if (shape->approx!=NULL)
shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx);
else shapeWire->approxNdx= XkbNoShape;
+ shapeWire->pad= 0;
if (swap) {
register int n;
swapl(&shapeWire->name,n);
@@ -4446,6 +4448,7 @@ xkbShapeWireDesc * shapeWire;
olWire= (xkbOutlineWireDesc *)wire;
olWire->nPoints= ol->num_points;
olWire->cornerRadius= ol->corner_radius;
+ olWire->pad= 0;
wire= (char *)&olWire[1];
ptWire= (xkbPointWireDesc *)wire;
for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) {
@@ -4559,6 +4562,8 @@ xkbOverlayWireDesc * olWire;
olWire= (xkbOverlayWireDesc *)wire;
olWire->name= ol->name;
olWire->nRows= ol->num_rows;
+ olWire->pad1= 0;
+ olWire->pad2= 0;
if (swap) {
register int n;
swapl(&olWire->name,n);
@@ -4571,6 +4576,7 @@ xkbOverlayWireDesc * olWire;
rowWire= (xkbOverlayRowWireDesc *)wire;
rowWire->rowUnder= row->row_under;
rowWire->nKeys= row->num_keys;
+ rowWire->pad1= 0;
wire= (char *)&rowWire[1];
for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
xkbOverlayKeyWireDesc * keyWire;
@@ -5897,16 +5903,7 @@ ProcXkbGetKbdByName(ClientPtr client)
XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE);
new= NULL;
}
- free(names.keycodes);
- names.keycodes = NULL;
- free(names.types);
- names.types = NULL;
- free(names.compat);
- names.compat = NULL;
- free(names.symbols);
- names.symbols = NULL;
- free(names.geometry);
- names.geometry = NULL;
+ XkbFreeComponentNames(&names, FALSE);
return Success;
}
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 8d7c124e8..8c0c2699f 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -68,20 +68,13 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
Bool
XkbInitPrivates(void)
{
- return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, 0);
+ return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec));
}
void
XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
{
- xkbDeviceInfoPtr xkbPrivPtr;
-
- xkbPrivPtr = (xkbDeviceInfoPtr) calloc(1, sizeof(xkbDeviceInfoRec));
- if (!xkbPrivPtr)
- return;
- xkbPrivPtr->unwrapProc = NULL;
-
- dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr);
+ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc);
}