diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-05 16:19:17 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-05 16:19:17 +0000 |
commit | faf5808b8f86976e6c2998ecf5dacd9c321e54c3 (patch) | |
tree | 1fa73da2fdba557a2b96ab1d7495ab92de39e32b | |
parent | fb4ad2f0df4181091a13f645665c7b1984a28944 (diff) | |
parent | c68a84e73d1ebb2f75cdc4c3d8576a15b31ab3f7 (diff) |
Merge commit 'xorg-server-1.11.2' into cygwin-release-1.11
-rw-r--r-- | Xext/shm.c | 6 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 13 | ||||
-rw-r--r-- | composite/compalloc.c | 11 | ||||
-rw-r--r-- | config/udev.c | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | dix/dispatch.c | 1 | ||||
-rw-r--r-- | dix/dixfonts.c | 30 | ||||
-rw-r--r-- | dix/events.c | 18 | ||||
-rw-r--r-- | dix/grabs.c | 2 | ||||
-rw-r--r-- | fb/fbpict.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Events.c | 9 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 26 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_init.c | 14 | ||||
-rw-r--r-- | hw/xnest/Keyboard.c | 25 | ||||
-rw-r--r-- | hw/xquartz/X11Application.m | 2 | ||||
-rw-r--r-- | hw/xquartz/applewm.c | 4 | ||||
-rw-r--r-- | hw/xquartz/pbproxy/Makefile.am | 1 | ||||
-rw-r--r-- | hw/xquartz/xpr/appledri.c | 153 | ||||
-rw-r--r-- | hw/xwin/winwindowswm.c | 4 | ||||
-rw-r--r-- | os/utils.c | 4 | ||||
-rw-r--r-- | test/input.c | 2 | ||||
-rw-r--r-- | xkb/xkb.c | 3 |
22 files changed, 263 insertions, 75 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index b08af821b..4141a8fe6 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -991,7 +991,6 @@ CreatePmap: pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) { - (*pScreen->DestroyPixmap)(pMap); result = BadAlloc; break; } @@ -1002,10 +1001,8 @@ CreatePmap: } if(result == BadAlloc) { - while(j--) { - (*pScreen->DestroyPixmap)(pMap); + while(j--) FreeResource(newPix->info[j].id, RT_NONE); - } free(newPix); } else AddResource(stuff->pid, XRT_PIXMAP, newPix); @@ -1110,7 +1107,6 @@ CreatePmap: { return Success; } - pDraw->pScreen->DestroyPixmap(pMap); } return BadAlloc; } diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index ae4343344..5cdd8aca6 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -261,9 +261,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client) REQUEST(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); - if (rc != Success) - return rc; + if (stuff->deviceid == XIAllDevices) + dev = inputInfo.all_devices; + else if (stuff->deviceid == XIAllMasterDevices) + dev = inputInfo.all_master_devices; + else + { + rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); + if (rc != Success) + return rc; + } if (stuff->grab_type != XIGrabtypeButton && stuff->grab_type != XIGrabtypeKeycode && diff --git a/composite/compalloc.c b/composite/compalloc.c index f00bf4eb0..9857a92b2 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -196,11 +196,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) anyMarked = compMarkWindows (pWin, &pLayerWin); - /* Make sure our borderClip is correct for ValidateTree */ RegionNull(&cw->borderClip); - RegionCopy(&cw->borderClip, &pWin->borderClip); - cw->borderClipX = pWin->drawable.x; - cw->borderClipY = pWin->drawable.y; cw->update = CompositeRedirectAutomatic; cw->clients = 0; cw->oldx = COMP_ORIGIN_INVALID; @@ -658,6 +654,13 @@ compAllocPixmap (WindowPtr pWin) DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; } + + /* Make sure our borderClip is up to date */ + RegionUninit(&cw->borderClip); + RegionCopy(&cw->borderClip, &pWin->borderClip); + cw->borderClipX = pWin->drawable.x; + cw->borderClipY = pWin->drawable.y; + return TRUE; } diff --git a/config/udev.c b/config/udev.c index e7383dc36..42713e92d 100644 --- a/config/udev.c +++ b/config/udev.c @@ -114,7 +114,7 @@ device_added(struct udev_device *udev_device) == -1) attrs.usb_id = NULL; else - LOG_PROPERTY(path, "PRODUCT", product); + LOG_PROPERTY(ppath, "PRODUCT", product); } } if (!name) diff --git a/configure.ac b/configure.ac index b30bdff67..61dd3850e 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.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2011-09-24" +AC_INIT([xorg-server], 1.11.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2011-11-04" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE diff --git a/dix/dispatch.c b/dix/dispatch.c index c2e5b043b..c17f42563 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1425,7 +1425,6 @@ CreatePmap: } if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap)) return Success; - (*pDraw->pScreen->DestroyPixmap)(pMap); } return BadAlloc; } diff --git a/dix/dixfonts.c b/dix/dixfonts.c index fbac124da..d2bcb84ea 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1302,31 +1302,30 @@ doPolyText(ClientPtr client, PTclosurePtr c) goto bail; } *new_closure = *c; - c = new_closure; - len = c->endReq - c->pElt; - c->data = malloc(len); - if (!c->data) + len = new_closure->endReq - new_closure->pElt; + new_closure->data = malloc(len); + if (!new_closure->data) { - free(c); + free(new_closure); err = BadAlloc; goto bail; } - memmove(c->data, c->pElt, len); - c->pElt = c->data; - c->endReq = c->pElt + len; + memmove(new_closure->data, new_closure->pElt, len); + new_closure->pElt = new_closure->data; + new_closure->endReq = new_closure->pElt + len; /* Step 2 */ - pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen); + pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen); if (!pGC) { - free(c->data); - free(c); + free(new_closure->data); + free(new_closure); err = BadAlloc; goto bail; } - if ((err = CopyGC(c->pGC, pGC, GCFunction | + if ((err = CopyGC(new_closure->pGC, pGC, GCFunction | GCPlaneMask | GCForeground | GCBackground | GCFillStyle | GCTile | GCStipple | @@ -1337,15 +1336,16 @@ doPolyText(ClientPtr client, PTclosurePtr c) Success) { FreeScratchGC(pGC); - free(c->data); - free(c); + free(new_closure->data); + free(new_closure); err = BadAlloc; goto bail; } + c = new_closure; origGC = c->pGC; c->pGC = pGC; ValidateGC(c->pDraw, c->pGC); - + ClientSleep(client, (ClientSleepProcPtr)doPolyText, c); /* Set up to perform steps 3 and 4 */ diff --git a/dix/events.c b/dix/events.c index 8a4c6b9ac..8e7f9c324 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3678,7 +3678,7 @@ CheckPassiveGrabsOnWindow( if (tempGrab.type < GenericEvent) { grab->device = device; - grab->modifierDevice = GetPairedDevice(device); + grab->modifierDevice = GetMaster(device, MASTER_KEYBOARD); } for (other = inputInfo.devices; other; other = other->next) @@ -5224,6 +5224,8 @@ CloseDownEvents(void) InputEventList = NULL; } +#define SEND_EVENT_BIT 0x80 + /** * Server-side protocol handling for SendEvent request. * @@ -5241,6 +5243,16 @@ ProcSendEvent(ClientPtr client) REQUEST_SIZE_MATCH(xSendEventReq); + /* libXext and other extension libraries may set the bit indicating + * that this event came from a SendEvent request so remove it + * since otherwise the event type may fail the range checks + * and cause an invalid BadValue error to be returned. + * + * This is safe to do since we later add the SendEvent bit (0x80) + * back in once we send the event to the client */ + + stuff->event.u.u.type &= ~(SEND_EVENT_BIT); + /* The client's event type must be a core event type or one defined by an extension. */ @@ -5298,7 +5310,7 @@ ProcSendEvent(ClientPtr client) client->errorValue = stuff->propagate; return BadValue; } - stuff->event.u.u.type |= 0x80; + stuff->event.u.u.type |= SEND_EVENT_BIT; if (stuff->propagate) { for (;pWin; pWin = pWin->parent) @@ -5360,7 +5372,7 @@ ProcUngrabKey(ClientPtr client) tempGrab.window = pWin; tempGrab.modifiersDetail.exact = stuff->modifiers; tempGrab.modifiersDetail.pMask = NULL; - tempGrab.modifierDevice = GetPairedDevice(keybd); + tempGrab.modifierDevice = keybd; tempGrab.type = KeyPress; tempGrab.grabtype = GRABTYPE_CORE; tempGrab.detail.exact = stuff->key; diff --git a/dix/grabs.c b/dix/grabs.c index 85ca9eee0..c28356d9b 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -479,7 +479,7 @@ AddPassiveGrabToList(ClientPtr client, GrabPtr pGrab) for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) { - if (GrabMatchesSecond(pGrab, grab, FALSE)) + if (GrabMatchesSecond(pGrab, grab, (pGrab->grabtype == GRABTYPE_CORE))) { if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource)) { diff --git a/fb/fbpict.c b/fb/fbpict.c index d1fd0cbbd..57c93fd06 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -163,7 +163,9 @@ create_bits_picture (PicturePtr pict, (pixman_format_code_t)pict->format, pixmap->drawable.width, pixmap->drawable.height, (uint32_t *)bits, stride * sizeof (FbStride)); - + + if (!image) + return NULL; #ifdef FB_ACCESS_WRAPPER #if FB_SHIFT==5 diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index c4a4db9be..41ffabde3 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -601,16 +601,15 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) InputHandlerProc xf86SetConsoleHandler(InputHandlerProc proc, pointer data) { - static InputHandlerProc handler = NULL; - InputHandlerProc old_handler = handler; + static IHPtr handler = NULL; + IHPtr old_handler = handler; if (old_handler) xf86RemoveGeneralHandler(old_handler); - xf86AddGeneralHandler(xf86Info.consoleFd, proc, data); - handler = proc; + handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data); - return old_handler; + return (old_handler) ? old_handler->ihproc : NULL; } static void diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index c2814d4cd..d75cd770d 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -133,6 +133,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn, crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); if (!crtcs) { + free(crtc->gamma_red); free(crtc); return NULL; } @@ -2059,13 +2060,28 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, if (o == p) continue; - for (mode = output->probed_modes; mode; mode = mode->next) { - Rotation r = output->initial_rotation; - if (xf86ModeWidth(mode, r) == pref_width && - xf86ModeHeight(mode, r) == pref_height) { + /* + * First see if the preferred mode matches on the next + * output as well. This catches the common case of identical + * monitors and makes sure they all have the same timings + * and refresh. If that fails, we fall back to trying to + * match just width & height. + */ + mode = xf86OutputHasPreferredMode(output, pref_width, + pref_height); + if (mode && xf86ModesEqual(mode, preferred[p])) { preferred[o] = mode; match = TRUE; - } + } else { + for (mode = output->probed_modes; mode; + mode = mode->next) { + Rotation r = output->initial_rotation; + if (xf86ModeWidth(mode, r) == pref_width && + xf86ModeHeight(mode, r) == pref_height) { + preferred[o] = mode; + match = TRUE; + } + } } all_match &= match; diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 77dfb2f16..e098e1447 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -47,15 +47,12 @@ static char vtname[11]; static struct termios tty_attr; /* tty state to restore */ static int tty_mode; /* kbd mode to restore */ -static void *console_handler; - static void drain_console(int fd, void *closure) { errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { - xf86RemoveGeneralHandler(console_handler); - console_handler = NULL; + xf86SetConsoleHandler(NULL, NULL); } } @@ -259,10 +256,11 @@ xf86CloseConsole(void) return; } - if (console_handler) { - xf86RemoveGeneralHandler(console_handler); - console_handler = NULL; - }; + /* + * unregister the drain_console handler + * - what to do if someone else changed it in the meantime? + */ + xf86SetConsoleHandler(NULL, NULL); /* Back to text mode ... */ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index ec629dcaf..5ef376b91 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -114,11 +114,13 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) int xnestKeyboardProc(DeviceIntPtr pDev, int onoff) { + XModifierKeymap *modifier_keymap; KeySym *keymap; int mapWidth; int min_keycode, max_keycode; KeySymsRec keySyms; - int i; + CARD8 modmap[MAP_LENGTH]; + int i, j; XKeyboardState values; XkbDescPtr xkb; int op, event, error, major, minor; @@ -130,7 +132,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) #ifdef _XSERVER64 { KeySym64 *keymap64; - int i, len; + int len; keymap64 = XGetKeyboardMapping(xnestDisplay, min_keycode, max_keycode - min_keycode + 1, @@ -147,7 +149,17 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) max_keycode - min_keycode + 1, &mapWidth); #endif - + + memset(modmap, 0, sizeof(modmap)); + modifier_keymap = XGetModifierMapping(xnestDisplay); + for (j = 0; j < 8; j++) + for(i = 0; i < modifier_keymap->max_keypermod; i++) { + CARD8 keycode; + if ((keycode = modifier_keymap->modifiermap[j * modifier_keymap->max_keypermod + i])) + modmap[keycode] |= 1<<j; + } + XFreeModifiermap(modifier_keymap); + keySyms.minKeyCode = min_keycode; keySyms.maxKeyCode = max_keycode; keySyms.mapWidth = mapWidth; @@ -165,7 +177,12 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb); InitKeyboardDeviceStruct(pDev, NULL, - xnestBell, xnestChangeKeyboardControl); + xnestBell, xnestChangeKeyboardControl); + + XkbApplyMappingChange(pDev, &keySyms, keySyms.minKeyCode, + keySyms.maxKeyCode - keySyms.minKeyCode + 1, + modmap, serverClient); + XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbFreeKeyboard(xkb, 0, False); free(keymap); diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 7fd7dab3c..12ff53c88 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -356,7 +356,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) { */ _appFlags._active = YES; - X11ApplicationSetFrontProcess(); + [self set_front_process:nil]; /* Get the Spaces preference for SwitchOnActivate */ (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock")); diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 2f26e61d9..2dfc35a8e 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -727,10 +727,12 @@ AppleWMExtensionInit( NULL, StandardMinorOpcode))) { + size_t i; WMReqCode = (unsigned char)extEntry->base; WMErrorBase = extEntry->errorBase; WMEventBase = extEntry->eventBase; - EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; + for (i=0; i < AppleWMNumberEvents; i++) + EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent; appleWMProcs = procsPtr; } } diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am index b8b95d232..1b14dffce 100644 --- a/hw/xquartz/pbproxy/Makefile.am +++ b/hw/xquartz/pbproxy/Makefile.am @@ -2,6 +2,7 @@ AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Framework -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" AM_CFLAGS=$(XPBPROXY_CFLAGS) +AM_OBJCFLAGS=$(XPBPROXY_CFLAGS) noinst_LTLIBRARIES = libxpbproxy.la libxpbproxy_la_SOURCES = \ diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index ff70a381a..80955fe27 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -2,7 +2,7 @@ Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002, 2009 Apple Computer, Inc. +Copyright (c) 2002, 2009-2011 Apple Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -91,7 +91,6 @@ ProcAppleDRIQueryVersion( ) { xAppleDRIQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq); rep.type = X_Reply; @@ -101,8 +100,12 @@ ProcAppleDRIQueryVersion( rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION; rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION; if (client->swapped) { + register int n; swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); + swaps(&rep.majorVersion, n); + swaps(&rep.minorVersion, n); + swapl(&rep.patchVersion, n); } WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); return Success; @@ -134,6 +137,12 @@ ProcAppleDRIQueryDirectRenderingCapable( if (!LocalClient(client)) rep.isCapable = 0; + if (client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + WriteToClient(client, sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep); return Success; @@ -158,6 +167,14 @@ ProcAppleDRIAuthConnection( ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic); rep.authenticated = 0; } + + if (client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.authenticated, n); /* Yes, this is a CARD32 ... sigh */ + } + WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); return Success; } @@ -217,6 +234,15 @@ ProcAppleDRICreateSurface( rep.key_1 = key[1]; rep.uid = sid; + if (client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.key_0, n); + swapl(&rep.key_1, n); + swapl(&rep.uid, n); + } + WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); return Success; } @@ -278,9 +304,8 @@ ProcAppleDRICreatePixmap(ClientPtr client) rep.stringLength = strlen(path) + 1; - /* No need for swapping, because this only runs if LocalClient is true. */ rep.type = X_Reply; - rep.length = sizeof(rep) + rep.stringLength; + rep.length = bytes_to_int32(rep.stringLength); rep.sequenceNumber = client->sequence; rep.width = width; rep.height = height; @@ -291,8 +316,20 @@ ProcAppleDRICreatePixmap(ClientPtr client) if(sizeof(rep) != sz_xAppleDRICreatePixmapReply) ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); - WriteReplyToClient(client, sizeof(rep), &rep); - (void)WriteToClient(client, rep.stringLength, path); + if (client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.stringLength, n); + swapl(&rep.width, n); + swapl(&rep.height, n); + swapl(&rep.pitch, n); + swapl(&rep.bpp, n); + swapl(&rep.size, n); + } + + WriteToClient(client, sizeof(rep), &rep); + WriteToClient(client, rep.stringLength, path); return Success; } @@ -379,21 +416,113 @@ SProcAppleDRIQueryVersion( } static int +SProcAppleDRIQueryDirectRenderingCapable( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRIQueryDirectRenderingCapableReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + return ProcAppleDRIQueryDirectRenderingCapable(client); +} + +static int +SProcAppleDRIAuthConnection( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRIAuthConnectionReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + swapl(&stuff->magic, n); + return ProcAppleDRIAuthConnection(client); +} + +static int +SProcAppleDRICreateSurface( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRICreateSurfaceReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + swapl(&stuff->drawable, n); + swapl(&stuff->client_id, n); + return ProcAppleDRICreateSurface(client); +} + +static int +SProcAppleDRIDestroySurface( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRIDestroySurfaceReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + swapl(&stuff->drawable, n); + return ProcAppleDRIDestroySurface(client); +} + +static int +SProcAppleDRICreatePixmap( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRICreatePixmapReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + swapl(&stuff->drawable, n); + return ProcAppleDRICreatePixmap(client); +} + +static int +SProcAppleDRIDestroyPixmap( + register ClientPtr client +) +{ + register int n; + REQUEST(xAppleDRIDestroyPixmapReq); + swaps(&stuff->length, n); + swapl(&stuff->drawable, n); + return ProcAppleDRIDestroyPixmap(client); +} + +static int SProcAppleDRIDispatch ( register ClientPtr client ) { REQUEST(xReq); - /* It is bound to be non-local when there is byte swapping */ + switch (stuff->data) + { + case X_AppleDRIQueryVersion: + return SProcAppleDRIQueryVersion(client); + case X_AppleDRIQueryDirectRenderingCapable: + return SProcAppleDRIQueryDirectRenderingCapable(client); + } + if (!LocalClient(client)) return DRIErrorBase + AppleDRIClientNotLocal; - /* only local clients are allowed DRI access */ switch (stuff->data) { - case X_AppleDRIQueryVersion: - return SProcAppleDRIQueryVersion(client); + case X_AppleDRIAuthConnection: + return SProcAppleDRIAuthConnection(client); + case X_AppleDRICreateSurface: + return SProcAppleDRICreateSurface(client); + case X_AppleDRIDestroySurface: + return SProcAppleDRIDestroySurface(client); + case X_AppleDRICreatePixmap: + return SProcAppleDRICreatePixmap(client); + case X_AppleDRIDestroyPixmap: + return SProcAppleDRIDestroyPixmap(client); + default: return BadRequest; } @@ -412,9 +541,11 @@ AppleDRIExtensionInit(void) SProcAppleDRIDispatch, AppleDRIResetProc, StandardMinorOpcode))) { + size_t i; DRIReqCode = (unsigned char)extEntry->base; DRIErrorBase = extEntry->errorBase; DRIEventBase = extEntry->eventBase; - EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent; + for (i=0; i < AppleDRINumberEvents; i++) + EventSwapVector[DRIEventBase + i] = (EventSwapPtr) SNotifyEvent; } } diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 71384097f..f5d27e5d5 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -629,9 +629,11 @@ winWindowsWMExtensionInit (void) NULL, StandardMinorOpcode))) { + size_t i; WMReqCode = (unsigned char)extEntry->base; WMErrorBase = extEntry->errorBase; WMEventBase = extEntry->eventBase; - EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent; + for (i=0; i < WindowsWMNumberEvents; i++) + EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent; } } diff --git a/os/utils.c b/os/utils.c index f4b93ee57..f8c7178de 100644 --- a/os/utils.c +++ b/os/utils.c @@ -295,7 +295,7 @@ LockServer(void) FatalError("Could not create lock file in %s\n", tmp); (void) sprintf(pid_str, "%10ld\n", (long)getpid()); (void) write(lfd, pid_str, 11); - (void) chmod(tmp, 0444); + (void) fchmod(lfd, 0444); (void) close(lfd); /* @@ -316,7 +316,7 @@ LockServer(void) /* * Read the pid from the existing file */ - lfd = open(LockFile, O_RDONLY); + lfd = open(LockFile, O_RDONLY|O_NOFOLLOW); if (lfd < 0) { unlink(tmp); FatalError("Can't read lock file %s\n", LockFile); diff --git a/test/input.c b/test/input.c index 837ce49dc..6a0c523b8 100644 --- a/test/input.c +++ b/test/input.c @@ -1223,7 +1223,7 @@ static void dix_valuator_alloc(void) assert(v); assert(v->numAxes == num_axes); -#ifndef __i386__ +#if !defined(__i386__) && !defined(__sh__) /* must be double-aligned on 64 bit */ assert(((void*)v->axisVal - (void*)v) % sizeof(double) == 0); assert(((void*)v->axes - (void*)v) % sizeof(double) == 0); @@ -6240,6 +6240,9 @@ char * str; swaps(&rep.unsupported,n); swaps(&rep.nDeviceLedFBs,n); swapl(&rep.type,n); + swaps(&rep.dfltKbdFB, n); + swaps(&rep.dfltLedFB, n); + swapl(&rep.devType, n); } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); |