From 865af20e32591176d03acf984d9b5788d5ebce21 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 14 Jul 2010 06:40:19 +0000 Subject: xserver libxcb git update 14/7/2010 --- xorg-server/hw/xfree86/common/xf86VGAarbiter.c | 10 +- xorg-server/hw/xfree86/common/xf86cmap.c | 8 +- xorg-server/hw/xfree86/common/xf86xv.c | 8 ++ xorg-server/hw/xfree86/shadowfb/shadow.c | 11 +- xorg-server/hw/xfree86/xaa/xaaInit.c | 12 +- xorg-server/hw/xquartz/bundle/Info.plist.cpp | 94 +++++++-------- xorg-server/hw/xquartz/quartz.c | 4 - xorg-server/hw/xquartz/quartzCocoa.m | 153 ++++++++++++------------- xorg-server/hw/xquartz/quartzCommon.h | 15 --- xorg-server/hw/xquartz/xpr/xprCursor.c | 6 +- 10 files changed, 168 insertions(+), 153 deletions(-) (limited to 'xorg-server/hw') diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c index e5fd0fb85..d75b86502 100644 --- a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c +++ b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c @@ -523,12 +523,16 @@ static Bool VGAarbiterEnterVT(int index, int flags) { Bool val; + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( &pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(); - val = (*pScreenPriv->EnterVT)(index, flags); + pScrn->EnterVT = pScreenPriv->EnterVT; + val = (*pScrn->EnterVT)(index, flags); + pScreenPriv->EnterVT = pScrn->EnterVT; + pScrn->EnterVT = VGAarbiterEnterVT; VGAPut(); return val; } @@ -536,12 +540,16 @@ VGAarbiterEnterVT(int index, int flags) static void VGAarbiterLeaveVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate( &pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(); + pScrn->LeaveVT = pScreenPriv->LeaveVT; (*pScreenPriv->LeaveVT)(index, flags); + pScreenPriv->LeaveVT = pScrn->LeaveVT; + pScrn->LeaveVT = VGAarbiterLeaveVT; VGAPut(); } diff --git a/xorg-server/hw/xfree86/common/xf86cmap.c b/xorg-server/hw/xfree86/common/xf86cmap.c index 851843faa..191ae6132 100644 --- a/xorg-server/hw/xfree86/common/xf86cmap.c +++ b/xorg-server/hw/xfree86/common/xf86cmap.c @@ -466,11 +466,17 @@ CMapInstallColormap(ColormapPtr pmap) static Bool CMapEnterVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; + Bool ret; CMapScreenPtr pScreenPriv = (CMapScreenPtr)dixLookupPrivate( &pScreen->devPrivates, CMapScreenKey); - if((*pScreenPriv->EnterVT)(index, flags)) { + pScrn->EnterVT = pScreenPriv->EnterVT; + ret = (*pScreenPriv->EnterVT)(index, flags); + pScreenPriv->EnterVT = pScrn->EnterVT; + pScrn->EnterVT = CMapEnterVT; + if(ret) { if(GetInstalledmiColormap(pScreen)) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return TRUE; diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index 6dae62717..29c74f66e 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -1229,11 +1229,15 @@ xf86XVQueryAdaptors( static Bool xf86XVEnterVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); Bool ret; + pScrn->EnterVT = ScreenPriv->EnterVT; ret = (*ScreenPriv->EnterVT)(index, flags); + ScreenPriv->EnterVT = pScrn->EnterVT; + pScrn->EnterVT = xf86XVEnterVT; if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0); @@ -1243,6 +1247,7 @@ xf86XVEnterVT(int index, int flags) static void xf86XVLeaveVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); @@ -1274,7 +1279,10 @@ xf86XVLeaveVT(int index, int flags) } } + pScrn->LeaveVT = ScreenPriv->LeaveVT; (*ScreenPriv->LeaveVT)(index, flags); + ScreenPriv->LeaveVT = pScrn->LeaveVT; + pScrn->LeaveVT = xf86XVLeaveVT; } static void diff --git a/xorg-server/hw/xfree86/shadowfb/shadow.c b/xorg-server/hw/xfree86/shadowfb/shadow.c index 4c7551de9..20e70d6ce 100644 --- a/xorg-server/hw/xfree86/shadowfb/shadow.c +++ b/xorg-server/hw/xfree86/shadowfb/shadow.c @@ -216,9 +216,14 @@ static Bool ShadowEnterVT(int index, int flags) { ScrnInfoPtr pScrn = xf86Screens[index]; + Bool ret; ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); - if((*pPriv->EnterVT)(index, flags)) { + pScrn->EnterVT = pPriv->EnterVT; + ret = (*pPriv->EnterVT)(index, flags); + pPriv->EnterVT = pScrn->EnterVT; + pScrn->EnterVT = ShadowEnterVT; + if(ret) { pPriv->vtSema = TRUE; return TRUE; } @@ -229,11 +234,15 @@ ShadowEnterVT(int index, int flags) static void ShadowLeaveVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen); pPriv->vtSema = FALSE; + pScrn->LeaveVT = pPriv->LeaveVT; (*pPriv->LeaveVT)(index, flags); + pPriv->LeaveVT = pScrn->LeaveVT; + pScrn->LeaveVT = ShadowLeaveVT; } /**********************************************************/ diff --git a/xorg-server/hw/xfree86/xaa/xaaInit.c b/xorg-server/hw/xfree86/xaa/xaaInit.c index a4b235acf..ff1dd3d8b 100644 --- a/xorg-server/hw/xfree86/xaa/xaaInit.c +++ b/xorg-server/hw/xfree86/xaa/xaaInit.c @@ -508,16 +508,23 @@ XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask) static Bool XAAEnterVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; + Bool ret; ScreenPtr pScreen = screenInfo.screens[index]; XAAScreenPtr pScreenPriv = (XAAScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - return((*pScreenPriv->EnterVT)(index, flags)); + pScrn->EnterVT = pScreenPriv->EnterVT; + ret = ((*pScreenPriv->EnterVT)(index, flags)); + pScreenPriv->EnterVT = pScrn->EnterVT; + pScrn->EnterVT = XAAEnterVT; + return ret; } static void XAALeaveVT(int index, int flags) { + ScrnInfoPtr pScrn = xf86Screens[index]; ScreenPtr pScreen = screenInfo.screens[index]; XAAScreenPtr pScreenPriv = (XAAScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); @@ -528,7 +535,10 @@ XAALeaveVT(int index, int flags) infoRec->NeedToSync = FALSE; } + pScrn->LeaveVT = pScreenPriv->LeaveVT; (*pScreenPriv->LeaveVT)(index, flags); + pScreenPriv->LeaveVT = pScrn->LeaveVT; + pScrn->LeaveVT = XAALeaveVT; } typedef struct { diff --git a/xorg-server/hw/xquartz/bundle/Info.plist.cpp b/xorg-server/hw/xquartz/bundle/Info.plist.cpp index 91c8c0393..892eb5c19 100644 --- a/xorg-server/hw/xquartz/bundle/Info.plist.cpp +++ b/xorg-server/hw/xquartz/bundle/Info.plist.cpp @@ -1,47 +1,47 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - X11 - CFBundleGetInfoString - LAUNCHD_ID_PREFIX.X11 - CFBundleIconFile - X11.icns - CFBundleIdentifier - LAUNCHD_ID_PREFIX.X11 - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - APPLE_APPLICATION_NAME - CFBundlePackageType - APPL - CFBundleShortVersionString - 2.5.1 - CFBundleVersion - 2.5.1 - CFBundleSignature - x11a - CSResourcesFileMapped - -#ifdef XQUARTZ_SPARKLE - SUEnableAutomaticChecks - - SUPublicDSAKeyFile - sparkle.pem - SUFeedURL - http://xquartz.macosforge.org/downloads/sparkle/release.xml -#endif - NSHumanReadableCopyright - © 2003-2010 Apple Inc. -© 2003 XFree86 Project, Inc. -© 2003-2010 X.org Foundation, Inc. - - NSMainNibFile - main - NSPrincipalClass - X11Application - - + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + X11 + CFBundleGetInfoString + LAUNCHD_ID_PREFIX.X11 + CFBundleIconFile + X11.icns + CFBundleIdentifier + LAUNCHD_ID_PREFIX.X11 + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + APPLE_APPLICATION_NAME + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.6.0 + CFBundleVersion + 2.6.0 + CFBundleSignature + x11a + CSResourcesFileMapped + +#ifdef XQUARTZ_SPARKLE + SUEnableAutomaticChecks + + SUPublicDSAKeyFile + sparkle.pem + SUFeedURL + http://xquartz.macosforge.org/downloads/sparkle/release.xml +#endif + NSHumanReadableCopyright + © 2003-2010 Apple Inc. +© 2003 XFree86 Project, Inc. +© 2003-2010 X.org Foundation, Inc. + + NSMainNibFile + main + NSPrincipalClass + X11Application + + diff --git a/xorg-server/hw/xquartz/quartz.c b/xorg-server/hw/xquartz/quartz.c index c7a4d018a..de54290ab 100644 --- a/xorg-server/hw/xquartz/quartz.c +++ b/xorg-server/hw/xquartz/quartz.c @@ -67,12 +67,8 @@ #define FAKE_RANDR 1 // Shared global variables for Quartz modes -int quartzEventWriteFD = -1; int quartzUseSysBeep = 0; -int quartzUseAGL = 1; -int quartzEnableKeyEquivalents = 1; int quartzServerVisible = FALSE; -int quartzServerQuitting = FALSE; DevPrivateKeyRec quartzScreenKeyRec; int aquaMenuBarHeight = 0; QuartzModeProcsPtr quartzProcs = NULL; diff --git a/xorg-server/hw/xquartz/quartzCocoa.m b/xorg-server/hw/xquartz/quartzCocoa.m index 450147207..d1087015b 100644 --- a/xorg-server/hw/xquartz/quartzCocoa.m +++ b/xorg-server/hw/xquartz/quartzCocoa.m @@ -1,82 +1,71 @@ -/************************************************************** - * - * Quartz-specific support for the Darwin X Server - * that requires Cocoa and Objective-C. - * - * This file is separate from the parts of Quartz support - * that use X include files to avoid symbol collisions. - * - * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ - -#include "sanitizedCocoa.h" - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "quartzCommon.h" -#include "inputstr.h" - -#include "darwin.h" - -/* - * QuartzFSUseQDCursor - * Return whether the screen should use a QuickDraw cursor. - */ -int QuartzFSUseQDCursor( - int depth) // screen depth -{ - return TRUE; -} - - -/* - * QuartzBlockHandler - * Clean out any autoreleased objects. - */ -void QuartzBlockHandler( - pointer blockData, - OSTimePtr pTimeout, - pointer pReadmask) -{ - static NSAutoreleasePool *aPool = nil; - - [aPool release]; - aPool = [[NSAutoreleasePool alloc] init]; -} - - -/* - * QuartzWakeupHandler - */ -void QuartzWakeupHandler( - pointer blockData, - int result, - pointer pReadmask) -{ - // nothing here -} +/************************************************************** + * + * Quartz-specific support for the Darwin X Server + * that requires Cocoa and Objective-C. + * + * This file is separate from the parts of Quartz support + * that use X include files to avoid symbol collisions. + * + * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ + +#include "sanitizedCocoa.h" + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "quartzCommon.h" +#include "inputstr.h" + +#include "darwin.h" + +/* + * QuartzBlockHandler + * Clean out any autoreleased objects. + */ +void QuartzBlockHandler( + pointer blockData, + OSTimePtr pTimeout, + pointer pReadmask) +{ + static NSAutoreleasePool *aPool = nil; + + [aPool release]; + aPool = [[NSAutoreleasePool alloc] init]; +} + + +/* + * QuartzWakeupHandler + */ +void QuartzWakeupHandler( + pointer blockData, + int result, + pointer pReadmask) +{ + // nothing here +} diff --git a/xorg-server/hw/xquartz/quartzCommon.h b/xorg-server/hw/xquartz/quartzCommon.h index 12ed4057e..8c7b14faa 100644 --- a/xorg-server/hw/xquartz/quartzCommon.h +++ b/xorg-server/hw/xquartz/quartzCommon.h @@ -51,20 +51,13 @@ typedef struct { #define QUARTZ_PRIV(pScreen) \ ((QuartzScreenPtr)dixLookupPrivate(&pScreen->devPrivates, quartzScreenKey)) -// Data stored at startup for Cocoa front end -extern int quartzEventWriteFD; - // User preferences used by Quartz modes extern int quartzUseSysBeep; -extern int focusOnNewWindow; -extern int quartzUseAGL; -extern int quartzEnableKeyEquivalents; extern int quartzFullscreenDisableHotkeys; extern int quartzOptionSendsAlt; // Other shared data extern int quartzServerVisible; -extern int quartzServerQuitting; extern DevPrivateKeyRec quartzScreenKeyRec; #define quartzScreenKey (&quartzScreenKeyRec) extern int aquaMenuBarHeight; @@ -72,14 +65,6 @@ extern int aquaMenuBarHeight; // Name of GLX bundle for native OpenGL extern const char *quartzOpenGLBundle; -void QuartzReadPreferences(void); -void QuartzMessageMainThread(unsigned msg, void *data, unsigned length); -void QuartzMessageServerThread(int type, int argc, ...); -void QuartzSetWindowMenu(int nitems, const char **items, - const char *shortcuts); -void QuartzFSCapture(void); -void QuartzFSRelease(void); -int QuartzFSUseQDCursor(int depth); void QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); void QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask); diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c index 9c7890647..07dd5c8fb 100644 --- a/xorg-server/hw/xquartz/xpr/xprCursor.c +++ b/xorg-server/hw/xquartz/xpr/xprCursor.c @@ -67,6 +67,7 @@ static Bool load_cursor(CursorPtr src, int screen) { uint32_t *data; + Bool free_data = FALSE; uint32_t rowbytes; int width, height; int hot_x, hot_y; @@ -95,6 +96,7 @@ load_cursor(CursorPtr src, int screen) unsigned i; rowbytes = src->bits->width * sizeof (CARD32); data = malloc(rowbytes * src->bits->height); + free_data = TRUE; if(!data) { FatalError("Failed to allocate memory in %s\n", __func__); } @@ -121,6 +123,7 @@ load_cursor(CursorPtr src, int screen) /* round up to 8 pixel boundary so we can convert whole bytes */ rowbytes = ((src->bits->width * 4) + 31) & ~31; data = malloc(rowbytes * src->bits->height); + free_data = TRUE; if(!data) { FatalError("Failed to allocate memory in %s\n", __func__); } @@ -173,7 +176,8 @@ load_cursor(CursorPtr src, int screen) } err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes); - free(data); + if(free_data) + free(data); return err == Success; } -- cgit v1.2.3