[Xquartz-changes] xserver: Branch 'master' - 67 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sat Oct 30 16:26:43 PDT 2010


 Makefile.am                          |    2 
 composite/compalloc.c                |   42 ++++-
 configure.ac                         |   18 +-
 damageext/damageext.c                |    1 
 dix/devices.c                        |    2 
 dix/dispatch.c                       |   13 -
 dix/dixutils.c                       |    9 -
 dix/enterleave.c                     |   13 -
 dix/events.c                         |   76 ++++------
 dix/getevents.c                      |   24 ---
 fb/wfbrename.h                       |    2 
 hw/xfree86/common/xf86Config.c       |   54 -------
 hw/xfree86/common/xf86DGA.c          |    4 
 hw/xfree86/common/xf86Mode.c         |   64 +++++++-
 hw/xfree86/common/xf86Module.h       |    2 
 hw/xfree86/common/xf86Xinput.c       |   35 ++--
 hw/xfree86/common/xf86Xinput.h       |    2 
 hw/xfree86/ddc/ddc.c                 |    4 
 hw/xfree86/doc/man/xorg.conf.man.pre |    6 
 hw/xfree86/loader/loader.c           |    3 
 hw/xfree86/modes/xf86EdidModes.c     |    4 
 hw/xfree86/os-support/shared/sigio.c |    9 -
 hw/xfree86/parser/DRI.c              |   64 --------
 hw/xfree86/parser/scan.c             |   63 --------
 hw/xfree86/parser/xf86Parser.h       |   11 -
 hw/xfree86/parser/xf86tokens.h       |    1 
 hw/xfree86/vbe/vbe.c                 |   66 --------
 hw/xwin/InitInput.c                  |   15 -
 hw/xwin/InitOutput.c                 |   48 +-----
 hw/xwin/Makefile.am                  |    4 
 hw/xwin/XWin.man.pre                 |    8 -
 hw/xwin/win.h                        |   14 -
 hw/xwin/winblock.c                   |   10 -
 hw/xwin/winclipboardthread.c         |    2 
 hw/xwin/winclipboardxevents.c        |    6 
 hw/xwin/winconfig.c                  |   12 -
 hw/xwin/wincursor.c                  |    4 
 hw/xwin/windialogs.c                 |   26 ---
 hw/xwin/winengine.c                  |   24 ++-
 hw/xwin/winerror.c                   |   18 --
 hw/xwin/winfillsp.c                  |   35 ----
 hw/xwin/wingetsp.c                   |    8 -
 hw/xwin/winglobals.c                 |    8 -
 hw/xwin/winglobals.h                 |   88 +++++++++++
 hw/xwin/winkeybd.c                   |    2 
 hw/xwin/winkeyhook.c                 |    8 -
 hw/xwin/winlayouts.h                 |  266 +++++------------------------------
 hw/xwin/winmouse.c                   |   13 -
 hw/xwin/winmultiwindowicons.c        |    7 
 hw/xwin/winmultiwindowwindow.c       |   10 -
 hw/xwin/winmultiwindowwm.c           |    4 
 hw/xwin/winmultiwindowwndproc.c      |    9 -
 hw/xwin/winnativegdi.c               |    7 
 hw/xwin/winpfbdd.c                   |    8 -
 hw/xwin/winprefs.c                   |   11 -
 hw/xwin/winprefs.h                   |    3 
 hw/xwin/winprocarg.c                 |   26 ---
 hw/xwin/winscrinit.c                 |    8 -
 hw/xwin/winsetsp.c                   |    8 -
 hw/xwin/winshaddd.c                  |   57 -------
 hw/xwin/winshadddnl.c                |   55 -------
 hw/xwin/winshadgdi.c                 |   57 -------
 hw/xwin/winvalargs.c                 |    7 
 hw/xwin/winwakeup.c                  |   10 -
 hw/xwin/winwin32rootless.c           |    1 
 hw/xwin/winwin32rootlesswndproc.c    |    8 -
 hw/xwin/winwindowswm.c               |   82 +++++-----
 hw/xwin/winwndproc.c                 |   18 --
 include/callback.h                   |    9 +
 include/dix.h                        |    2 
 include/eventstr.h                   |    2 
 include/pixmap.h                     |    6 
 m4/dolt.m4                           |  181 -----------------------
 mi/mieq.c                            |    4 
 os/access.c                          |  137 +-----------------
 os/connection.c                      |   11 -
 os/xdmcp.c                           |    2 
 randr/Makefile.am                    |    1 
 randr/mirandr.c                      |  165 ---------------------
 randr/randr.c                        |    5 
 randr/randrstr.h                     |   55 ++-----
 randr/rrcrtc.c                       |   11 +
 randr/rrmode.c                       |   14 +
 randr/rroutput.c                     |   11 +
 test/Makefile.am                     |    3 
 xkb/xkb.c                            |   37 ++--
 86 files changed, 547 insertions(+), 1718 deletions(-)

New commits:
commit 80c1a7e042b91b304f4b2b63f827077cc086ffb2
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index e8f9473..35a6c52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,12 @@ AC_PROG_SED
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit 1a0d9324b3d9fd93e685066e0e5cea0611878c0d
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Sun Oct 17 09:58:50 2010 -0700

    Revert "Set DamageSetReportAfterOp to true for the damage extension" (#30260)
    
    This commit breaks the Compiz "Wallpaper" plugin.
    
    This reverts commit 8d7b7a0d71e0b89321b3341b781bc8845386def6.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/damageext/damageext.c b/damageext/damageext.c
index b4bb478..f5265dd 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -217,7 +217,6 @@ ProcDamageCreate (ClientPtr client)
     if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt))
 	return BadAlloc;
 
-    DamageSetReportAfterOp (pDamageExt->pDamage, TRUE);
     DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage);
 
     if (pDrawable->type == DRAWABLE_WINDOW)
commit d738175eaf1098e29b8afb6de8e99b5098e366a7
Merge: 8806a04... 9872e0f...
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Oct 19 22:50:15 2010 -0700

    Merge remote branch 'whot/for-keith'

commit 9872e0f0115cd7d0543e55a1831facddf3aff90c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Oct 13 10:31:51 2010 +1000

    xfree86: set mask for valuators 0/1 when emulating core events (#30267)
    
    EventToCore as of the commit below won't generate core motion events if the
    valuator mask for x/y isn't set. For DGA, we work around this check by
    forcibly setting the mask in the event we pass down.
    
    commit de8be07cc0a8163b6ef04455706fd5ca2cebe587
    Author: Peter Hutterer <peter.hutterer at who-t.net>
    Date:   Tue Aug 17 12:08:52 2010 +1000
    
        dix: don't create core motion events for non-x/y valuators.
    
    X.Org Bug 30267 <http://bugs.freedesktop.org/show_bug.cgi?id=30267>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Andrew Randrianasulu <randrik at mail.ru>
    Tested-by: Andy Furniss
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index c468c60..1058a46 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1133,6 +1133,10 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
             ev.root_x           = event->dx;
             ev.root_y           = event->dy;
             ev.corestate        = event->state;
+            /* DGA is core only, so valuators.data doesn't actually matter.
+             * Mask must be set for EventToCore to create motion events. */
+            SetBit(ev.valuators.mask, 0);
+            SetBit(ev.valuators.mask, 1);
 	    DeliverGrabbedEvent ((InternalEvent*)&ev, mouse, FALSE);
 	}
     }
commit 649293f6b634e6305b6737a841d6e9d0f0065d6c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Oct 11 16:09:18 2010 +1000

    xkb: always fill the symsPerKey array, regardless of client flags (#30527)
    
    Even if a client does not modify the symbols, symsPerKey and mapWidths must
    be filled from the current configuration. Both arrays are then passed into
    other functions (pending the right flag), thus they must contain valid
    values regardless of the XkbKeySymsMask flag in req->present.
    
    X.Org Bug 30527 <http://bugs.freedesktop.org/show_bug.cgi?id=30527>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 7d95bc0..bbb1d9d 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -1677,20 +1677,6 @@ xkbSymMapWireDesc*	wire = *wireRtrn;
     if (!(XkbKeySymsMask&req->present))
 	return 1;
     CHK_REQ_KEY_RANGE2(0x11,req->firstKeySym,req->nKeySyms,req,(*errorRtrn),0);
-    map = &xkb->map->key_sym_map[xkb->min_key_code];
-    for (i=xkb->min_key_code;i<(unsigned)req->firstKeySym;i++,map++) {
-	register int g,ng,w;
-	ng= XkbNumGroups(map->group_info);
-	for (w=g=0;g<ng;g++) {
-	    if (map->kt_index[g]>=(unsigned)nTypes) {
-		*errorRtrn = _XkbErrCode4(0x13,i,g,map->kt_index[g]);
-		return 0;
-	    }
-	    if (mapWidths[map->kt_index[g]]>w)
-		w= mapWidths[map->kt_index[g]];
-	}
-	symsPerKey[i] = w*ng;
-    }
     for (i=0;i<req->nKeySyms;i++) {
 	KeySym *pSyms;
 	register unsigned nG;
@@ -2345,6 +2331,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va
     int                 nTypes = 0, nActions;
     CARD8               mapWidths[XkbMaxLegalKeyCode + 1] = {0};
     CARD16              symsPerKey[XkbMaxLegalKeyCode + 1] = {0};
+    XkbSymMapPtr        map;
+    int                 i;
 
     xkbi= dev->key->xkbInfo;
     xkb = xkbi->desc;
@@ -2373,6 +2361,23 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va
 	client->errorValue = nTypes;
 	return BadValue;
     }
+
+    /* symsPerKey/mapWidths must be filled regardless of client-side flags */
+    map = &xkb->map->key_sym_map[xkb->min_key_code];
+    for (i=xkb->min_key_code;i<xkb->max_key_code;i++,map++) {
+	register int g,ng,w;
+	ng= XkbNumGroups(map->group_info);
+	for (w=g=0;g<ng;g++) {
+	    if (map->kt_index[g]>=(unsigned)nTypes) {
+		client->errorValue = _XkbErrCode4(0x13,i,g,map->kt_index[g]);
+		return 0;
+	    }
+	    if (mapWidths[map->kt_index[g]]>w)
+		w= mapWidths[map->kt_index[g]];
+	}
+	symsPerKey[i] = w*ng;
+    }
+
     if ((req->present & XkbKeySymsMask) &&
 	(!CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey,
 					(xkbSymMapWireDesc **)&values,&error))) {
commit ca21a266224b6eff4fd817c2082d2e144f1ea58c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Oct 11 15:38:38 2010 +1000

    xkb: init mapWidth and symsPerKey arrays to 0.
    
    Helps debugging greatly, random 8 or 16 bit values can sometimes look like
    valid values, causing much excitement on the client front.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 4105c1c..7d95bc0 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2343,8 +2343,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* va
     XkbDescPtr          xkb;
     int                 error;
     int                 nTypes = 0, nActions;
-    CARD8               mapWidths[XkbMaxLegalKeyCode + 1];
-    CARD16              symsPerKey[XkbMaxLegalKeyCode + 1];
+    CARD8               mapWidths[XkbMaxLegalKeyCode + 1] = {0};
+    CARD16              symsPerKey[XkbMaxLegalKeyCode + 1] = {0};
 
     xkbi= dev->key->xkbInfo;
     xkb = xkbi->desc;
commit 8806a04f7f028dd9f6a7ff5c36e460d3895c7deb
Author: Michał Górny <mgorny at gentoo.org>
Date:   Thu Oct 14 15:49:51 2010 +0200

    kdrive: Fix linking with tslib, with -Wl, --as-needed. #30600
    
    Change the library order in TSLIB_LIBS variable, placing ${TSLIB_LIBS}
    after the local static libraries. This fixes linking with
    -Wl,--as-needed.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30600
    Signed-off-by: Michał Górny <mgorny at gentoo.org>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 6d63663..e8f9473 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2122,7 +2122,7 @@ if test "$KDRIVE" = yes; then
     KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB"
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
-    KDRIVE_LIBS="$TSLIB_LIBS $KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS"
+    KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS"
 
     AC_SUBST([XEPHYR_LIBS])
     AC_SUBST([XEPHYR_INCS])
commit c7e436e9987a6fb0876c63e96f59ff4c20b4bef0
Author: Michał Górny <mgorny at gentoo.org>
Date:   Thu Oct 14 15:49:50 2010 +0200

    kdrive: Fix tslib check fallback to set TSLIB_LIBS. #30599
    
    If pkg-config is unable to find tslib but the fallback check does find
    it, the compilation continues with tslib support enabled though
    TSLIB_LIBS are unset. Thus, the compilation fails with a linking error
    on tslib functions.
    
    This patch sets TSLIB_LIBS to '-lts' whenever the tslib fallback check
    succeeds.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30599
    Signed-off-by: Michał Górny <mgorny at gentoo.org>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index c0bf98f..6d63663 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2034,7 +2034,10 @@ if test "$KDRIVE" = yes; then
 
     PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
     if test "x$HAVE_TSLIB" = xno; then
-        AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"])
+        AC_CHECK_LIB(ts, ts_open, [
+			HAVE_TSLIB="yes"
+			TSLIB_LIBS="-lts"
+		])
     fi
 
     if test "xTSLIB" = xauto; then
commit 25801a2556ca9b42646023e5a95a3cbf7309e852
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 14 22:38:17 2010 +0100

    Cygwin/X: Move duplicate extern variable declarations from various .c files to a new header file
    
    For the global variables defined in winglobals.c, remove duplicate extern
    declarations from the beginning of various .c files, and move most of them
    into a new header file, winglobals.h
    
    Leave some clipboard related variables alone for the moment, they need treating
    more carefully, to avoid mixing client and server type definitions.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index 0ffa940..e9a9b11 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -52,21 +52,6 @@ int winProcSetSelectionOwner(ClientPtr /* client */);
 DeviceIntPtr g_pwinPointer;
 DeviceIntPtr g_pwinKeyboard;
 
-
-/*
- * References to external symbols
- */
-
-#ifdef HAS_DEVWINDOWS
-extern int			g_fdMessageQueue;
-#endif
-extern Bool			g_fXdmcpEnabled;
-#ifdef XWIN_CLIPBOARD
-extern winDispatchProcPtr	winProcEstablishConnectionOrig;
-extern winDispatchProcPtr	winProcQueryTreeOrig;
-#endif
-
-
 /* Called from dix/devices.c */
 /*
  * All of our keys generate up and down transition notifications,
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index ae1d415..38a658d 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -58,29 +58,9 @@ typedef HRESULT (*SHGETFOLDERPATHPROC)(
 );
 #endif
 
-
 /*
  * References to external symbols
  */
-
-extern int			g_iNumScreens;
-extern winScreenInfo *		g_ScreenInfo;
-extern char *			g_pszCommandLine;
-extern Bool			g_fSilentFatalError;
-
-extern const char *		g_pszLogFile;
-extern Bool			g_fLogFileChanged;
-extern int			g_iLogVerbose;
-Bool				g_fLogInited;
-
-extern Bool			g_fXdmcpEnabled;
-extern Bool			g_fAuthEnabled;
-#ifdef HAS_DEVWINDOWS
-extern int			g_fdMessageQueue;
-#endif
-extern const char *		g_pszQueryHost;
-extern HINSTANCE		g_hInstance;
-
 #ifdef XWIN_CLIPBOARD
 extern Bool			g_fUnicodeClipboard;
 extern Bool			g_fClipboardLaunched;
@@ -91,11 +71,6 @@ extern Bool			g_fClipboard;
 #endif
 
 
-extern FARPROC			g_fpTrackMouseEvent;
-extern Bool			g_fNoHelpMessageBox;                     
-extern Bool			g_fSilentDupError;                     
-extern Bool                     g_fNativeGl;
-
 /*
   module handle for dynamically loaded comctl32 library
 */
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 4d6771c..f22a2d5 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -314,9 +314,6 @@ typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
 
 typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr);
 
-/* Typedef for DIX wrapper functions */
-typedef int (*winDispatchProcPtr) (ClientPtr);
-
 
 /*
  * GC (graphics context) privates
@@ -622,6 +619,8 @@ typedef struct {
  * Extern declares for general global variables
  */
 
+#include "winglobals.h"
+
 extern winScreenInfo *		g_ScreenInfo;
 extern miPointerScreenFuncRec	g_winPointerCursorFuncs;
 extern DWORD			g_dwEvents;
@@ -648,14 +647,12 @@ extern const char *		g_pszQueryHost;
 extern DeviceIntPtr             g_pwinPointer;
 extern DeviceIntPtr             g_pwinKeyboard;
 
-
 /*
- * Extern declares for dynamically loaded libraries and function pointers
+ * Extern declares for dynamically loaded library function pointers
  */
 
 extern FARPROC			g_fpDirectDrawCreate;
 extern FARPROC			g_fpDirectDrawCreateClipper;
-
 extern FARPROC			g_fpTrackMouseEvent;
 
 
diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
index abea60e..e165d54 100644
--- a/hw/xwin/winblock.c
+++ b/hw/xwin/winblock.c
@@ -34,16 +34,6 @@
 #include "win.h"
 #include "winmsg.h"
 
-
-/*
- * References to external symbols
- */
-
-extern HWND			g_hDlgDepthChange;
-extern HWND			g_hDlgExit;
-extern HWND			g_hDlgAbout;
-
-
 /* See Porting Layer Definition - p. 6 */
 void
 winBlockHandler (int nScreen,
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 076d475..0ed1d13 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -41,8 +41,6 @@
 #include <servermd.h>
 #include "misc.h"
 
-extern Bool	g_fSoftwareCursor;
-
 #define BRIGHTNESS(x) (x##Red * 0.299 + x##Green * 0.587 + x##Blue * 0.114)
 
 #if 0
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 270ff78..22d8cd7 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -44,21 +44,9 @@
  * References to external globals
  */
 
-extern Bool			g_fCursor;
-extern HWND			g_hDlgDepthChange;
-extern HWND			g_hDlgExit;
-extern HWND			g_hDlgAbout;
-extern WINPREFS			pref;
 #ifdef XWIN_CLIPBOARD
 extern Bool			g_fClipboardStarted;
 #endif
-extern Bool			g_fSoftwareCursor;
-
-#if defined(XWIN_MULTIWINDOW)
-extern HICON                    g_hIconX;
-extern HICON                    g_hSmallIconX;
-#endif
-
 /*
  * Local function prototypes
  */
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index 01412dd..aadfd28 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -35,13 +35,6 @@
 #include <../xfree86/common/xorgVersion.h>
 #include "win.h"
 
-/* References to external symbols */
-extern char *		g_pszCommandLine;
-extern const char *	g_pszLogFile;
-extern Bool		g_fSilentFatalError;
-extern Bool		g_fLogInited;
-
-
 #ifdef DDXOSVERRORF
 /* Prototype */
 void
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 2b6c8a8..2909f37 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -82,6 +82,7 @@ Bool            g_fNativeGl = FALSE;
  * Global variables for dynamically loaded libraries and
  * their function pointers
  */
+
 FARPROC		g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
 
 
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
new file mode 100644
index 0000000..8992679
--- /dev/null
+++ b/hw/xwin/winglobals.h
@@ -0,0 +1,88 @@
+/*
+  File: winglobals.h
+  Purpose: declarations for global variables
+
+  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 (including the next
+  paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+
+*/
+
+#ifndef WINGLOBALS_H
+#define WINGLOBALS_H
+
+/*
+ * References to external symbols
+ */
+
+extern int			g_iNumScreens;
+extern int			g_iLastScreen;
+extern char *			g_pszCommandLine;
+extern Bool			g_fSilentFatalError;
+extern const char *		g_pszLogFile;
+#ifdef RELOCATE_PROJECTROOT
+extern Bool			g_fLogFileChanged;
+#endif
+extern int			g_iLogVerbose;
+extern Bool			g_fLogInited;
+
+extern Bool			g_fAuthEnabled;
+extern Bool			g_fXdmcpEnabled;
+
+extern Bool			g_fNoHelpMessageBox;
+extern Bool			g_fSilentDupError;
+extern Bool                     g_fNativeGl;
+
+extern HWND			g_hDlgDepthChange;
+extern HWND			g_hDlgExit;
+extern HWND			g_hDlgAbout;
+
+extern Bool 			g_fSoftwareCursor;
+extern Bool			g_fCursor;
+
+#ifdef XWIN_CLIPBOARD
+
+/* Typedef for DIX wrapper functions */
+typedef int (*winDispatchProcPtr) (ClientPtr);
+
+/*
+ * Wrapped DIX functions
+ */
+extern winDispatchProcPtr	winProcEstablishConnectionOrig;
+extern winDispatchProcPtr	winProcQueryTreeOrig;
+extern winDispatchProcPtr	winProcSetSelectionOwnerOrig;
+#endif
+
+/* The global X default icons */
+#if defined(XWIN_MULTIWINDOW)
+extern HICON                    g_hIconX;
+extern HICON                    g_hSmallIconX;
+#endif
+
+#ifdef XWIN_MULTIWINDOW
+extern DWORD			g_dwCurrentThreadID;
+#endif
+
+extern Bool			g_fKeyboardHookLL;
+extern Bool			g_fButton[3];
+
+#ifdef XWIN_MULTIWINDOWEXTWM
+extern Bool			g_fNoConfigureWindow;
+#endif
+
+#endif /* WINGLOBALS_H */
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
index cb27d2f..1ca3f91 100644
--- a/hw/xwin/winmultiwindowicons.c
+++ b/hw/xwin/winmultiwindowicons.c
@@ -41,13 +41,6 @@
 #include "propertyst.h"
 #include "windowstr.h"
 
-/*
- * External global variables
- */
-
-extern HICON		g_hIconX;
-extern HICON		g_hSmallIconX;
-
 
 /*
  * Prototypes for local functions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 7312350..7efc360 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -40,15 +40,6 @@
 #include "winmultiwindowclass.h"
 
 /*
- * External global variables
- */
-
-extern HICON		g_hIconX;
-extern HICON		g_hSmallIconX;
-extern HWND		g_hDlgDepthChange;
-extern Bool             g_fNativeGl;
-
-/*
  * Prototypes for local functions
  */
 
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index d14ceee..b559cd8 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -42,15 +42,6 @@
 #include "winmsg.h"
 #include "inputstr.h"
 
-/*
- * External global variables
- */
-
-extern Bool			g_fCursor;
-extern Bool			g_fKeyboardHookLL;
-extern Bool			g_fSoftwareCursor;
-extern Bool			g_fButton[3];
-
 extern void winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle);
 
 
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
index 48a467a..b8d2d35 100644
--- a/hw/xwin/winnativegdi.c
+++ b/hw/xwin/winnativegdi.c
@@ -35,13 +35,6 @@
 
 
 /*
- * External symbols
- */
-
-extern HWND			g_hDlgExit;
-
-
-/*
  * Local function prototypes
  */
 
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index 13fc105..7859c6b 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -38,14 +38,6 @@
 
 
 /*
- * External symbols
- */
-
-extern const GUID		_IID_IDirectDraw2;
-extern HWND			g_hDlgExit;
-
-
-/*
  * Local function prototypes
  */
 
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 1996ef0..4ccb4ff 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -49,22 +49,11 @@
 /* Where will the custom menu commands start counting from? */
 #define STARTMENUID WM_USER
 
-/* External global variables */
-#ifdef XWIN_MULTIWINDOW
-extern DWORD g_dwCurrentThreadID;
-#endif
-
 extern const char *winGetBaseDir(void);
 
 /* From winmultiwindowflex.l, the real parser */
 extern void parse_file (FILE *fp);
 
-/* From winprefyacc.y, the pref structure loaded by the parser */
-extern WINPREFS pref;
-
-/* The global X default icon */
-extern HICON		g_hIconX;
-extern HICON		g_hSmallIconX;
 
 /* Currently in use command ID, incremented each new menu item created */
 static int g_cmdid = STARTMENUID;
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
index 4daf474..33b496d 100644
--- a/hw/xwin/winprefs.h
+++ b/hw/xwin/winprefs.h
@@ -151,7 +151,8 @@ typedef struct WINPREFS
 
 } WINPREFS;
 
-
+/* The global pref settings structure loaded by the winprefyacc.y parser */
+extern WINPREFS pref;
 
 
 /* Functions */
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index edbd4be..1ce5c2d 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -40,26 +40,10 @@ from The Open Group.
  * References to external symbols
  */
 
-extern int			g_iNumScreens;
-extern winScreenInfo *		g_ScreenInfo;
 #ifdef XWIN_CLIPBOARD
 extern Bool			g_fUnicodeClipboard;
 extern Bool			g_fClipboard;
 #endif
-extern int			g_iLogVerbose;
-extern const char *		g_pszLogFile;
-#ifdef RELOCATE_PROJECTROOT
-extern Bool			g_fLogFileChanged;
-#endif
-extern Bool			g_fXdmcpEnabled;
-extern Bool			g_fAuthEnabled;
-extern char *			g_pszCommandLine;
-extern Bool			g_fKeyboardHookLL;
-extern Bool			g_fNoHelpMessageBox;                     
-extern Bool			g_fSoftwareCursor;
-extern Bool			g_fSilentDupError;
-extern Bool                     g_fNativeGl;
-
 /* globals required by callback function for monitor information */
 struct GetMonitorInfoData {
     int  requestedMonitor;
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index cf65881..57a0884 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -65,14 +65,6 @@ winMWExtWMProcs = {
 };
 #endif
 
-
-/*
- * References to external symbols
- */
-
-extern Bool                     g_fSoftwareCursor;
-
-
 /*
  * Prototypes
  */
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 2de496c..4e284b9 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -38,13 +38,6 @@
 
 
 /*
- * External symbols
- */
-
-extern HWND			g_hDlgExit;
-extern const char *g_pszLogFile;
-
-/*
  * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
  * so we have to redefine it here.
  */
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 0d59e6a..82fe4be 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -38,13 +38,6 @@
 
 
 /*
- * External symbols
- */
-
-extern HWND			g_hDlgExit;
-
-
-/*
  * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
  * so we have to redefine it here.
  */
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 8af4be4..4971851 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -35,16 +35,6 @@
 
 
 /*
- * External symbols
- */
-
-#ifdef XWIN_MULTIWINDOW
-extern DWORD			g_dwCurrentThreadID;
-#endif
-extern HWND			g_hDlgExit;
-
-
-/*
  * Local function prototypes
  */
 
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
index 6f8d1c9..357d3d7 100644
--- a/hw/xwin/winvalargs.c
+++ b/hw/xwin/winvalargs.c
@@ -35,13 +35,6 @@
 #include "winmsg.h"
 
 
-/*
- * References to external symbols
- */
-
-extern int			g_iNumScreens;
-extern winScreenInfo *		g_ScreenInfo;
-extern Bool			g_fXdmcpEnabled;
 
 
 /*
diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c
index e1eece3..b512b29 100644
--- a/hw/xwin/winwakeup.c
+++ b/hw/xwin/winwakeup.c
@@ -36,16 +36,6 @@
 #endif
 #include "win.h"
 
-
-/*
- * References to external symbols
- */
-
-extern HWND			g_hDlgDepthChange;
-extern HWND			g_hDlgExit;
-extern HWND			g_hDlgAbout;
-
-
 /* See Porting Layer Definition - p. 7 */
 void
 winWakeupHandler (int nScreen,
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 4d7afee..21506df 100644
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -53,14 +53,6 @@
 
 
 /*
- * Global variables
- */
-
-extern Bool			g_fNoConfigureWindow;
-extern Bool			g_fSoftwareCursor;
-
-
-/*
  * Local globals
  */
 
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 4e4eff2..6d2270a 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -51,17 +51,6 @@ Bool				g_fButton[3] = { FALSE, FALSE, FALSE };
 
 
 /*
- * References to external symbols
- */
-
-extern Bool			g_fClipboard;
-extern HWND			g_hDlgDepthChange;
-extern Bool			g_fKeyboardHookLL;
-extern Bool			g_fSoftwareCursor;
-extern DWORD			g_dwCurrentThreadID;
-
-
-/*
  * Called by winWakeupHandler
  * Processes current Windows message
  */
commit 04d11abcf2ea2f36d899428e9c885b69e4f779ad
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 14 22:45:31 2010 +0100

    Cygwin/X: Remove g_hwndKeyboardFocus
    
    It's set but it's value is never used
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index d7ea2e3..2b6c8a8 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -73,7 +73,6 @@ char *		g_pszCommandLine = NULL;
 Bool		g_fSilentFatalError = FALSE;
 DWORD		g_dwCurrentThreadID = 0;
 Bool		g_fKeyboardHookLL = FALSE;
-HWND		g_hwndKeyboardFocus = NULL;
 Bool		g_fNoHelpMessageBox = FALSE;
 Bool		g_fSoftwareCursor = FALSE;
 Bool		g_fSilentDupError = FALSE;
@@ -120,7 +119,6 @@ void
 winInitializeGlobals (void)
 {
   g_dwCurrentThreadID = GetCurrentThreadId ();
-  g_hwndKeyboardFocus = NULL;
 #ifdef XWIN_CLIPBOARD
   g_fClipboardLaunched = FALSE;
   g_fClipboardStarted = FALSE;
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 5e84510..4e4eff2 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -57,7 +57,6 @@ Bool				g_fButton[3] = { FALSE, FALSE, FALSE };
 extern Bool			g_fClipboard;
 extern HWND			g_hDlgDepthChange;
 extern Bool			g_fKeyboardHookLL;
-extern HWND			g_hwndKeyboardFocus;
 extern Bool			g_fSoftwareCursor;
 extern DWORD			g_dwCurrentThreadID;
 
@@ -964,9 +963,6 @@ winWindowProc (HWND hwnd, UINT message,
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
 
-      /* Save handle of our main window that last received focus */
-      g_hwndKeyboardFocus = hwnd;
-
       /* Restore the state of all mode keys */
       winRestoreModeKeyStates ();
 
@@ -979,9 +975,6 @@ winWindowProc (HWND hwnd, UINT message,
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
 
-      /* Clear handle of our main window that last received focus */
-      g_hwndKeyboardFocus = NULL;
-
       /* Release any pressed keys */
       winKeybdReleaseKeys ();
 
commit 5e896e425fe14022b0714301531bd54151c763f0
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 14 22:43:51 2010 +0100

    Cygwin/X: Make g_hmodCommonControls static
    
    Make g_hmodCommonControls static, it's only used in InitOutput.c
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 63fca3a..ae1d415 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -90,13 +90,18 @@ extern HWND			g_hwndClipboard;
 extern Bool			g_fClipboard;
 #endif
 
-extern HMODULE			g_hmodCommonControls;
+
 extern FARPROC			g_fpTrackMouseEvent;
 extern Bool			g_fNoHelpMessageBox;                     
 extern Bool			g_fSilentDupError;                     
 extern Bool                     g_fNativeGl;
 
 /*
+  module handle for dynamically loaded comctl32 library
+*/
+static HMODULE g_hmodCommonControls = NULL;
+
+/*
  * Function prototypes
  */
 
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index f197def..4d6771c 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -656,7 +656,6 @@ extern DeviceIntPtr             g_pwinKeyboard;
 extern FARPROC			g_fpDirectDrawCreate;
 extern FARPROC			g_fpDirectDrawCreateClipper;
 
-extern HMODULE			g_hmodCommonControls;
 extern FARPROC			g_fpTrackMouseEvent;
 
 
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index da17129..d7ea2e3 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -83,8 +83,6 @@ Bool            g_fNativeGl = FALSE;
  * Global variables for dynamically loaded libraries and
  * their function pointers
  */
-
-HMODULE		g_hmodCommonControls = NULL;
 FARPROC		g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
 
 
commit 49b996faadf0fedcee25d4a8f96f4c4007c29f5f
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Oct 15 13:00:46 2010 +0100

    Cygwin/X: Make g_hmodDirectDraw static
    
    Add winReleaseDDProcAddresses() for releasing the direct draw module
    handle, so g_hmodDirectDraw can be made static
    
    Remove unneeded duplicate extern definitions of g_fpDirectDrawCreate
    and g_fpDirectDrawCreateClipper, and move the definition from
    winglobals.c to winengine.c
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 5ed3e74..63fca3a 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -90,10 +90,6 @@ extern HWND			g_hwndClipboard;
 extern Bool			g_fClipboard;
 #endif
 
-extern HMODULE			g_hmodDirectDraw;
-extern FARPROC			g_fpDirectDrawCreate;
-extern FARPROC			g_fpDirectDrawCreateClipper;
-  
 extern HMODULE			g_hmodCommonControls;
 extern FARPROC			g_fpTrackMouseEvent;
 extern Bool			g_fNoHelpMessageBox;                     
@@ -258,13 +254,7 @@ ddxGiveUp (void)
    * At this point we aren't creating any new screens, so
    * we are guaranteed to not need the DirectDraw functions.
    */
-  if (g_hmodDirectDraw != NULL)
-    {
-      FreeLibrary (g_hmodDirectDraw);
-      g_hmodDirectDraw = NULL;
-      g_fpDirectDrawCreate = NULL;
-      g_fpDirectDrawCreateClipper = NULL;
-    }
+  winReleaseDDProcAddresses();
 
   /* Unload our TrackMouseEvent function pointer */
   if (g_hmodCommonControls != NULL)
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 1b1358c..f197def 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -653,7 +653,6 @@ extern DeviceIntPtr             g_pwinKeyboard;
  * Extern declares for dynamically loaded libraries and function pointers
  */
 
-extern HMODULE			g_hmodDirectDraw;
 extern FARPROC			g_fpDirectDrawCreate;
 extern FARPROC			g_fpDirectDrawCreateClipper;
 
@@ -859,6 +858,9 @@ winSetEngine (ScreenPtr pScreen);
 Bool
 winGetDDProcAddresses (void);
 
+void
+winReleaseDDProcAddresses(void);
+
 
 /*
  * winerror.c
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
index fb9aed8..e866e1e 100644
--- a/hw/xwin/winengine.c
+++ b/hw/xwin/winengine.c
@@ -34,13 +34,17 @@
 #include "win.h"
 #include "winmsg.h"
 
-
 /*
- * External global variables
+ * Global variables for function pointers into
+ * dynamically loaded libraries
  */
+FARPROC		g_fpDirectDrawCreate = NULL;
+FARPROC		g_fpDirectDrawCreateClipper = NULL;
 
-extern const GUID _IID_IDirectDraw4;
-
+/*
+  module handle for dynamically loaded directdraw library
+*/
+static HMODULE g_hmodDirectDraw = NULL;
 
 /*
  * Detect engines supported by current Windows version
@@ -334,3 +338,15 @@ winGetDDProcAddresses (void)
   
   return fReturn;
 }
+
+void
+winReleaseDDProcAddresses(void)
+{
+  if (g_hmodDirectDraw != NULL)
+    {
+      FreeLibrary (g_hmodDirectDraw);
+      g_hmodDirectDraw = NULL;
+      g_fpDirectDrawCreate = NULL;
+      g_fpDirectDrawCreateClipper = NULL;
+    }
+}
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 55b0f16..da17129 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -84,10 +84,6 @@ Bool            g_fNativeGl = FALSE;
  * their function pointers
  */
 
-HMODULE		g_hmodDirectDraw = NULL;
-FARPROC		g_fpDirectDrawCreate = NULL;
-FARPROC		g_fpDirectDrawCreateClipper = NULL;
-
 HMODULE		g_hmodCommonControls = NULL;
 FARPROC		g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
 
commit 6f12277e37d16a7de9d3f3079688c43b07921b0a
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 14 22:44:53 2010 +0100

    Cygwin/X: Make g_hhookKeyboardLL static
    
    Make g_hhookKeyboardLL static, it's only used in winkeyhook.c
    
    Also remove unused externs
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index f3f01d7..55b0f16 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -73,7 +73,6 @@ char *		g_pszCommandLine = NULL;
 Bool		g_fSilentFatalError = FALSE;
 DWORD		g_dwCurrentThreadID = 0;
 Bool		g_fKeyboardHookLL = FALSE;
-HHOOK		g_hhookKeyboardLL = NULL;
 HWND		g_hwndKeyboardFocus = NULL;
 Bool		g_fNoHelpMessageBox = FALSE;
 Bool		g_fSoftwareCursor = FALSE;
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index 2d6ed18..fe1156d 100644
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -34,13 +34,7 @@
 #include "win.h"
 
 
-/*
- * References to external symbols
- */
-
-extern HHOOK			g_hhookKeyboardLL;
-extern DWORD			g_dwCurrentThreadID;
-extern HWND			g_hwndKeyboardFocus;
+static HHOOK g_hhookKeyboardLL = NULL;
 
 
 /*
commit 9952b51f6822aeaa19c27caf85698741eb4c27d8
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Oct 15 13:01:45 2010 +0100

    Cygwin/X: Fix typos in comments
    
    Fix a few typos in comments
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 445549a..5ed3e74 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -266,7 +266,7 @@ ddxGiveUp (void)
       g_fpDirectDrawCreateClipper = NULL;
     }
 
-  /* Unload our TrackMouseEvent funtion pointer */
+  /* Unload our TrackMouseEvent function pointer */
   if (g_hmodCommonControls != NULL)
     {
       FreeLibrary (g_hmodCommonControls);
@@ -437,7 +437,7 @@ winFixupPaths (void)
             int needs_sep = TRUE; 
             int comment_block = FALSE;
 
-            /* get defautl fontpath */
+            /* get default fontpath */
             char *fontpath = strdup(defaultFontPath);
             size_t size = strlen(fontpath);
 
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 1e21de3..c9b1584 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -634,7 +634,7 @@ winMultiWindowWMProc (void *pArg)
   ErrorF ("winMultiWindowWMProc ()\n");
 #endif
 
-  /* Loop until we explicity break out */
+  /* Loop until we explicitly break out */
   for (;;)
     {
       WMMsgNodePtr	pNode;
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 5752730..2de496c 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -55,7 +55,7 @@ extern const char *g_pszLogFile;
 
 
 /*
- * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
+ * FIXME: Headers are broken, IID_IDirectDraw2 has to be defined
  * here manually.  Should be handled by ddraw.h
  */
 #ifndef IID_IDirectDraw2
commit 1de5db73d31411798ae93619d9e626fa32e0c4bd
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Oct 14 22:46:09 2010 +0100

    Cygwin/X: Drop several unneeded includes of winprefs.h
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 95d9d71..7312350 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -38,7 +38,6 @@
 #include "win.h"
 #include "dixevents.h"
 #include "winmultiwindowclass.h"
-#include "winprefs.h"
 
 /*
  * External global variables
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index fea5797..edbd4be 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -34,7 +34,6 @@ from The Open Group.
 #include <../xfree86/common/xorgVersion.h>
 #include "win.h"
 #include "winconfig.h"
-#include "winprefs.h"
 #include "winmsg.h"
 
 /*
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index fbe4191..75142f1 100644
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -41,7 +41,6 @@
 #include <X11/extensions/windowswmstr.h>
 #include "dixevents.h"
 #include "winmultiwindowclass.h"
-#include "winprefs.h"
 #include <X11/Xatom.h>
 
 
commit 8e723108151136f115e8e6d4b97ed4e2fa685dbf
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Sep 29 14:18:27 2010 +0100

    Xming: Remove uses of register keyword
    
    I'm pretty sure the compiler has a better idea how to optimize this
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index c255e49..7138409 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -77,10 +77,10 @@ make_box (int x, int y, int w, int h)
 }
 
 static int
-ProcWindowsWMQueryVersion(register ClientPtr client)
+ProcWindowsWMQueryVersion(ClientPtr client)
 {
   xWindowsWMQueryVersionReply rep;
-  register int n;
+  int n;
 
   REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
   rep.type = X_Reply;
@@ -158,7 +158,7 @@ WMFreeEvents (pointer data, XID id)
 }
 
 static int
-ProcWindowsWMSelectInput (register ClientPtr client)
+ProcWindowsWMSelectInput (ClientPtr client)
 {
   REQUEST(xWindowsWMSelectInputReq);
   WMEventPtr		pEvent, pNewEvent, *pHead;
@@ -298,7 +298,7 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
 /* general utility functions */
 
 static int
-ProcWindowsWMDisableUpdate (register ClientPtr client)
+ProcWindowsWMDisableUpdate (ClientPtr client)
 {
   REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq);
 
@@ -308,7 +308,7 @@ ProcWindowsWMDisableUpdate (register ClientPtr client)
 }
 
 static int
-ProcWindowsWMReenableUpdate (register ClientPtr client)
+ProcWindowsWMReenableUpdate (ClientPtr client)
 {
   REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq);
 
@@ -321,7 +321,7 @@ ProcWindowsWMReenableUpdate (register ClientPtr client)
 /* window functions */
 
 static int
-ProcWindowsWMSetFrontProcess (register ClientPtr client)
+ProcWindowsWMSetFrontProcess (ClientPtr client)
 {
   REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq);
   
@@ -334,7 +334,7 @@ ProcWindowsWMSetFrontProcess (register ClientPtr client)
 /* frame functions */
 
 static int
-ProcWindowsWMFrameGetRect (register ClientPtr client)
+ProcWindowsWMFrameGetRect (ClientPtr client)
 {
   xWindowsWMFrameGetRectReply rep;
   BoxRec ir;
@@ -388,7 +388,7 @@ ProcWindowsWMFrameGetRect (register ClientPtr client)
 
 
 static int
-ProcWindowsWMFrameDraw (register ClientPtr client)
+ProcWindowsWMFrameDraw (ClientPtr client)
 {
   REQUEST(xWindowsWMFrameDrawReq);
   WindowPtr pWin;
@@ -478,9 +478,7 @@ ProcWindowsWMFrameDraw (register ClientPtr client)
 }
 
 static int
-ProcWindowsWMFrameSetTitle(
-			   register ClientPtr client
-			   )
+ProcWindowsWMFrameSetTitle(ClientPtr client)
 {
   unsigned int title_length, title_max;
   char *title_bytes;
@@ -540,7 +538,7 @@ ProcWindowsWMFrameSetTitle(
 /* dispatch */
 
 static int
-ProcWindowsWMDispatch (register ClientPtr client)
+ProcWindowsWMDispatch (ClientPtr client)
 {
   REQUEST(xReq);
 
@@ -586,16 +584,16 @@ SNotifyEvent (xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to)
 }
 
 static int
-SProcWindowsWMQueryVersion (register ClientPtr client)
+SProcWindowsWMQueryVersion (ClientPtr client)
 {
-  register int n;
+  int n;
   REQUEST(xWindowsWMQueryVersionReq);
   swaps(&stuff->length, n);
   return ProcWindowsWMQueryVersion(client);
 }
 
 static int
-SProcWindowsWMDispatch (register ClientPtr client)
+SProcWindowsWMDispatch (ClientPtr client)
 {
   REQUEST(xReq);
 
commit d11761c6a6dd2a9963dfd3bcb313f1b2525387fc
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 26 13:31:18 2010 +0000

    Xming: Casts to remove warnings on event pointers
    
    winkeybd.c: In function ‘winSendKeyEvent’:
    winkeybd.c:489: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type
    winmouse.c: In function ‘winMouseButtonsSendEvent’:
    winmouse.c:247: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type
    winmouse.c: In function ‘winEnqueueMotion’:
    winmouse.c:380: warning: passing argument 2 of ‘mieqEnqueue’ from incompatible pointer type
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 6d91ce0..83fea21 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -486,7 +486,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
   nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE);
 
   for (i = 0; i < nevents; i++)
-    mieqEnqueue(g_pwinKeyboard, events[i].event);
+    mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event);
 
 #if CYGDEBUG
   ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index 5e1f756..af499d9 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -244,7 +244,7 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
 			     POINTER_RELATIVE, 0, 0, NULL);
 
   for (i = 0; i < nevents; i++)
-    mieqEnqueue(g_pwinPointer, events[i].event);
+    mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
 
 #if CYGDEBUG
   ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n",
@@ -377,5 +377,5 @@ void winEnqueueMotion(int x, int y)
 			     POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
 
   for (i = 0; i < nevents; i++)
-    mieqEnqueue(g_pwinPointer, events[i].event);
+    mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
 }
commit 10bf8345cf15c6030147a9edb7f6a093c8db8099
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Mon Oct 12 13:50:00 2009 +0100

    Xming: Warning fix in winDeviceCursorCleanup()
    
    return statement with an expression in a function whose return-type is void
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 7f1935a..076d475 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -557,7 +557,7 @@ static void
 winDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr)
 {
   winScreenPriv(pScr);
-  return pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr);
+  pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr);
 }
 
 static miPointerSpriteFuncRec winSpriteFuncsRec = {
commit cab837a60a7aa653ccea77ff714335186ce38a4b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Jul 18 13:22:46 2010 +0100

    Cygwin/X: Reformat the keyboard layout mapping table
    
    Also remove the out-of-date listing of keyboard layout IDs and which ones
    have known mappings
    
    XXX: layout zh_TW doesn't exist anymore
    
    This patch brought to you by C-u M-x align-regexp
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h
index d1d21a1..9500689 100644
--- a/hw/xwin/winlayouts.h
+++ b/hw/xwin/winlayouts.h
@@ -42,232 +42,52 @@ typedef struct
    This table is sorted by low byte of winlayout, then by next byte, etc.
 */
 
-WinKBLayoutRec winKBLayouts[] = 
+WinKBLayoutRec winKBLayouts[] =
 {
-    {  0x404, -1, "pc105", "zh_TW",   NULL, NULL, "Chinese (Taiwan)"},
-    {  0x405, -1, "pc105", "cz",      NULL, NULL, "Czech"},
-    {0x10405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"},
-    {  0x406, -1, "pc105", "dk",      NULL, NULL, "Danish"},
-    {  0x407, -1, "pc105", "de",      NULL, NULL, "German (Germany)"},
-    {0x10407, -1, "pc105", "de",      NULL, NULL, "German (Germany, IBM)"},
-    {  0x807, -1, "pc105", "ch",      "de", NULL, "German (Switzerland)"},
-    {  0x409, -1, "pc105", "us",      NULL, NULL, "English (USA)"},
-    {0x10409, -1, "pc105", "dvorak",  NULL, NULL, "English (USA, Dvorak)"}, 
-    {0x20409, -1, "pc105", "us_intl", NULL, NULL, "English (USA, International)"}, 
-    {  0x809, -1, "pc105", "gb",      NULL, NULL, "English (United Kingdom)"},
-    { 0x1809, -1, "pc105", "ie",      NULL, NULL, "Irish"},
-    {  0x40a, -1, "pc105", "es",      NULL, NULL, "Spanish (Spain, Traditional Sort)"},
-    {  0x80a, -1, "pc105", "latam",   NULL, NULL, "Latin American"},
-    {  0x40b, -1, "pc105", "fi",      NULL, NULL, "Finnish"},
-    {  0x40c, -1, "pc105", "fr",      NULL, NULL, "French (Standard)"},
-    {  0x80c, -1, "pc105", "be",      NULL, NULL, "French (Belgian)"},
-    {  0xc0c, -1, "pc105", "ca",      "fr", NULL, "French (Canada)"},
-    { 0x100c, -1, "pc105", "ch",      "fr", NULL, "French (Switzerland)"},
-    {  0x40d, -1, "pc105", "il",      NULL, NULL, "Hebrew"},
-    {  0x40e, -1, "pc105", "hu",      NULL, NULL, "Hungarian"},
-    {  0x40f, -1, "pc105", "is",      NULL, NULL, "Icelandic"},
-    {  0x410, -1, "pc105", "it",      NULL, NULL, "Italian"},
-    {0x10410, -1, "pc105", "it",      NULL, NULL, "Italian (142)"},
-    {0xa0000410,-1, "macbook79","it",   "mac",NULL, "Italiano (Apple)"},
-    {  0x411,  7, "jp106", "jp",      NULL, NULL, "Japanese"},
-    {  0x413, -1, "pc105", "nl",      NULL, NULL, "Dutch"},
-    {  0x813, -1, "pc105", "be",      NULL, NULL, "Dutch (Belgian)"},  
-    {  0x414, -1, "pc105", "no",      NULL, NULL, "Norwegian"},
-    {  0x415, -1, "pc105", "pl",      NULL, NULL, "Polish (Programmers)"},
-    {  0x416, -1, "pc105", "br",      NULL, NULL, "Portuguese (Brazil, ABNT)"},
-    {0x10416, -1, "abnt2", "br",      NULL, NULL, "Portuguese (Brazil, ABNT2)"},
-    {  0x816, -1, "pc105", "pt",      NULL, NULL, "Portuguese (Portugal)"},
-    {  0x41a, -1, "pc105", "hr",      NULL, NULL, "Croatian"},
-    {  0x41d, -1, "pc105", "se",      NULL, NULL, "Swedish (Sweden)"},
-    {  0x424, -1, "pc105", "si",      NULL, NULL, "Slovenian"},
-    {  0x425, -1, "pc105", "ee",      NULL, NULL, "Estonian"},
-    {  0x452, -1, "pc105", "gb",      "intl", NULL, "United Kingdom (Extended)"},
-    {     -1, -1, NULL,    NULL,      NULL, NULL, NULL}
+    {  0x00000404, -1, "pc105",     "zh_TW",     NULL,        NULL, "Chinese (Taiwan)"},
+    {  0x00000405, -1, "pc105",     "cz",        NULL,        NULL, "Czech"},
+    {  0x00010405, -1, "pc105",     "cz_qwerty", NULL,        NULL, "Czech (QWERTY)"},
+    {  0x00000406, -1, "pc105",     "dk",        NULL,        NULL, "Danish"},
+    {  0x00000407, -1, "pc105",     "de",        NULL,        NULL, "German (Germany)"},
+    {  0x00010407, -1, "pc105",     "de",        NULL,        NULL, "German (Germany,IBM)"},
+    {  0x00000807, -1, "pc105",     "ch",        "de",        NULL, "German (Switzerland)"},
+    {  0x00000409, -1, "pc105",     "us",        NULL,        NULL, "English (USA)"},
+    {  0x00010409, -1, "pc105",     "dvorak",    NULL,        NULL, "English (USA,Dvorak)"},
+    {  0x00020409, -1, "pc105",     "us_intl",   NULL,        NULL, "English (USA,International)"},
+    {  0x00000809, -1, "pc105",     "gb",        NULL,        NULL, "English (United Kingdom)"},
+    {  0x00001809, -1, "pc105",     "ie",        NULL,        NULL, "Irish"},
+    {  0x0000040a, -1, "pc105",     "es",        NULL,        NULL, "Spanish (Spain,Traditional Sort)"},
+    {  0x0000080a, -1, "pc105",     "latam",     NULL,        NULL, "Latin American"},
+    {  0x0000040b, -1, "pc105",     "fi",        NULL,        NULL, "Finnish"},
+    {  0x0000040c, -1, "pc105",     "fr",        NULL,        NULL, "French (Standard)"},
+    {  0x0000080c, -1, "pc105",     "be",        NULL,        NULL, "French (Belgian)"},
+    {  0x00000c0c, -1, "pc105",     "ca",        "fr",        NULL, "French (Canada)"},
+    {  0x0000100c, -1, "pc105",     "ch",        "fr",        NULL, "French (Switzerland)"},
+    {  0x0000040d, -1, "pc105",     "il",        NULL,        NULL, "Hebrew"},
+    {  0x0000040e, -1, "pc105",     "hu",        NULL,        NULL, "Hungarian"},
+    {  0x0000040f, -1, "pc105",     "is",        NULL,        NULL, "Icelandic"},
+    {  0x00000410, -1, "pc105",     "it",        NULL,        NULL, "Italian"},
+    {  0x00010410, -1, "pc105",     "it",        NULL,        NULL, "Italian (142)"},
+    {  0xa0000410, -1, "macbook79", "it",        "mac",       NULL, "Italiano (Apple)"},
+    {  0x00000411,  7, "jp106",     "jp",        NULL,        NULL, "Japanese"},
+    {  0x00000413, -1, "pc105",     "nl",        NULL,        NULL, "Dutch"},
+    {  0x00000813, -1, "pc105",     "be",        NULL,        NULL, "Dutch (Belgian)"},
+    {  0x00000414, -1, "pc105",     "no",        NULL,        NULL, "Norwegian"},
+    {  0x00000415, -1, "pc105",     "pl",        NULL,        NULL, "Polish (Programmers)"},
+    {  0x00000416, -1, "pc105",     "br",        NULL,        NULL, "Portuguese (Brazil,ABNT)"},
+    {  0x00010416, -1, "abnt2",     "br",        NULL,        NULL, "Portuguese (Brazil,ABNT2)"},
+    {  0x00000816, -1, "pc105",     "pt",        NULL,        NULL, "Portuguese (Portugal)"},
+    {  0x0000041a, -1, "pc105",     "hr",        NULL,        NULL, "Croatian"},
+    {  0x0000041d, -1, "pc105",     "se",        NULL,        NULL, "Swedish (Sweden)"},
+    {  0x00000424, -1, "pc105",     "si",        NULL,        NULL, "Slovenian"},
+    {  0x00000425, -1, "pc105",     "ee",        NULL,        NULL, "Estonian"},
+    {  0x00000452, -1, "pc105",     "gb",        "intl",      NULL, "United Kingdom (Extended)"},
+    {          -1, -1, NULL,        NULL,        NULL,        NULL, NULL}
 };
 
-/* Listing of language codes from MSDN */
 /*
-Support ID       XKB        Language
-====================================================================
-   ?    0x0000              Language Neutral
-   ?    0x0400              Process or User Default Language
-   ?    0x0800              System Default Language
-        0x0401              Arabic (Saudi Arabia)
-        0x0801              Arabic (Iraq)
-        0x0c01              Arabic (Egypt)
-        0x1001              Arabic (Libya)
-        0x1401              Arabic (Algeria)
-        0x1801              Arabic (Morocco)
-        0x1c01              Arabic (Tunisia)
-        0x2001              Arabic (Oman)
-        0x2401              Arabic (Yemen)
-        0x2801              Arabic (Syria)
-        0x2c01              Arabic (Jordan)
-        0x3001              Arabic (Lebanon)
-        0x3401              Arabic (Kuwait)
-        0x3801              Arabic (U.A.E.)
-        0x3c01              Arabic (Bahrain)
-        0x4001              Arabic (Qatar)
-                            Arabic (102) AZERTY        				
-        0x0402              Bulgarian
-        0x0403              Catalan
-        0x0404              Chinese (Taiwan)
-        0x0804              Chinese (PRC)
-        0x0c04              Chinese (Hong Kong SAR, PRC)
-        0x1004              Chinese (Singapore)
-        0x1404              Chinese (Macao SAR) (98/ME,2K/XP)
-   X    0x0405  cz          Czech
-   X            cz_qwerty   Czech (QWERTY)
-                            Czech (Programmers)
-   X    0x0406  dk          Danish
-   X    0x0407  de          German (Standard)
-   X    0x0807  de_CH       German (Switzerland)
-        0x0c07              German (Austria)
-        0x1007              German (Luxembourg)
-        0x1407              German (Liechtenstein)
-        0x0408              Greek
-   X    0x0409  us          English (United States)
-   X    0x0809  gb          English (United Kingdom)
-        0x0c09              English (Australian)
-        0x1009              English (Canadian)
-        0x1409              English (New Zealand)
-   X    0x1809  ie          English (Ireland)
-        0x1c09              English (South Africa)
-        0x2009              English (Jamaica)
-        0x2409              English (Caribbean)
-        0x2809              English (Belize)
-        0x2c09              English (Trinidad)
-        0x3009              English (Zimbabwe) (98/ME,2K/XP)
-        0x3409              English (Philippines) (98/ME,2K/XP)
-   X    0x040a  es          Spanish (Spain, Traditional Sort)
-        0x080a              Spanish (Mexican)
-        0x0c0a              Spanish (Spain, Modern Sort)
-        0x100a              Spanish (Guatemala)
-        0x140a              Spanish (Costa Rica)
-        0x180a              Spanish (Panama)
-        0x1c0a              Spanish (Dominican Republic)
-        0x200a              Spanish (Venezuela)
-        0x240a              Spanish (Colombia)
-        0x280a              Spanish (Peru)
-        0x2c0a              Spanish (Argentina)
-        0x300a              Spanish (Ecuador)
-        0x340a              Spanish (Chile)
-        0x380a              Spanish (Uruguay)
-        0x3c0a              Spanish (Paraguay)
-        0x400a              Spanish (Bolivia)
-        0x440a              Spanish (El Salvador)
-        0x480a              Spanish (Honduras)
-        0x4c0a              Spanish (Nicaragua)
-        0x500a              Spanish (Puerto Rico)
-   X    0x040b  fi          Finnish
-                            Finnish (with Sami)
-   X    0x040c  fr          French (Standard)
-   X    0x080c  be          French (Belgian)
-   .    0x0c0c              French (Canadian)
-                            French (Canadian, Legacy)
-                            Canadian (Multilingual)
-   X    0x100c  fr_CH       French (Switzerland)
-        0x140c              French (Luxembourg)
-        0x180c              French (Monaco) (98/ME,2K/XP)
-        0x040d              Hebrew
-   X    0x040e  hu          Hungarian
-   .    0x040f              Icelandic
-   X    0x0410  it          Italian (Standard)
-        0x0810              Italian (Switzerland)
-   X    0x0411  jp          Japanese
-        0x0412              Korean
-        0x0812              Korean (Johab) (95,NT)
-   .    0x0413              Dutch (Netherlands)
-   X    0x0813  be          Dutch (Belgium)
-   X    0x0414  no          Norwegian (Bokmal)
-        0x0814              Norwegian (Nynorsk)
-   .    0x0415              Polish
-   X    0x0416  br          Portuguese (Brazil)
-   X    0x0816  pt          Portuguese (Portugal)
-   .    0x0418              Romanian
-        0x0419              Russian
-   .    0x041a              Croatian
-   .    0x081a              Serbian (Latin)
-   .    0x0c1a              Serbian (Cyrillic)
-        0x101a              Croatian (Bosnia and Herzegovina)
-        0x141a              Bosnian (Bosnia and Herzegovina)
-        0x181a              Serbian (Latin, Bosnia, and Herzegovina)
-        0x1c1a              Serbian (Cyrillic, Bosnia, and Herzegovina)
-   .    0x041b              Slovak
-   .    0x041c              Albanian
-   X    0x041d  se          Swedish
-        0x081d              Swedish (Finland)
-        0x041e              Thai
-        0x041f              Turkish
-        0x0420              Urdu (Pakistan) (98/ME,2K/XP) 
-        0x0820              Urdu (India)
-        0x0421              Indonesian
-        0x0422              Ukrainian
-        0x0423              Belarusian
-   .    0x0424              Slovenian
-        0x0425              Estonian
-        0x0426              Latvian
-        0x0427              Lithuanian
-        0x0827              Lithuanian (Classic) (98)
-        0x0429              Farsi
-        0x042a              Vietnamese (98/ME,NT,2K/XP)
-        0x042b              Armenian. This is Unicode only. (2K/XP)
-                            Armenian Eastern
-                            Armenian Western
-        0x042c              Azeri (Latin)
-        0x082c              Azeri (Cyrillic)
-        0x042d              Basque
-        0x042f              Macedonian (FYROM)
-        0x0430              Sutu
-        0x0432              Setswana/Tswana (South Africa)
-        0x0434              isiXhosa/Xhosa (South Africa)
-        0x0435              isiZulu/Zulu (South Africa)
-        0x0436              Afrikaans
-        0x0437              Georgian. This is Unicode only. (2K/XP)
-   .    0x0438              Faeroese
-        0x0439              Hindi. This is Unicode only. (2K/XP)
-        0x043a              Maltese (Malta)
-        0x043b              Sami, Northern (Norway)
-        0x083b              Sami, Northern (Sweden)
-        0x0c3b              Sami, Northern (Finland)
-        0x103b              Sami, Lule (Norway)
-        0x143b              Sami, Lule (Sweden)
-        0x183b              Sami, Southern (Norway)
-        0x1c3b              Sami, Southern (Sweden)
-        0x203b              Sami, Skolt (Finland)
-        0x243b              Sami, Inari (Finland)
-        0x043e              Malay (Malaysian)
-        0x083e              Malay (Brunei Darussalam)
-        0x0440              Kyrgyz. (XP)
-        0x0441              Swahili (Kenya)
-        0x0443              Uzbek (Latin)
-        0x0843              Uzbek (Cyrillic)
-        0x0444              Tatar (Tatarstan)
-        0x0445              Bengali (India)
-                            Bengali (Inscript)
-        0x0446              Punjabi. This is Unicode only. (XP)
-        0x0447              Gujarati. This is Unicode only. (XP)
-        0x0449              Tamil. This is Unicode only. (2K/XP)
-        0x044a              Telugu. This is Unicode only. (XP)
-        0x044b              Kannada. This is Unicode only. (XP)
-        0x044c              Malayalam (India)
-        0x044e              Marathi. This is Unicode only. (2K/XP)
-        0x044f              Sanskrit. This is Unicode only. (2K/XP)
-        0x0450              Mongolian (XP)
-        0x0452              Welsh (United Kingdom)
-        0x0455              Burmese
-        0x0456              Galician (XP)
-        0x0457              Konkani. This is Unicode only. (2K/XP)
-        0x045a              Syriac. This is Unicode only. (XP)
-        0x0465              Divehi. This is Unicode only. (XP)
-                            Divehi (Phonetic)
-                            Divehi (Typewriter)
-        0x046b              Quechua (Bolivia)
-        0x086b              Quechua (Ecuador)
-        0x0c6b              Quechua (Peru)
-        0x046c              Sesotho sa Leboa/Northern Sotho (South Africa)
-        0x007f              LOCALE_INVARIANT. See MAKELCID.
-        0x0481              Maori (New Zealand)
-*/    
+  See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx
+  for a listing of input locale (keyboard layout) codes
+*/
 
 
commit ee2867649d9485f6559f88a973eae6393971ff35
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Jul 18 13:20:01 2010 +0100

    Cygwin/X: Clarify XKB options in XWin man page
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/XWin.man.pre b/hw/xwin/XWin.man.pre
index 6b28b51..51268f6 100644
--- a/hw/xwin/XWin.man.pre
+++ b/hw/xwin/XWin.man.pre
@@ -251,7 +251,7 @@ exit silently and don't display any error message.
 .B "\-xkbrules \fIrule\fP"
 .TP 8
 .B "\-xkbvariant \fIvariant\fp"
-These options implement the xkeyboard extension for loading
+These options configure the xkeyboard extension to load
 a particular keyboard map as the X server starts.  The behavior is similar
 to the \fIsetxkbmap\fP program.  The layout data is located at \fI
 __datadir__/X11/xkb/\fP.  Additional information is found in the
@@ -264,9 +264,9 @@ the options:
 Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
 running.
 
-The default is to select a layout matching your current layout as
-reported by \fIWindows\fP if known, or the default X server layout
-if no matching keyboard layout was found.
+The default is to select a configuration matching your current layout as
+reported by \fIWindows\fP, if known, or the default X server configuration
+if no matching keyboard configuration was found.
 
 .SH UNDOCUMENTED OPTIONS
 These options are undocumented.  Do not use them.
commit 1ba1b12d24d8f825babd8cf38710c7fa9a94821e
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 13:46:09 2010 +0100

    Xming: Warning fix in winApplyHints()
    
    winmultiwindowwm.c: In function ‘winApplyHints’:
    winmultiwindowwm.c:1587: warning: ISO C90 forbids mixed declarations and code
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 2fcad32..1e21de3 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1553,6 +1553,7 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
   int			format;
   unsigned long		hint = 0, maxmin = 0, style, nitems = 0 , left = 0;
   WindowPtr		pWin = GetProp (hWnd, WIN_WINDOW_PROP);
+  MwmHints              *mwm_hint = NULL;
 
   if (!hWnd) return;
   if (!IsWindow (hWnd)) return;
@@ -1584,7 +1585,6 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
   }
 
   nitems = left = 0;
-  MwmHints *mwm_hint = NULL;
   if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L,
 			 PropMwmHintsElements, False, motif_wm_hints, &type, &format,
 			 &nitems, &left, (unsigned char **)&mwm_hint) == Success)
commit fb64414548c437bf52c3dcd0613aab5079faffba
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 14:19:57 2010 +0100

    Xming: Fix warnings in ProcWindowsWMFrameSetTitle()
    
    winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’:
    winwindowswm.c:516: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness
    winwindowswm.c:516: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness
    winwindowswm.c:528: warning: pointer targets in passing argument 2 of ‘SetWindowTextA’ differ in signedness
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 4027539..c255e49 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -483,7 +483,7 @@ ProcWindowsWMFrameSetTitle(
 			   )
 {
   unsigned int title_length, title_max;
-  unsigned char *title_bytes;
+  char *title_bytes;
   REQUEST(xWindowsWMFrameSetTitleReq);
   WindowPtr pWin;
   win32RootlessWindowPtr pRLWinPriv;
commit da5955cc023ae980fdc0397f6fd541e788040c29
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 14:18:53 2010 +0100

    Xming: Fix warnings in windialogs.c
    
    windialogs.c: In function ‘winDisplayExitDialog’:
    windialogs.c:327: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast
    windialogs.c: In function ‘winDisplayAboutDialog’:
    windialogs.c:597: warning: passing argument 3 of ‘PostMessageA’ makes integer from pointer without a cast
    windialogs.c: In function ‘winAboutDlgProc’:
    windialogs.c:697: warning: comparison between pointer and integer
    windialogs.c:701: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘HINSTANCE’
    windialogs.c:716: warning: assignment makes integer from pointer without a cast
    windialogs.c:736: warning: assignment makes integer from pointer without a cast
    windialogs.c:756: warning: assignment makes integer from pointer without a cast
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 3ec9b78..270ff78 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -324,7 +324,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
   
   /* Set focus to the Cancel button */
   PostMessage (g_hDlgExit, WM_NEXTDLGCTL,
-	       GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
+	       (WPARAM)GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
 }
 
 #define CONNECTED_CLIENTS_FORMAT	"There %s currently %d client%s connected."
@@ -594,7 +594,7 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv)
   
   /* Set focus to the OK button */
   PostMessage (g_hDlgAbout, WM_NEXTDLGCTL,
-	       GetDlgItem (g_hDlgAbout, IDOK), TRUE);
+	       (WPARAM)GetDlgItem (g_hDlgAbout, IDOK), TRUE);
 }
 
 
@@ -675,7 +675,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
 
 	case ID_ABOUT_CHANGELOG:
 	  {
-	    HINSTANCE iReturn;
+	    int iReturn;
 #ifdef __CYGWIN__
 	    const char *	pszCygPath = "/usr/X11R6/share/doc/"
 	      "xorg-x11-xwin/changelog.html";
@@ -688,7 +688,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
 		    "devel/server/changelog.html";
 #endif
 	    
-	    iReturn = ShellExecute (NULL,
+	    iReturn = (int)ShellExecute (NULL,
                                     "open",
                                     pszWinPath,
                                     NULL,
@@ -708,7 +708,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
 	    const char *	pszPath = __VENDORDWEBSUPPORT__;
 	    int			iReturn;
 	    
-	    iReturn = ShellExecute (NULL,
+	    iReturn = (int)ShellExecute (NULL,
                                     "open",
                                     pszPath,
                                     NULL,
@@ -728,7 +728,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
 	    const char *	pszPath = "http://x.cygwin.com/docs/ug/";
 	    int			iReturn;
 	    
-	    iReturn = ShellExecute (NULL,
+	    iReturn = (int)ShellExecute (NULL,
                                     "open",
                                     pszPath,
                                     NULL,
@@ -748,7 +748,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
 	    const char *	pszPath = "http://x.cygwin.com/docs/faq/";
 	    int			iReturn;
 	    
-	    iReturn = ShellExecute (NULL,
+	    iReturn = (int)ShellExecute (NULL,
                                     "open",
                                     pszPath,
                                     NULL,
commit 6d9fb07db210bcfdcdde632fa341c4ee08d44b35
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 14:16:54 2010 +0100

    Xming: Fix warnings in winNameCompare(), winNormalizeName()
    
    winconfig.c: In function ‘winNameCompare’:
    winconfig.c:715: warning: array subscript has type ‘char’
    winconfig.c:715: warning: array subscript has type ‘char’
    winconfig.c:716: warning: array subscript has type ‘char’
    winconfig.c:716: warning: array subscript has type ‘char’
    winconfig.c:730: warning: array subscript has type ‘char’
    winconfig.c:730: warning: array subscript has type ‘char’
    winconfig.c:731: warning: array subscript has type ‘char’
    winconfig.c:731: warning: array subscript has type ‘char’
    winconfig.c: In function ‘winNormalizeName’:
    winconfig.c:1092: warning: array subscript has type ‘char’
    winconfig.c:1093: warning: array subscript has type ‘char’
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index a88b6f1..758c54d 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -712,8 +712,8 @@ winNameCompare (const char *s1, const char *s2)
   while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
     s2++;
 
-  c1 = (isupper (*s1) ? tolower (*s1) : *s1);
-  c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+  c1 = (isupper ((int)*s1) ? tolower ((int)*s1) : *s1);
+  c2 = (isupper ((int)*s2) ? tolower ((int)*s2) : *s2);
 
   while (c1 == c2)
     {
@@ -727,8 +727,8 @@ winNameCompare (const char *s1, const char *s2)
       while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
 	s2++;
 
-      c1 = (isupper (*s1) ? tolower (*s1) : *s1);
-      c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+      c1 = (isupper ((int)*s1) ? tolower ((int)*s1) : *s1);
+      c2 = (isupper ((int)*s2) ? tolower ((int)*s2) : *s2);
     }
   return c1 - c2;
 }
@@ -1089,8 +1089,8 @@ winNormalizeName (const char *s)
 	case '\t':
 	  continue;
 	default:
-	  if (isupper (*p))
-	    *q++ = tolower (*p);
+	  if (isupper ((int)*p))
+	    *q++ = tolower ((int)*p);
 	  else
 	    *q++ = *p;
 	}
commit 20510e51001d1659000c8d8607c0de16022d1c74
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 14:15:51 2010 +0100

    Xming: Fix warnings in winClipboardFlushXEvents()
    
    winclipboardxevents.c: In function ‘winClipboardFlushXEvents’:
    winclipboardxevents.c:225: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’
    winclipboardxevents.c:266: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘DWORD’
    winclipboardxevents.c:619: warning: pointer targets in passing argument 1 of ‘strcat’ differ in signedness
    winclipboardxevents.c:659: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
    winclipboardxevents.c:669: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness
    winclipboardxevents.c:690: warning: pointer targets in passing argument 3 of ‘MultiByteToWideChar’ differ in signedness
    winclipboardxevents.c:698: warning: pointer targets in passing argument 1 of ‘strdup’ differ in signedness
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index edb6ac4..2f042fd 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -76,7 +76,7 @@ winClipboardFlushXEvents (HWND hwnd,
       XEvent			event;
       XSelectionEvent		eventSelection;
       unsigned long		ulReturnBytesLeft;
-      unsigned char		*pszReturnData = NULL;
+      char			*pszReturnData = NULL;
       char			*pszGlobalData = NULL;
       int			iReturn;
       HGLOBAL			hGlobal = NULL;
@@ -221,7 +221,7 @@ winClipboardFlushXEvents (HWND hwnd,
 	  if (!OpenClipboard (hwnd))
 	    {
 	      ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
-		      "OpenClipboard () failed: %08x\n",
+		      "OpenClipboard () failed: %08lx\n",
 		      GetLastError ());
 
 	      /* Abort */
@@ -262,7 +262,7 @@ winClipboardFlushXEvents (HWND hwnd,
 	  if (!hGlobal)
 	    {
 	      ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
-		      "GetClipboardData () failed: %08x\n",
+		      "GetClipboardData () failed: %08lx\n",
 		      GetLastError ());
 
 	      /* Abort */
commit 44c8b449d281c4d984d65f66bac96a65806b2efa
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Oct 15 14:13:57 2010 +0100

    Xming: Fix warning in winClipboardErrorHandler()
    
    winclipboardthread.c: In function ‘winClipboardErrorHandler’:
    winclipboardthread.c:444: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 5d2b948..e7df452 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -437,7 +437,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 		 pszErrorMsg,
 		 sizeof (pszErrorMsg));
   ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n"
-	  "\tSerial: %d, Request Code: %d, Minor Code: %d\n",
+	  "\tSerial: %lu, Request Code: %d, Minor Code: %d\n",
 	  pszErrorMsg,
 	  pErr->serial,
 	  pErr->request_code,
commit 1f2a57d9e46424a2e0861f55253b91d930d79083
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Oct 15 14:12:22 2010 +0100

    Cygwin/X: Turn off the bad-function-cast warning for XWin code
    
    Turn off the bad-function-cast warning for the XWin code, it's near impossible
    to write code which uses Win32 API calls that doesn't trigger this warning
    
    For example, SendMessage(WM_SETICON) returns an LRESULT, but we are supposed to
    know this is safe to cast this result to a HICON, which gcc considers a non-matching
    type.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 58df308..232d65e 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -162,7 +162,8 @@ AM_YFLAGS = -d
 AM_LFLAGS = -i
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             $(XWINMODULES_CFLAGS) \
-            -I$(top_srcdir)
+            -I$(top_srcdir) \
+            -Wno-bad-function-cast
 
 MAN_SRCS = XWin.man.pre XWinrc.man.pre
 
commit 55e528b6cc6451dbb1e65baec199d4df0441e86d
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Mar 25 23:39:37 2010 +0000

    Cygwin/X: Remove execute permission from source files
    
    Remove execute permission from source files
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/XWinrc.man.pre b/hw/xwin/XWinrc.man.pre
old mode 100755
new mode 100644
diff --git a/hw/xwin/glx/glwrap.c b/hw/xwin/glx/glwrap.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h
old mode 100755
new mode 100644
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
old mode 100755
new mode 100644
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
old mode 100755
new mode 100644
commit b2b685e2693ff5f089006f5b3882d6b0c0853862
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Mar 25 23:00:48 2010 +0000

    Cygwin/X: unifdef XFree86Server
    
    Remove XFree86Server define, which was always on anyhow, and the
    code which was guarded by !XFree86Server
    
    This completes the process of removal started in 2006 :-)
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 03cb808..58df308 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -162,7 +162,6 @@ AM_YFLAGS = -d
 AM_LFLAGS = -i
 AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             $(XWINMODULES_CFLAGS) \
-            -DXFree86Server \
             -I$(top_srcdir)
 
 MAN_SRCS = XWin.man.pre XWinrc.man.pre
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index 342f20d..5e1f756 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -36,14 +36,12 @@
 #endif
 #include "win.h"
 
-#if defined(XFree86Server)
 #include "inputstr.h"
 #include "exevents.h" /* for button/axes labels */
 #include "xserver-properties.h"
 
 /* Peek the internal button mapping */
 static CARD8 const *g_winMouseButtonMap = NULL;
-#endif
 
 
 /*
@@ -123,9 +121,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
       free(map);
       free(btn_labels);
 
-#if defined(XFree86Server)
       g_winMouseButtonMap = pDeviceInt->button->map;
-#endif
       break;
 
     case DEVICE_ON:
@@ -133,9 +129,8 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
       break;
 
     case DEVICE_CLOSE:
-#if defined(XFree86Server)
       g_winMouseButtonMap = NULL;
-#endif
+
     case DEVICE_OFF:
       pDevice->on = FALSE;
       break;
@@ -241,10 +236,8 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
   EventListPtr events;
   int i, nevents;
 
-#if defined(XFree86Server)
   if (g_winMouseButtonMap)
     iButton = g_winMouseButtonMap[iButton];
-#endif
 
   GetEventList(&events);
   nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton,
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 8dd1084..5752730 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -828,7 +828,6 @@ winInitVisualsShadowDD (ScreenPtr pScreen)
     case 24:
     case 16:
     case 15:
-#if defined(XFree86Server)
       /* Create the real visual */
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     TrueColorMask,
@@ -861,42 +860,9 @@ winInitVisualsShadowDD (ScreenPtr pScreen)
 	  return FALSE;
 	}
 #endif
-#else /* XFree86Server */
-      /* Create the real visual */
-      if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     TrueColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
-		  "failed for TrueColor\n");
-	  return FALSE;
-	}
-
-#ifdef XWIN_EMULATEPSEUDO
-      if (!pScreenInfo->fEmulatePseudo)
-	break;
-
-      /* Setup a pseudocolor visual */
-      if (!fbSetVisualTypesAndMasks (8,
-				     PseudoColorMask,
-				     8,
-				     0,
-				     0,
-				     0))
-	{
-	  ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
-		  "failed for PseudoColor\n");
-	  return FALSE;
-	}
-#endif
-#endif /* XFree86Server */
       break;
 
     case 8:
-#if defined(XFree86Server)
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     pScreenInfo->fFullScreen 
 				     ? PseudoColorMask : StaticColorMask,
@@ -911,20 +877,6 @@ winInitVisualsShadowDD (ScreenPtr pScreen)
 		  "failed\n");
 	  return FALSE;
 	}
-#else /* XFree86Server */
-      if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     pScreenInfo->fFullScreen 
-				     ? PseudoColorMask : StaticColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
-		  "failed\n");
-	  return FALSE;
-	}
-#endif /* XFree86Server */
       break;
 
     default:
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 5ca3e4f..0d59e6a 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -883,7 +883,6 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen)
     case 24:
     case 16:
     case 15:
-#if defined(XFree86Server)
       /* Setup the real visual */
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     TrueColorMask,
@@ -916,42 +915,9 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen)
 	  return FALSE;
 	}
 #endif
-#else /* XFree86Server */
-      /* Setup the real visual */
-      if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     TrueColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
-		  "failed for TrueColor\n");
-	  return FALSE;
-	}
-
-#ifdef XWIN_EMULATEPSEUDO
-      if (!pScreenInfo->fEmulatePseudo)
-	break;
-
-      /* Setup a pseudocolor visual */
-      if (!fbSetVisualTypesAndMasks (8,
-				     PseudoColorMask,
-				     8,
-				     0,
-				     0,
-				     0))
-	{
-	  ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
-		  "failed for PseudoColor\n");
-	  return FALSE;
-	}
-#endif
-#endif /* XFree86Server */
       break;
 
     case 8:
-#if defined(XFree86Server)
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     pScreenInfo->fFullScreen 
 				     ? PseudoColorMask : StaticColorMask,
@@ -966,20 +932,6 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen)
 		  "failed\n");
 	  return FALSE;
 	}
-#else /* XFree86Server */
-        if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     pScreenInfo->fFullScreen 
-				     ? PseudoColorMask : StaticColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
-		  "failed\n");
-	  return FALSE;
-	}    
-#endif /* XFree86Server */
       break;
 
     default:
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 96d149c..8af4be4 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -715,7 +715,6 @@ winInitVisualsShadowGDI (ScreenPtr pScreen)
     case 24:
     case 16:
     case 15:
-#if defined(XFree86Server)
       /* Setup the real visual */
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     TrueColorMask,
@@ -748,42 +747,9 @@ winInitVisualsShadowGDI (ScreenPtr pScreen)
 	  return FALSE;
 	}
 #endif
-#else /* XFree86Server */
-      /* Setup the real visual */
-      if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     TrueColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
-		  "failed for TrueColor\n");
-	  return FALSE;
-	}
-
-#ifdef XWIN_EMULATEPSEUDO
-      if (!pScreenInfo->fEmulatePseudo)
-	break;
-
-      /* Setup a pseudocolor visual */
-      if (!fbSetVisualTypesAndMasks (8,
-				     PseudoColorMask,
-				     8,
-				     0,
-				     0,
-				     0))
-	{
-	  ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
-		  "failed for PseudoColor\n");
-	  return FALSE;
-	}
-#endif
-#endif /* XFree86Server */
       break;
 
     case 8:
-#if defined(XFree86Server)
       if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
 				     PseudoColorMask,
 				     pScreenPriv->dwBitsPerRGB,
@@ -796,19 +762,6 @@ winInitVisualsShadowGDI (ScreenPtr pScreen)
 		  "failed\n");
 	  return FALSE;
 	}
-#else /* XFree86Server */
-      if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
-				     PseudoColorMask,
-				     pScreenPriv->dwBitsPerRGB,
-				     pScreenPriv->dwRedMask,
-				     pScreenPriv->dwGreenMask,
-				     pScreenPriv->dwBlueMask))
-	{
-	  ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
-		  "failed\n");
-	  return FALSE;
-	}
-#endif
       break;
 
     default:
commit 9ed70f15eff6a85222b46db1fe7af25154314464
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Nov 2 17:37:14 2009 +0000

    Cygwin/X: Use normal apostrophe in XWin DDX help text
    
    Use U+0027 APOSTROPHE in XWin DDX help text, rather than
    U+2019 RIGHT SINGLE QUOTATION MARK
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 73cc263..445549a 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -873,7 +873,7 @@ winUseMsg (void)
 
   ErrorF ("-silent-dup-error\n"
 	  "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n"
-     "\texit silently and don’t display any error message.\n");
+	  "\texit silently and don't display any error message.\n");
 
   ErrorF ("-swcursor\n"
 	  "\tDisable the usage of the Windows cursor and use the X11 software\n"
commit 9f8f056a21b9480fd9fd43a22c9d6f45a2c1ef87
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue Mar 23 16:34:26 2010 +0000

    Cygwin/X: Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft
    
    Cleanup some VENDOR_STRING/VENDOR_CONTACT cruft
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index cb69c57..01412dd 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -31,10 +31,6 @@
 #ifdef HAVE_XWIN_CONFIG_H
 #include <xwin-config.h>
 #endif
-#ifdef XVENDORNAME
-#define VENDOR_STRING XVENDORNAME
-#define VENDOR_CONTACT BUILDERADDR
-#endif
 
 #include <../xfree86/common/xorgVersion.h>
 #include "win.h"
@@ -129,11 +125,12 @@ winMessageBoxF (const char *pszError, UINT uType, ...)
 	"%s\n"
 
   pszMsgBox = Xprintf (MESSAGEBOXF,
-	   pszErrorF, VENDOR_STRING,
+                       pszErrorF, XVENDORNAME,
 		       XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT,
-		       VENDOR_CONTACT,
+		       BUILDERADDR,
 		       BUILDERSTRING,
-	   g_pszCommandLine);
+		       g_pszCommandLine);
+
   if (!pszMsgBox)
     goto winMessageBoxF_Cleanup;
 
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 66a0503..fea5797 100755
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -30,10 +30,7 @@ from The Open Group.
 #ifdef HAVE_XWIN_CONFIG_H
 #include <xwin-config.h>
 #endif
-#ifdef XVENDORNAME
-#define VENDOR_STRING XVENDORNAME
-#define VENDOR_CONTACT BUILDERADDR
-#endif
+
 #include <../xfree86/common/xorgVersion.h>
 #include "win.h"
 #include "winconfig.h"
@@ -1248,10 +1245,10 @@ winLogVersionInfo (void)
   s_fBeenHere = TRUE;
 
   ErrorF ("Welcome to the XWin X Server\n");
-  ErrorF ("Vendor: %s\n", VENDOR_STRING);
+  ErrorF ("Vendor: %s\n", XVENDORNAME);
   ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT);
   ErrorF ("%s\n\n", BUILDERSTRING);
-  ErrorF ("Contact: %s\n", VENDOR_CONTACT);
+  ErrorF ("Contact: %s\n", BUILDERADDR);
 }
 
 /*
commit 5aff712a8d2eb9f965ecbb93216cc0bcdc327ae6
Merge: 5b98c62... e354cca...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Oct 18 17:16:23 2010 -0700

    Merge remote branch 'whot/for-keith'

commit 5b98c6267f575ec4ff498ecb651e34dbff030b83
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 16:01:40 2010 -0400

    randr: Remove mirandr
    
    This isn't used anywhere, not least because it's completely
    nonfunctional.
    
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/randr/Makefile.am b/randr/Makefile.am
index 1f1bea0..de338b9 100644
--- a/randr/Makefile.am
+++ b/randr/Makefile.am
@@ -9,7 +9,6 @@ sdk_HEADERS = randrstr.h rrtransform.h
 endif
 
 librandr_la_SOURCES =	\
-	mirandr.c	\
 	randr.c		\
 	randrstr.h	\
 	rrcrtc.c	\
diff --git a/randr/mirandr.c b/randr/mirandr.c
deleted file mode 100644
index 05375e4..0000000
--- a/randr/mirandr.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright © 2000 Compaq Computer Corporation
- * Copyright © 2002 Hewlett-Packard Company
- * Copyright © 2006 Intel Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  The copyright holders make no representations
- * about the suitability of this software for any purpose.  It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- *
- * Author:  Jim Gettys, Hewlett-Packard Company, Inc.
- *	    Keith Packard, Intel Corporation
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "scrnintstr.h"
-#include "mi.h"
-#include "randrstr.h"
-#include <stdio.h>
-
-Bool
-miRRGetInfo (ScreenPtr pScreen, Rotation *rotations)
-{
-    return TRUE;
-}
-
-/*
- * Any hardware that can actually change anything will need something
- * different here
- */
-Bool
-miRRCrtcSet (ScreenPtr	pScreen,
-	     RRCrtcPtr	crtc,
-	     RRModePtr	mode,
-	     int	x,
-	     int	y,
-	     Rotation	rotation,
-	     int	numOutput,
-	     RROutputPtr *outputs)
-{
-    return TRUE;
-}
-
-static Bool
-miRRCrtcSetGamma (ScreenPtr	pScreen,
-		  RRCrtcPtr	crtc)
-{
-    return TRUE;
-}
-
-Bool
-miRROutputSetProperty (ScreenPtr	    pScreen,
-		       RROutputPtr	    output,
-		       Atom		    property,
-		       RRPropertyValuePtr   value)
-{
-    return TRUE;
-}
-
-Bool
-miRROutputGetProperty (ScreenPtr	    pScreen,
-		       RROutputPtr	    output,
-		       Atom		    property)
-{
-	return TRUE;
-}
-
-Bool
-miRROutputValidateMode (ScreenPtr	    pScreen,
-			RROutputPtr	    output,
-			RRModePtr	    mode)
-{
-    return FALSE;
-}
-
-void
-miRRModeDestroy (ScreenPtr  pScreen,
-		 RRModePtr  mode)
-{
-}
-
-/*
- * This function assumes that only a single depth can be
- * displayed at a time, but that all visuals of that depth
- * can be displayed simultaneously.  It further assumes that
- * only a single size is available.  Hardware providing
- * additional capabilties should use different code.
- * XXX what to do here....
- */
-
-Bool
-miRandRInit (ScreenPtr pScreen)
-{
-    rrScrPrivPtr    pScrPriv;
-#if RANDR_12_INTERFACE
-    RRModePtr	mode;
-    RRCrtcPtr	crtc;
-    RROutputPtr	output;
-    xRRModeInfo modeInfo;
-    char	name[64];
-#endif
-    
-    if (!RRScreenInit (pScreen))
-	return FALSE;
-    pScrPriv = rrGetScrPriv(pScreen);
-    pScrPriv->rrGetInfo = miRRGetInfo;
-#if RANDR_12_INTERFACE
-    pScrPriv->rrCrtcSet = miRRCrtcSet;
-    pScrPriv->rrCrtcSetGamma = miRRCrtcSetGamma;
-    pScrPriv->rrOutputSetProperty = miRROutputSetProperty;
-#if RANDR_13_INTERFACE
-    pScrPriv->rrOutputGetProperty = miRROutputGetProperty;
-#endif
-    pScrPriv->rrOutputValidateMode = miRROutputValidateMode;
-    pScrPriv->rrModeDestroy = miRRModeDestroy;
-    
-    RRScreenSetSizeRange (pScreen,
-			  pScreen->width, pScreen->height,
-			  pScreen->width, pScreen->height);
-
-    sprintf (name, "%dx%d", pScreen->width, pScreen->height);
-    memset (&modeInfo, '\0', sizeof (modeInfo));
-    modeInfo.width = pScreen->width;
-    modeInfo.height = pScreen->height;
-    modeInfo.nameLength = strlen (name);
-    
-    mode = RRModeGet (&modeInfo, name);
-    if (!mode)
-	return FALSE;
-    
-    crtc = RRCrtcCreate (pScreen, NULL);
-    if (!crtc)
-	return FALSE;
-    
-    output = RROutputCreate (pScreen, "screen", 6, NULL);
-    if (!output)
-	return FALSE;
-    if (!RROutputSetClones (output, NULL, 0))
-	return FALSE;
-    if (!RROutputSetModes (output, &mode, 1, 0))
-	return FALSE;
-    if (!RROutputSetCrtcs (output, &crtc, 1))
-	return FALSE;
-    if (!RROutputSetConnection (output, RR_Connected))
-	return FALSE;
-    RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);
-#endif
-    return TRUE;
-}
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 03652ef..7ea6080 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -441,43 +441,6 @@ ProcRRGetScreenInfo (ClientPtr client);
 extern _X_EXPORT void
 RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
     
-/* mirandr.c */
-extern _X_EXPORT Bool
-miRandRInit (ScreenPtr pScreen);
-
-extern _X_EXPORT Bool
-miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
-
-extern _X_EXPORT Bool
-miRRCrtcSet (ScreenPtr	pScreen,
-	     RRCrtcPtr	crtc,
-	     RRModePtr	mode,
-	     int	x,
-	     int	y,
-	     Rotation	rotation,
-	     int	numOutput,
-	     RROutputPtr *outputs);
-
-extern _X_EXPORT Bool
-miRROutputSetProperty (ScreenPtr	    pScreen,
-		       RROutputPtr	    output,
-		       Atom		    property,
-		       RRPropertyValuePtr   value);
-
-extern _X_EXPORT Bool
-miRROutputGetProperty (ScreenPtr	    pScreen,
-		       RROutputPtr	    output,
-		       Atom		    property);
-
-extern _X_EXPORT Bool
-miRROutputValidateMode (ScreenPtr	    pScreen,
-			RROutputPtr	    output,
-			RRModePtr	    mode);
-
-extern _X_EXPORT void
-miRRModeDestroy (ScreenPtr  pScreen,
-		 RRModePtr  mode);
-
 /* randr.c */
 /*
  * Send all pending events
commit 7bb653bedceb6180a0361ead1c612839e776ce98
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Oct 18 15:59:35 2010 -0400

    modes: improve aspect ratio match for classic drivers
    
    After we infer the aspect ratio for the screen, we pick the largest
    mode matching that aspect ratio from the best mode pool available.
    We then clamp virtual size to that mode, and run the resulting mode
    list through the driver's ValidMode hook.  In doing so we might filter
    away our initial guess.  If this happens we shrink the default mode
    to the next largest mode from _any_ mode pool.  This is usually wrong,
    and we should instead pick the next aspect-matched mode from the best
    available mode pool (as always, user then driver then default).
    
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 7bdf79a..d03310e 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1831,8 +1831,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 	numModes++;
     }
 
-#undef _VIRTUALX
-
     /*
      * If we estimated the virtual size above, we may have filtered away all
      * the modes that maximally match that size; scan again to find out and
@@ -1847,13 +1845,69 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 	    }
 	}
 	if (vx < virtX || vy < virtY) {
+	    const int types[] = {
+		M_T_BUILTIN | M_T_PREFERRED,
+		M_T_BUILTIN,
+		M_T_DRIVER | M_T_PREFERRED,
+		M_T_DRIVER,
+		0
+	    };
+	    const int ntypes = sizeof(types) / sizeof(int);
+	    int n;
+
+	    /* 
+	     * We did not find the estimated virtual size. So now we want to 
+	     * find the largest mode available, but we want to search in the
+	     * modes in the order of "types" listed above.
+	     */
+	    for (n = 0; n < ntypes; n++) {
+		int type = types[n];
+
+		vx = 0; vy = 0;
+		for (p = scrp->modes; p; p = p->next) {
+		    /* scan through the modes in the sort order above */
+		    if ((p->type & type) != type)
+			continue;
+		    if (p->HDisplay > vx && p->VDisplay > vy) {
+			vx = p->HDisplay;
+			vy = p->VDisplay;
+		    }
+		}
+		if (vx && vy)
+		    /* Found one */
+		    break;
+	    }
 	    xf86DrvMsg(scrp->scrnIndex, X_WARNING,
 		       "Shrinking virtual size estimate from %dx%d to %dx%d\n",
 		       virtX, virtY, vx, vy);
-	    virtX = vx;
+	    virtX = _VIRTUALX(vx);
 	    virtY = vy;
-	    linePitch = scanLineWidth(vx, vy, minPitch, apertureSize,
-				      BankFormat, pitchInc);
+	    for (p = scrp->modes; p; p = p->next) {
+		if (numModes > 0) {
+		    if (p->HDisplay > virtX)
+			p->status = MODE_VIRTUAL_X;
+		    if (p->VDisplay > virtY)
+			p->status = MODE_VIRTUAL_Y;
+		    if (p->status != MODE_OK) {
+			numModes--;
+			printModeRejectMessage(scrp->scrnIndex, p, p->status);
+		    }
+		}
+	    }
+	    if (linePitches != NULL) {
+		for (i = 0; linePitches[i] != 0; i++) {
+		    if ((linePitches[i] >= virtX) &&
+			(linePitches[i] ==
+			scanLineWidth(virtX, virtY, linePitches[i],
+				      apertureSize, BankFormat, pitchInc))) {
+			linePitch = linePitches[i];
+			break;
+		    }
+		}
+	    } else {
+		linePitch = scanLineWidth(virtX, virtY, minPitch,
+					  apertureSize, BankFormat, pitchInc);
+	    }
 	}
     }
 
commit d6d90a4fccef086e7c7934adea901b2cd9a595bf
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:53:43 2010 -0400

    composite: Move the backfill comment to a more appropriate indent level
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index f0d868e..47d5c0a 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -514,14 +514,14 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
     if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH)
 	return pPixmap;
 
+    /*
+     * Copy bits from the parent into the new pixmap so that it will
+     * have "reasonable" contents in case for background None areas.
+     */
     if (pParent->drawable.depth == pWin->drawable.depth)
     {
 	GCPtr	pGC = GetScratchGC (pWin->drawable.depth, pScreen);
 	
-	/*
-	 * Copy bits from the parent into the new pixmap so that it will
-	 * have "reasonable" contents in case for background None areas.
-	 */
 	if (pGC)
 	{
 	    ChangeGCVal val;
commit db8840600e8e21356241eb87395031388d9b54d2
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:52:52 2010 -0400

    composite: Don't backfill non-MapWindow allocations
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 253acb3..f0d868e 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -484,7 +484,7 @@ bgNoneVisitWindow(WindowPtr pWin, void *null)
 }
 
 static PixmapPtr
-compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
+compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
 {
     ScreenPtr	    pScreen = pWin->drawable.pScreen;
     WindowPtr	    pParent = pWin->parent;
@@ -499,6 +499,10 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
     pPixmap->screen_x = x;
     pPixmap->screen_y = y;
 
+    /* resize allocations will update later in compCopyWindow, not here */
+    if (!map)
+	return pPixmap;
+
     /*
      * If there's no bg=None in the tree, we're done.
      *
@@ -580,7 +584,7 @@ compAllocPixmap (WindowPtr pWin)
     int		    y = pWin->drawable.y - bw;
     int		    w = pWin->drawable.width + (bw << 1);
     int		    h = pWin->drawable.height + (bw << 1);
-    PixmapPtr	    pPixmap = compNewPixmap (pWin, x, y, w, h);
+    PixmapPtr	    pPixmap = compNewPixmap (pWin, x, y, w, h, TRUE);
     CompWindowPtr   cw = GetCompWindow (pWin);
 
     if (!pPixmap)
@@ -654,7 +658,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y,
     pix_h = h + (bw << 1);
     if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height)
     {
-	pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h);
+	pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h, FALSE);
 	if (!pNew)
 	    return FALSE;
 	cw->pOldPixmap = pOld;
commit 6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:50:37 2010 -0400

    composite: Don't backfill non-bg-None windows
    
    If there's a defined background then backfilling is a waste of effort,
    since exposure processing will paint that in for us.  But note that we
    have to backfill if any children are bg=None to preserve semantics with
    non-composited servers.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/composite/compalloc.c b/composite/compalloc.c
index d8ccc11..253acb3 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -472,6 +472,17 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin)
     return Success;
 }
 
+static int
+bgNoneVisitWindow(WindowPtr pWin, void *null)
+{
+    if (pWin->backgroundState != BackgroundPixmap)
+	return WT_WALKCHILDREN;
+    if (pWin->background.pixmap != None)
+	return WT_WALKCHILDREN;
+
+    return WT_STOPWALKING;
+}
+
 static PixmapPtr
 compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
 {
@@ -487,7 +498,18 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
     
     pPixmap->screen_x = x;
     pPixmap->screen_y = y;
-    
+
+    /*
+     * If there's no bg=None in the tree, we're done.
+     *
+     * We could optimize this more by collection the regions of all the
+     * bg=None subwindows and feeding that in as the clip for the
+     * CopyArea below, but since window trees are shallow these days it
+     * might not be worth the effort.
+     */
+    if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH)
+	return pPixmap;
+
     if (pParent->drawable.depth == pWin->drawable.depth)
     {
 	GCPtr	pGC = GetScratchGC (pWin->drawable.depth, pScreen);
commit d2064fbb687839c297a851a5d85f32dfbbe4a0d5
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:42:54 2010 -0400

    ddc: Don't probe for DDC/CI or EEPROM
    
    For whatever reason, some (broken) monitors will crash if you do this.
    We're not actually using this information for anything, so let's just
    not do it.
    
    Originally reported as http://bugzilla.redhat.com/620333
    
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c
index 2d9d4dc..7c7dc9c 100644
--- a/hw/xfree86/ddc/ddc.c
+++ b/hw/xfree86/ddc/ddc.c
@@ -314,10 +314,6 @@ DDC2Init(int scrnIndex, I2CBusPtr pBus)
     dev = DDC2MakeDevice(pBus, 0x00A0, "ddc2");
     if (xf86I2CProbeAddress(pBus, 0x0060))
 	DDC2MakeDevice(pBus, 0x0060, "E-EDID segment register");
-    if (xf86I2CProbeAddress(pBus, 0x0062))
-	DDC2MakeDevice(pBus, 0x0062, "EDID EEPROM interface");
-    if (xf86I2CProbeAddress(pBus, 0x006E))
-	DDC2MakeDevice(pBus, 0x006E, "DDC control interface");
 
     return dev;
 }
commit 47c91dca8d8eecb429123e8370302831bcd57938
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:40:28 2010 -0400

    xfree86: Drop linux libc5 support from the SIGIO code
    
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index aed5654..274a8ab 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -1,4 +1,3 @@
-
 /* sigio.c -- Support for SIGIO handler installation and removal
  * Created: Thu Jun  3 15:39:18 1999 by faith at precisioninsight.com
  *
@@ -67,14 +66,6 @@
 # include <stropts.h>
 #endif
 
-/*
- * Linux libc5 defines FASYNC, but not O_ASYNC.  Don't know if it is
- * functional or not.
- */
-#if defined(FASYNC) && !defined(O_ASYNC)
-#  define O_ASYNC FASYNC
-#endif
-
 #ifdef MAXDEVICES
 /* MAXDEVICES represents the maximimum number of input devices usable
  * at the same time plus one entry for DRM support.
commit 788bfbf18ac19923604b0d676933fdc0d78526a1
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 14 15:10:43 2010 -0400

    dri1: Remove "buffers" from the config logic
    
    This was only ever used from the glint driver, which has since lost its
    DRI support.
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 0370643..92fb74d 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2211,15 +2211,11 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
 static void
 configDRI(XF86ConfDRIPtr drip)
 {
-    int                count = 0;
-    XF86ConfBuffersPtr bufs;
     int                i;
     struct group       *grp;
 
     xf86ConfigDRI.group      = -1;
     xf86ConfigDRI.mode       = 0;
-    xf86ConfigDRI.bufs_count = 0;
-    xf86ConfigDRI.bufs       = NULL;
 
     if (drip) {
 	if (drip->dri_group_name) {
@@ -2230,24 +2226,6 @@ configDRI(XF86ConfDRIPtr drip)
 		xf86ConfigDRI.group = drip->dri_group;
 	}
 	xf86ConfigDRI.mode = drip->dri_mode;
-	for (bufs = drip->dri_buffers_lst; bufs; bufs = bufs->list.next)
-	    ++count;
-	
-	xf86ConfigDRI.bufs_count = count;
-	xf86ConfigDRI.bufs = xnfalloc(count * sizeof(*xf86ConfigDRI.bufs));
-	
-	for (i = 0, bufs = drip->dri_buffers_lst;
-	     i < count;
-	     i++, bufs = bufs->list.next) {
-	    
-	    xf86ConfigDRI.bufs[i].count = bufs->buf_count;
-	    xf86ConfigDRI.bufs[i].size  = bufs->buf_size;
-				/* FIXME: Flags not implemented.  These
-                                   could be used, for example, to specify a
-                                   contiguous block and/or write-combining
-                                   cache policy. */
-	    xf86ConfigDRI.bufs[i].flags = 0;
-	}
     }
 }
 #endif
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
index 12b8d1d..f51f6b9 100644
--- a/hw/xfree86/parser/DRI.c
+++ b/hw/xfree86/parser/DRI.c
@@ -41,58 +41,10 @@ static xf86ConfigSymTabRec DRITab[] =
 {
     {ENDSECTION, "endsection"},
     {GROUP,      "group"},
-    {BUFFERS,    "buffers"},
     {MODE,       "mode"},
     {-1,         ""},
 };
 
-#define CLEANUP xf86freeBuffersList
-
-static void
-xf86freeBuffersList (XF86ConfBuffersPtr ptr)
-{
-    XF86ConfBuffersPtr prev;
-
-    while (ptr) {
-	TestFree (ptr->buf_flags);
-	TestFree (ptr->buf_comment);
-	prev = ptr;
-	ptr  = ptr->list.next;
-	free (prev);
-    }
-}
-
-static XF86ConfBuffersPtr
-xf86parseBuffers (void)
-{
-    int token;
-    parsePrologue (XF86ConfBuffersPtr, XF86ConfBuffersRec)
-
-    if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
-	Error ("Buffers count expected", NULL);
-    ptr->buf_count = val.num;
-
-    if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
-	Error ("Buffers size expected", NULL);
-    ptr->buf_size = val.num;
-
-    if ((token = xf86getSubToken (&(ptr->buf_comment))) == STRING) {
-	ptr->buf_flags = val.str;
-	if ((token = xf86getToken (NULL)) == COMMENT)
-	    ptr->buf_comment = xf86addComment(ptr->buf_comment, val.str);
-	else
-	    xf86unGetToken(token);
-    }
-
-#ifdef DEBUG
-    printf ("Buffers parsed\n");
-#endif
-
-    return ptr;
-}
-
-#undef CLEANUP
-	
 #define CLEANUP xf86freeDRI
 
 XF86ConfDRIPtr
@@ -121,10 +73,6 @@ xf86parseDRISection (void)
                     Error (MUST_BE_OCTAL_MSG, val.num);
 		ptr->dri_mode = val.num;
 		break;
-	    case BUFFERS:
-		HANDLE_LIST (dri_buffers_lst, xf86parseBuffers,
-			     XF86ConfBuffersPtr);
-		break;
 	    case EOF_TOKEN:
 		Error (UNEXPECTED_EOF_MSG, NULL);
 		break;
@@ -149,8 +97,6 @@ xf86parseDRISection (void)
 void
 xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr)
 {
-    XF86ConfBuffersPtr bufs;
-    
     if (ptr == NULL)
 	return;
     
@@ -163,15 +109,6 @@ xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr)
 	fprintf (cf, "\tGroup        %d\n", ptr->dri_group);
     if (ptr->dri_mode)
 	fprintf (cf, "\tMode         0%o\n", ptr->dri_mode);
-    for (bufs = ptr->dri_buffers_lst; bufs; bufs = bufs->list.next) {
-	fprintf (cf, "\tBuffers      %d %d",
-		 bufs->buf_count, bufs->buf_size);
-	if (bufs->buf_flags) fprintf (cf, " \"%s\"", bufs->buf_flags);
-	if (bufs->buf_comment)
-	    fprintf(cf, "%s", bufs->buf_comment);
-	else
-	    fprintf (cf, "\n");
-    }
     fprintf (cf, "EndSection\n\n");
 }
 
@@ -181,7 +118,6 @@ xf86freeDRI (XF86ConfDRIPtr ptr)
     if (ptr == NULL)
 	return;
     
-    xf86freeBuffersList (ptr->dri_buffers_lst);
     TestFree (ptr->dri_comment);
     free (ptr);
 }
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 337ad07..9f0a602 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -442,20 +442,9 @@ XF86ConfVendorRec, *XF86ConfVendorPtr;
 
 typedef struct
 {
-	GenericListRec list;
-	int buf_count;
-	int buf_size;
-	char *buf_flags;
-	char *buf_comment;
-}
-XF86ConfBuffersRec, *XF86ConfBuffersPtr;
-
-typedef struct
-{
 	char *dri_group_name;
 	int dri_group;
 	int dri_mode;
-	XF86ConfBuffersPtr dri_buffers_lst;
 	char *dri_comment;
 }
 XF86ConfDRIRec, *XF86ConfDRIPtr;
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index c16a8f5..ec04e4c 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -273,7 +273,6 @@ typedef enum {
 
     /* DRI Tokens */
     GROUP,
-    BUFFERS,
 
     /* InputClass Tokens */
     MATCH_PRODUCT,
commit a77458486a7b9d78dcd284e2bcc96c1fda0e862a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 14 14:00:53 2010 -0400

    xfree86: Remove %M expansion from config parser
    
    This was to distinguish XFree86 3.x files from XFree86 4.x files.  It
    never really made sense to be looking for xorg.conf-4.
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Jesse Adkins <jesserayadkins at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index a63f487..0370643 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -78,19 +78,19 @@ extern DeviceAssocRec mouse_assoc;
 			"/etc/X11/%R," "%P/etc/X11/%R," \
 			"%E," "%F," \
 			"/etc/X11/%F," "%P/etc/X11/%F," \
-			"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
-			"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
+			"/etc/X11/%X," "/etc/%X," \
+			"%P/etc/X11/%X.%H," \
 			"%P/etc/X11/%X," \
-			"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+			"%P/lib/X11/%X.%H," \
 			"%P/lib/X11/%X"
 #endif
 #ifndef USER_CONFIGPATH
 #define USER_CONFIGPATH	"/etc/X11/%S," "%P/etc/X11/%S," \
 			"/etc/X11/%G," "%P/etc/X11/%G," \
-			"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
-			"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
+			"/etc/X11/%X," "/etc/%X," \
+			"%P/etc/X11/%X.%H," \
 			"%P/etc/X11/%X," \
-			"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+			"%P/lib/X11/%X.%H," \
 			"%P/lib/X11/%X"
 #endif
 #ifndef ROOT_CONFIGDIRPATH
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 6b3636f..cbfea7d 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -39,14 +39,11 @@ server is started as a normal user:
 .IR __projectroot__/etc/X11/ <cmdline>
 .IB /etc/X11/ $XORGCONFIG
 .IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__\-4
 .I /etc/X11/__xconfigfile__
 .I /etc/__xconfigfile__
 .IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__\-4
 .I __projectroot__/etc/X11/__xconfigfile__
 .IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__\-4
 .I __projectroot__/lib/X11/__xconfigfile__
 .fi
 .RE
@@ -74,14 +71,11 @@ search locations are as follows:
 .B $XORGCONFIG
 .IB /etc/X11/ $XORGCONFIG
 .IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__\-4
 .I /etc/X11/__xconfigfile__
 .I /etc/__xconfigfile__
 .IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__\-4
 .I __projectroot__/etc/X11/__xconfigfile__
 .IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__\-4
 .I __projectroot__/lib/X11/__xconfigfile__
 .fi
 .RE
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 97cd79c..e4fce30 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -554,7 +554,6 @@ xf86pathIsSafe(const char *path)
  *    %P    projroot
  *    %C    sysconfdir
  *    %D    datadir
- *    %M    config file format version number
  *    %%    %
  */
 
@@ -579,11 +578,6 @@ xf86pathIsSafe(const char *path)
 #ifndef XCONFENV
 #define XCONFENV	"XORGCONFIG"
 #endif
-/* xorg.conf is based on XF86Config version 4.   If we ever break
-   compatibility of the xorg.conf syntax, we'll bump this version number. */
-#ifndef CONFIG_FILE_VERSION
-#define CONFIG_FILE_VERSION	4
-#endif
 
 #define BAIL_OUT		do {									\
 							free(result);				\
@@ -614,7 +608,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
 	int i, l;
 	static const char *env = NULL;
 	static char *hostname = NULL;
-	static char majorvers[3] = "";
 
 	if (!template)
 		return NULL;
@@ -715,13 +708,6 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
 			case 'D':
 				APPEND_STR(DATADIR);
 				break;
-			case 'M':
-				if (!majorvers[0]) {
-					snprintf(majorvers, sizeof(majorvers),
-						 "%d", CONFIG_FILE_VERSION);
-				}
-				APPEND_STR(majorvers);
-				break;
 			case '%':
 				result[l++] = '%';
 				CHECK_LENGTH;
commit f8ec71603c796f3b272a0592cbb934c2a6e8d633
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 14 13:45:31 2010 -0400

    xfree86: Remove an open-coded strtoul()
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index e609bdf..97cd79c 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -115,53 +115,6 @@ static int pushToken = LOCK_TOKEN;
 static int eol_seen = 0;		/* private state to handle comments */
 LexRec val;
 
-/* 
- * xf86strToUL --
- *
- *  A portable, but restricted, version of strtoul().  It only understands
- *  hex, octal, and decimal.  But it's good enough for our needs.
- */
-static unsigned int
-xf86strToUL (char *str)
-{
-	int base = 10;
-	char *p = str;
-	unsigned int tot = 0;
-
-	if (*p == '0')
-	{
-		p++;
-		if ((*p == 'x') || (*p == 'X'))
-		{
-			p++;
-			base = 16;
-		}
-		else
-			base = 8;
-	}
-	while (*p)
-	{
-		if ((*p >= '0') && (*p <= ((base == 8) ? '7' : '9')))
-		{
-			tot = tot * base + (*p - '0');
-		}
-		else if ((base == 16) && (*p >= 'a') && (*p <= 'f'))
-		{
-			tot = tot * base + 10 + (*p - 'a');
-		}
-		else if ((base == 16) && (*p >= 'A') && (*p <= 'F'))
-		{
-			tot = tot * base + 10 + (*p - 'A');
-		}
-		else
-		{
-			return tot;
-		}
-		p++;
-	}
-	return tot;
-}
-
 /*
  * xf86getNextLine --
  *
@@ -434,7 +387,7 @@ again:
 				configRBuf[i++] = c;
 			configPos--;		/* GJA -- one too far */
 			configRBuf[i] = '\0';
-			val.num = xf86strToUL (configRBuf);
+			val.num = strtoul (configRBuf, NULL, 0);
 			val.realnum = atof (configRBuf);
 			return NUMBER;
 		}
commit 52577ae8eeda64601db8dd425027cf8e4271b873
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 14 13:22:00 2010 -0400

    config: Remove atimisc workaround
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Reviewed-by: Jesse Adkins <jesserayadkins at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 15ff750..a63f487 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -524,24 +524,6 @@ fixup_video_driver_list(char **drivers)
             }
         }
     }
-    /*
-     * since the ati wrapper driver is gross and awful, sort ati before
-     * atimisc, which makes sure all the ati symbols are visible in xorgcfg.
-     */
-    for (drv = drivers; drv != end; drv++) {
-        if (!strcmp(*drv, "atimisc")) {
-            atimisc = drv;
-            for (drv = atimisc; drv != end; drv++) {
-                if (!strcmp(*drv, "ati")) {
-                    ati = drv;
-                    x = *ati; *ati = *atimisc; *atimisc = x;
-                    return;
-                }
-            }
-            /* if we get here, ati was already ahead of atimisc */
-            return;
-        }
-    }
 }
 
 static char **
commit 8bb1983a5f2dbf72366de9fb793a46e35912ab61
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Aug 2 15:22:18 2010 -0400

    config: Don't look for .o drivers anymore
    
    This hasn't worked since we switched to dlloader.
    
    Reviewed-by: Jesse Adkins <jesserayadkins at gmail.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 6743b10..15ff750 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -549,7 +549,7 @@ GenerateDriverlist(char * dirname)
 {
     char **ret;
     const char *subdirs[] = { dirname, NULL };
-    static const char *patlist[] = {"(.*)_drv\\.so", "(.*)_drv\\.o", NULL};
+    static const char *patlist[] = {"(.*)_drv\\.so", NULL};
     ret = LoaderListDirs(subdirs, patlist);
     
     /* fix up the probe order for video drivers */
commit e354ccac36a8ee3a23bdc845833c16a5646cc200
Author: Joe Shaw <joeshaw at litl.com>
Date:   Thu Oct 14 15:09:20 2010 -0400

    fix a sign problem with valuator data.
    
    Without this patch, any negative valuator value is wrong when returned
    from XQueryDeviceState().  This is a regression from at least xserver
    1.4.
    
    Valuator data is set in dix/getevents.c:set_valuators() by copying
    signed int values into an unsigned int field
    DeviceEvent.valuators.data.
    
    That data is converted into a double with an implicit cast by
    assignment to axisVal[i] in Xi/exevents.c:UpdateDeviceState().
    
    That double is converted back to a signed int in
    queryst.c:ProcXQueryDeviceState().  If the original value in
    set_valuators() is negative, the double value will be > 2^31 and the
    conversion back to a signed int is undefined.  (Although I
    consistently see the value -2^31.)
    
    Fix this by changing the definition of DeviceEvent.valuators.data from
    uint32_t to int32_t.
    
    Signed-off-by: Joe Shaw <joeshaw at litl.com>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index ecbf416..3731a4a 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -210,7 +210,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
     }
 
     memcpy(&event->valuators.data[first_valuator],
-           valuators, num_valuators * sizeof(uint32_t));
+           valuators, num_valuators * sizeof(int32_t));
 
 }
 
diff --git a/include/eventstr.h b/include/eventstr.h
index 433227e..377cceb 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -99,7 +99,7 @@ struct _DeviceEvent
     struct {
         uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
         uint8_t  mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
-        uint32_t data[MAX_VALUATORS];         /**< Valuator data */
+        int32_t  data[MAX_VALUATORS];         /**< Valuator data */
         int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
     } valuators;
     struct {
commit 424b856e8e19f35c24bfc0a9fced9464d2f17c90
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Oct 15 14:35:22 2010 +1000

    dix: update comments for GetPointerEvents and friends
    
    All these now generate InternalEvents, point this out. Remove XKB/XI
    references, that's just confusing. This comment referred to the old-style
    event generation code from server 1.4 to including 1.6 but is now just
    confusing to newcomers.
    
    Remove comment about SwitchCoreKeyboard() for the same reason.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index e5134d3..ecbf416 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -894,20 +894,12 @@ GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code)
 
 
 /**
- * Returns a set of keyboard events for KeyPress/KeyRelease, optionally
- * also with valuator events.  Handles Xi and XKB.
- *
- * DOES NOT GENERATE CORE EVENTS! Core events are created when processing the
- * event (ProcessOtherEvent).
+ * Returns a set of InternalEvents for KeyPress/KeyRelease, optionally
+ * also with valuator events.
  *
  * events is not NULL-terminated; the return value is the number of events.
  * The DDX is responsible for allocating the event structure in the first
  * place via GetMaximumEventsNum(), and for freeing it.
- *
- * This function does not change the core keymap to that of the device;
- * that is done by SwitchCoreKeyboard, which is called from
- * mieqProcessInputEvents.  If replacing that function, take care to call
- * SetCoreKeyboard before processInputProc, so keymaps are altered to suit.
  */
 int
 GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
@@ -1050,11 +1042,8 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS])
 }
 
 /**
- * Generate a series of xEvents (filled into the EventList) representing
- * pointer motion, or button presses.  Xi and XKB-aware.
- *
- * DOES NOT GENERATE CORE EVENTS! Core events are created when processing the
- * event (ProcessOtherEvent).
+ * Generate a series of InternalEvents (filled into the EventList)
+ * representing pointer motion, or button presses.
  *
  * events is not NULL-terminated; the return value is the number of events.
  * The DDX is responsible for allocating the event structure in the first
@@ -1183,7 +1172,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
 
 
 /**
- * Post ProximityIn/ProximityOut events, accompanied by valuators.
+ * Generate ProximityIn/ProximityOut InternalEvents, accompanied by
+ * valuators.
  *
  * events is not NULL-terminated; the return value is the number of events.
  * The DDX is responsible for allocating the event structure in the first
commit e2ada55de3e7ec8724b98c4e4adfec741d415499
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Sep 27 13:58:40 2010 -0400

    os: Clean up various xtrans bits that we've never supported
    
    Or at least, not supported since xserver 1.0.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/access.c b/os/access.c
index 0279259..d9de264 100644
--- a/os/access.c
+++ b/os/access.c
@@ -104,11 +104,7 @@ SOFTWARE.
 
 #if defined(TCPCONN) || defined(STREAMSCONN) || defined(__SCO__)
 #include <netinet/in.h>
-#endif /* TCPCONN || STREAMSCONN || ISC || __SCO__ */
-#ifdef DNETCONN
-#include <netdnet/dn.h>
-#include <netdnet/dnetdb.h>
-#endif
+#endif /* TCPCONN || STREAMSCONN || __SCO__ */
 
 #ifdef HAS_GETPEERUCRED
 # include <ucred.h>
@@ -333,7 +329,7 @@ ifioctl (int fd, int cmd, char *arg)
 }
 #else /* Case sun, SCO325 and others  */
 #define ifioctl ioctl
-#endif /* ((SVR4 && !sun !SCO325) || ISC) && SIOCGIFCONF */
+#endif
 
 /*
  * DefineSelf (fd):
@@ -346,7 +342,7 @@ ifioctl (int fd, int cmd, char *arg)
 void
 DefineSelf (int fd)
 {
-#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN) && !defined(MNX_TCPCONN)
+#if !defined(TCPCONN) && !defined(STREAMSCONN) && !defined(UNIXCONN)
     return;
 #else
     register int n;
@@ -480,7 +476,7 @@ DefineLocalHost:
 	    selfhosts = host;
 	}
     }
-#endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN && !MNX_TCPCONN */
+#endif /* !TCPCONN && !STREAMSCONN && !UNIXCONN */
 }
 
 #else
@@ -545,35 +541,6 @@ DefineSelf (int fd)
     int 		family;
     register HOST 	*host;
     
-#ifdef DNETCONN
-    struct dn_naddr *dnaddr = getnodeadd();
-    /*
-     * AF_DECnet may not be listed in the interface list.  Instead use
-     * the supported library call to find out the local address (if any).
-     */
-    if (dnaddr)
-    {    
-	addr = (unsigned char *) dnaddr;
-	len = dnaddr->a_len + sizeof(dnaddr->a_len);
-	family = FamilyDECnet;
-	for (host = selfhosts;
-	     host && !addrEqual (family, addr, len, host);
-	     host = host->next)
-	    ;
-        if (!host)
-	{
-	    MakeHost(host,len)
-	    if (host)
-	    {
-		host->family = family;
-		host->len = len;
-		acopy(addr, host->addr, len);
-		host->next = selfhosts;
-		selfhosts = host;
-	    }
-	}
-    }
-#endif /* DNETCONN */
 #ifndef HAS_GETIFADDRS
 
     len = sizeof(buf);
@@ -624,13 +591,6 @@ DefineSelf (int fd)
 	len = ifraddr_size (IFR_IFR_ADDR);
 	family = ConvertAddr ((struct sockaddr *) &IFR_IFR_ADDR, 
 	  			&len, (pointer *)&addr);
-#ifdef DNETCONN
-	/*
-	 * DECnet was handled up above.
-	 */
-	if (family == AF_DECnet)
-	    continue;
-#endif /* DNETCONN */
         if (family == -1 || family == FamilyLocal)
 	    continue;
 #if defined(IPv6) && defined(AF_INET6)
@@ -760,10 +720,6 @@ DefineSelf (int fd)
     for (ifr = ifap; ifr != NULL; ifr = ifr->ifa_next) {
         if (!ifr->ifa_addr)
             continue;
-#ifdef DNETCONN
-	if (ifr->ifa_addr.sa_family == AF_DECnet) 
-	    continue;
-#endif /* DNETCONN */
 	len = sizeof(*(ifr->ifa_addr));
 	family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len,
 			     (pointer *)&addr);
@@ -919,22 +875,15 @@ ResetHosts (char *display)
     FILE		*fd;
     char		*ptr;
     int                 i, hostlen;
-#if ((defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)) && \
-     (!defined(IPv6) || !defined(AF_INET6))) || defined(DNETCONN)
+#if (defined(TCPCONN) || defined(STREAMSCONN) ) && \
+     (!defined(IPv6) || !defined(AF_INET6))
     union {
         struct sockaddr	sa;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
 	struct sockaddr_in in;
 #endif /* TCPCONN || STREAMSCONN */
-#ifdef DNETCONN
-	struct sockaddr_dn dn;
-#endif
     }			saddr;
 #endif
-#ifdef DNETCONN
-    struct nodeent 	*np;
-    struct dn_naddr 	dnaddr, *dnaddrp, *dnet_addr();
-#endif
     int			family = 0;
     pointer		addr;
     int 		len;
@@ -980,7 +929,7 @@ ResetHosts (char *display)
 	    NewHost(family, "", 0, FALSE);
 	    LocalHostRequested = TRUE;	/* Fix for XFree86 bug #156 */
 	}
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
 	else if (!strncmp("inet:", lhostname, 5))
 	{
 	    family = FamilyInternet;
@@ -994,13 +943,6 @@ ResetHosts (char *display)
 	}
 #endif
 #endif
-#ifdef DNETCONN
-	else if (!strncmp("dnet:", lhostname, 5))
-	{
-	    family = FamilyDECnet;
-	    hostname = ohostname + 5;
-	}
-#endif
 #ifdef SECURE_RPC
 	else if (!strncmp("nis:", lhostname, 4))
 	{
@@ -1024,32 +966,6 @@ ResetHosts (char *display)
 	    }
 	}
 	else
-#ifdef DNETCONN
-    	if ((family == FamilyDECnet) || ((family == FamilyWild) &&
-	    (ptr = strchr(hostname, ':')) && (*(ptr + 1) == ':') &&
-	    !(*ptr = '\0')))	/* bash trailing colons if necessary */
-	{
-    	    /* node name (DECnet names end in "::") */
-	    dnaddrp = dnet_addr(hostname);
-    	    if (!dnaddrp && (np = getnodebyname (hostname)))
-	    {
-		/* node was specified by name */
-		saddr.sa.sa_family = np->n_addrtype;
-		len = sizeof(saddr.sa);
-		if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet)
-		{
-		    memset((char *) &dnaddr, 0, sizeof (dnaddr));
-		    dnaddr.a_len = np->n_length;
-		    acopy (np->n_addr, dnaddr.a_addr, np->n_length);
-		    dnaddrp = &dnaddr;
-		}
-    	    }
-	    if (dnaddrp)
-		(void) NewHost(FamilyDECnet, (pointer)dnaddrp,
-			(int)(dnaddrp->a_len + sizeof(dnaddrp->a_len)), FALSE);
-    	}
-	else
-#endif /* DNETCONN */
 #ifdef SECURE_RPC
 	if ((family == FamilyNetname) || (strchr(hostname, '@')))
 	{
@@ -1058,7 +974,7 @@ ResetHosts (char *display)
 	}
 	else
 #endif /* SECURE_RPC */
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
 	{
 #if defined(IPv6) && defined(AF_INET6)
 	    if ( (family == FamilyInternet) || (family == FamilyInternet6) ||
@@ -1523,7 +1439,7 @@ CheckAddr (
 
     switch (family)
     {
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
       case FamilyInternet:
 	if (length == sizeof (struct in_addr))
 	    len = length;
@@ -1539,21 +1455,6 @@ CheckAddr (
         break;
 #endif
 #endif 
-#ifdef DNETCONN
-      case FamilyDECnet:
-        {
-	    struct dn_naddr *dnaddr = (struct dn_naddr *) pAddr;
-
-	    if ((length < sizeof(dnaddr->a_len)) ||
-		(length < dnaddr->a_len + sizeof(dnaddr->a_len)))
-		len = -1;
-	    else
-		len = dnaddr->a_len + sizeof(dnaddr->a_len);
-	    if (len > sizeof(struct dn_naddr))
-		len = -1;
-	}
-        break;
-#endif
       case FamilyServerInterpreted:
 	len = siCheckAddr(pAddr, length);
 	break;
@@ -1631,7 +1532,7 @@ ConvertAddr (
     case AF_UNIX:
 #endif
         return FamilyLocal;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
     case AF_INET:
 #ifdef WIN32
         if (16777343 == *(long*)&((struct sockaddr_in *) saddr)->sin_addr)
@@ -1656,22 +1557,6 @@ ConvertAddr (
     }
 #endif
 #endif
-#ifdef DNETCONN
-    case AF_DECnet:
-	{
-	    struct sockaddr_dn *sdn = (struct sockaddr_dn *) saddr;
-	    *len = sdn->sdn_nodeaddrl + sizeof(sdn->sdn_nodeaddrl);
-	    *addr = (pointer) &(sdn->sdn_add);
-	}
-        return FamilyDECnet;
-#endif
-#ifdef CHAOSCONN
-    case AF_CHAOS:
-	{
-	    not implemented
-	}
-	return FamilyChaos;
-#endif
     default:
         return -1;
     }
diff --git a/os/connection.c b/os/connection.c
index 28cd193..5452ae1 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -113,9 +113,6 @@ SOFTWARE.
 
 #define Pid_t pid_t
 
-#ifdef DNETCONN
-#include <netdnet/dn.h>
-#endif /* DNETCONN */
 
 #ifdef HAS_GETPEERUCRED
 # include <ucred.h>
@@ -521,7 +518,7 @@ AuthAudit (ClientPtr client, Bool letin,
 #endif
 	    strcpy(out, "local host");
 	    break;
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(MNX_TCPCONN)
+#if defined(TCPCONN) || defined(STREAMSCONN)
 	case AF_INET:
 	    sprintf(out, "IP %s",
 		inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr));
@@ -536,12 +533,6 @@ AuthAudit (ClientPtr client, Bool letin,
 	    break;
 #endif
 #endif
-#ifdef DNETCONN
-	case AF_DECnet:
-	    sprintf(out, "DN %s",
-		    dnet_ntoa(&((struct sockaddr_dn *) saddr)->sdn_add));
-	    break;
-#endif
 	default:
 	    strcpy(out, "unknown address");
 	}
diff --git a/os/xdmcp.c b/os/xdmcp.c
index 8fd903f..877b11c 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -1520,7 +1520,7 @@ get_addr_by_name(
 #ifdef XTHREADS_NEEDS_BYNAMEPARAMS
     _Xgethostbynameparams hparams;
 #endif
-#if defined(WIN32) && (defined(TCPCONN) || defined(DNETCONN))
+#if defined(WIN32) && defined(TCPCONN)
     _XSERVTransWSAStartup(); 
 #endif
     if (!(hep = _XGethostbyname(namestr, hparams)))
commit 3c28a29e132d6f73c36d4b64818d112b1c6e9a40
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Oct 13 15:53:59 2010 +1000

    xfree86: rename parameter names to xf86ScaleAxis.
    
    Maybe it's just me but every time I look at it I get confused again and need
    to work it out from scratch. Rename the parameters to something
    self-explanatory, to/from and min/max.
    
    No functional change.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 877eb03..e71b09c 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1238,40 +1238,43 @@ xf86FirstLocalDevice(void)
 
 /* 
  * Cx     - raw data from touch screen
- * Sxhigh - scaled highest dimension
+ * to_max - scaled highest dimension
  *          (remember, this is of rows - 1 because of 0 origin)
- * Sxlow  - scaled lowest dimension
- * Rxhigh - highest raw value from touch screen calibration
- * Rxlow  - lowest raw value from touch screen calibration
+ * to_min  - scaled lowest dimension
+ * from_max - highest raw value from touch screen calibration
+ * from_min  - lowest raw value from touch screen calibration
  *
  * This function is the same for X or Y coordinates.
  * You may have to reverse the high and low values to compensate for
  * different orgins on the touch screen vs X.
+ *
+ * e.g. to scale from device coordinates into screen coordinates, call
+ * xf86ScaleAxis(x, 0, screen_width, dev_min, dev_max);
  */
 
 int
 xf86ScaleAxis(int	Cx,
-              int	Sxhigh,
-              int	Sxlow,
-              int	Rxhigh,
-              int	Rxlow )
+              int	to_max,
+              int	to_min,
+              int	from_max,
+              int	from_min )
 {
     int X;
-    int64_t dSx = Sxhigh - Sxlow;
-    int64_t dRx = Rxhigh - Rxlow;
+    int64_t to_width = to_max - to_min;
+    int64_t from_width = from_max - from_min;
 
-    if (dRx) {
-	X = (int)(((dSx * (Cx - Rxlow)) / dRx) + Sxlow);
+    if (from_width) {
+	X = (int)(((to_width * (Cx - from_min)) / from_width) + to_min);
     }
     else {
 	X = 0;
 	ErrorF ("Divide by Zero in xf86ScaleAxis");
     }
     
-    if (X > Sxhigh)
-	X = Sxhigh;
-    if (X < Sxlow)
-	X = Sxlow;
+    if (X > to_max)
+	X = to_max;
+    if (X < to_min)
+	X = to_min;
     
     return X;
 }
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 7b60cdf..1d013aa 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -184,7 +184,7 @@ extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int ke
                            int is_down);
 extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
 extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void);
-extern _X_EXPORT int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
+extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
 extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
 extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
 extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
commit 23229c7ce5970516b97a1cc12e65257ff65ab9a7
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Oct 13 16:28:14 2010 -0700

    test: Fix make distcheck when not building unit tests
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/Makefile.am b/test/Makefile.am
index 7c44671..456221e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -33,10 +33,9 @@ libxservertest_la_LIBADD = \
             $(top_builddir)/mi/libmi.la \
             $(top_builddir)/os/libos.la \
             @XORG_LIBS@
+endif
 
 CLEANFILES=libxservertest.c
 
 libxservertest.c:
 	touch $@
-
-endif
commit ff82f724e4ed24d73f15fa9c35a1d0c2c7d8cef7
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Oct 13 10:20:06 2010 -0700

    Comparison between pointer and integer in latest dix/dispatch.c
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 35e7ddd..b66861f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -916,7 +916,7 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
     rep->width = pDraw->width;
     rep->height = pDraw->height;
 
-    if (WindowDrawable(pDraw))
+    if (WindowDrawable(pDraw->type))
     {
         WindowPtr pWin = (WindowPtr)pDraw;
 	rep->x = pWin->origin.x - wBorderWidth (pWin);
commit da4eebe58ec81e2297cc1773af1fb622fb392bbd
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Oct 13 17:34:31 2010 +0100

    event_size is currently never assigned to in mieqProcessInputEvents().
    
    event_size is never assigned to in mieqProcessInputEvents(), so realloc()
    is always called.  This is benign, but I'm guessing not intended.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/mieq.c b/mi/mieq.c
index fa60b40..d1441e2 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -439,7 +439,11 @@ mieqProcessInputEvents(void)
 
         evlen   = e->events->evlen;
         if(evlen > event_size)
+          {
             event = realloc(event, evlen);
+            event_size = evlen;
+          }
+
 
         if (!event)
             FatalError("[mi] No memory left for event processing.\n");
commit 6274dca9d984ad3c553b4901edc3151e770e6c40
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 11 16:37:16 2010 -0400

    dix: optimize CallCallbacks
    
    Move the basic sanity checking to an inline wrapper, which avoids the
    function call overhead if the callback list is empty.  On an XACEful
    server on a 2.4GHz Core 2 Duo:
    
        1              2           Operation
    --------   -----------------   -----------------
    20000000.0   25100000.0 (  1.25)   X protocol NoOperation
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 470bb5d..104363b 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -729,7 +729,7 @@ _DeleteCallback(
     return FALSE;
 }
 
-static void 
+void 
 _CallCallbacks(
     CallbackListPtr    *pcbl,
     pointer	    call_data)
@@ -871,13 +871,6 @@ DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
 }
 
 void
-CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
-{
-    if (!pcbl || !*pcbl) return;
-    _CallCallbacks(pcbl, call_data);
-}
-
-void
 DeleteCallbackList(CallbackListPtr *pcbl)
 {
     if (!pcbl || !*pcbl) return;
diff --git a/include/callback.h b/include/callback.h
index 632ed4f..9a1da73 100644
--- a/include/callback.h
+++ b/include/callback.h
@@ -75,10 +75,17 @@ extern _X_EXPORT Bool DeleteCallback(
     CallbackProcPtr /*callback*/,
     pointer /*data*/);
 
-extern _X_EXPORT void CallCallbacks(
+extern _X_EXPORT void _CallCallbacks(
     CallbackListPtr * /*pcbl*/,
     pointer /*call_data*/);
 
+static inline void
+CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
+{
+    if (!pcbl || !*pcbl) return;
+    _CallCallbacks(pcbl, call_data);
+}
+
 extern _X_EXPORT void DeleteCallbackList(
     CallbackListPtr * /*pcbl*/);
 
commit e418cd332c1f458d028df3fdf684011109d0c183
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 11 10:49:57 2010 -0400

    xwin: Remove some undue paranoia about UNDRAWABLE_WINDOW
    
    mi will throw away rendering to input-only windows.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
index 00fd77a..80f5315 100644
--- a/hw/xwin/winfillsp.c
+++ b/hw/xwin/winfillsp.c
@@ -824,36 +824,6 @@ winFillSpansNativeGDI (DrawablePtr	pDrawable,
       SelectClipRgn (pGCPriv->hdc, NULL);
       break;
 
-    case UNDRAWABLE_WINDOW:
-      /* UNDRAWABLE_WINDOW doesn't appear to get called when running xterm */
-      switch (pGC->fillStyle)
-	{
-	case FillSolid:
-	  ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillSolid - "
-		  "Unimplemented\n");
-	  break;
-
-	case FillStippled:
-	  ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillStippled - "
-		  "Unimplemented\n");
-	  break;
-
-	case FillTiled:
-	  ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillTiled - "
-		  "Unimplemented\n");
-	  break;
-
-	case FillOpaqueStippled:
-	  ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - OpaqueStippled - "
-		  "Unimplemented\n");
-	  break;
-
-	default:
-	  ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - Unknown fillStyle\n");
-	  break;
-	}
-      break;
-
     default:
       ErrorF ("winFillSpans - Unknown drawable type\n");
       break;
diff --git a/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c
index db914c9..8220812 100644
--- a/hw/xwin/wingetsp.c
+++ b/hw/xwin/wingetsp.c
@@ -177,10 +177,6 @@ winGetSpansNativeGDI (DrawablePtr	pDrawable,
       DeleteDC (hdcMem);
       break;
 
-    case UNDRAWABLE_WINDOW:
-      FatalError ("winGetSpans - UNDRAWABLE_WINDOW\n");
-      break;
-
     default:
       FatalError ("winGetSpans - Unknown drawable type\n");
       break;
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
index 6a90781..e5d33be 100644
--- a/hw/xwin/winsetsp.c
+++ b/hw/xwin/winsetsp.c
@@ -171,10 +171,6 @@ winSetSpansNativeGDI (DrawablePtr	pDrawable,
       SelectClipRgn (pGCPriv->hdc, NULL);
       break;
 
-    case UNDRAWABLE_WINDOW:
-      FatalError ("\nwinSetSpansNativeGDI - UNDRAWABLE_WINDOW\n\n");
-      break;
-
     default:
       FatalError ("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
       break;
commit febf3e7ead8dbb355622c896ff1744b2ca52a49a
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 11 10:49:56 2010 -0400

    dix: Remove the memory of the multibuffer extension
    
    Drop DRAWABLE_BUFFER and related checks, mbuf was the only thing that
    used them and it was killed in 0ba82562.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 17f308c..35e7ddd 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -916,23 +916,14 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
     rep->width = pDraw->width;
     rep->height = pDraw->height;
 
-    /* XXX - Because the pixmap-implementation of the multibuffer extension 
-     *       may have the buffer-id's drawable resource value be a pointer
-     *       to the buffer's window instead of the buffer itself
-     *       (this happens if the buffer is the displayed buffer),
-     *       we also have to check that the id matches before we can
-     *       truly say that it is a DRAWABLE_WINDOW.
-     */
-
-    if ((pDraw->type == UNDRAWABLE_WINDOW) ||
-        ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id)))
+    if (WindowDrawable(pDraw))
     {
         WindowPtr pWin = (WindowPtr)pDraw;
 	rep->x = pWin->origin.x - wBorderWidth (pWin);
 	rep->y = pWin->origin.y - wBorderWidth (pWin);
 	rep->borderWidth = pWin->borderWidth;
     }
-    else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */
+    else /* DRAWABLE_PIXMAP */
     {
 	rep->x = rep->y = rep->borderWidth = 0;
     }
diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
index 1e8e3e6..00fd77a 100644
--- a/hw/xwin/winfillsp.c
+++ b/hw/xwin/winfillsp.c
@@ -854,11 +854,6 @@ winFillSpansNativeGDI (DrawablePtr	pDrawable,
 	}
       break;
 
-    case DRAWABLE_BUFFER:
-      /* DRAWABLE_BUFFER seems to be undocumented. */
-      ErrorF ("winFillSpans - DRAWABLE_BUFFER - Unimplemented\n");
-      break;
-
     default:
       ErrorF ("winFillSpans - Unknown drawable type\n");
       break;
diff --git a/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c
index 03f7f10..db914c9 100644
--- a/hw/xwin/wingetsp.c
+++ b/hw/xwin/wingetsp.c
@@ -181,10 +181,6 @@ winGetSpansNativeGDI (DrawablePtr	pDrawable,
       FatalError ("winGetSpans - UNDRAWABLE_WINDOW\n");
       break;
 
-    case DRAWABLE_BUFFER:
-      FatalError ("winGetSpans - DRAWABLE_BUFFER\n");
-      break;
-      
     default:
       FatalError ("winGetSpans - Unknown drawable type\n");
       break;
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
index d1bf90b..6a90781 100644
--- a/hw/xwin/winsetsp.c
+++ b/hw/xwin/winsetsp.c
@@ -175,10 +175,6 @@ winSetSpansNativeGDI (DrawablePtr	pDrawable,
       FatalError ("\nwinSetSpansNativeGDI - UNDRAWABLE_WINDOW\n\n");
       break;
 
-    case DRAWABLE_BUFFER:
-      FatalError ("\nwinSetSpansNativeGDI - DRAWABLE_BUFFER\n\n");
-      break;
-      
     default:
       FatalError ("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
       break;
diff --git a/include/pixmap.h b/include/pixmap.h
index 5cf42d1..014a111 100644
--- a/include/pixmap.h
+++ b/include/pixmap.h
@@ -55,16 +55,14 @@ SOFTWARE.
 #define DRAWABLE_WINDOW 0
 #define DRAWABLE_PIXMAP 1
 #define UNDRAWABLE_WINDOW 2
-#define DRAWABLE_BUFFER 3
 
 /* corresponding type masks for dixLookupDrawable() */
 #define M_DRAWABLE_WINDOW	(1<<0)
 #define M_DRAWABLE_PIXMAP	(1<<1)
 #define M_UNDRAWABLE_WINDOW	(1<<2)
-#define M_DRAWABLE_BUFFER	(1<<3)
 #define M_ANY			(-1)
 #define M_WINDOW	(M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW)
-#define M_DRAWABLE	(M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP|M_DRAWABLE_BUFFER)
+#define M_DRAWABLE	(M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP)
 #define M_UNDRAWABLE	(M_UNDRAWABLE_WINDOW)
 
 /* flags to PaintWindow() */
@@ -88,7 +86,7 @@ typedef union _PixUnion {
     ((as) == (bs) && (SamePixUnion (a, b, as)))
 
 #define OnScreenDrawable(type) \
-	((type == DRAWABLE_WINDOW) || (type == DRAWABLE_BUFFER))
+	(type == DRAWABLE_WINDOW)
 
 #define WindowDrawable(type) \
 	((type == DRAWABLE_WINDOW) || (type == UNDRAWABLE_WINDOW))
commit 1333e101b4f6ecca72568b7f462884f8b102a5c2
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Oct 7 18:17:02 2010 -0700

    Remove leftover fbSaveAreas & fbRestoreAreas defines from wfbrename.h
    
    The fb functions they try to rename were deleted in 2007 by
    commit ae7f71a8b3d6756161e55d998d6eec37d2695c98
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index 433f286..c8e98c8 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -155,8 +155,6 @@
 #define fbReduceRasterOp wfbReduceRasterOp
 #define fbReplicatePixel wfbReplicatePixel
 #define fbResolveColor wfbResolveColor
-#define fbRestoreAreas wfbRestoreAreas
-#define fbSaveAreas wfbSaveAreas
 #define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
 #define fbSegment wfbSegment
 #define fbSelectBres wfbSelectBres
commit 8efa3623f32939ef525926b57fd533f4c01ec4b3
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Aug 4 13:48:33 2010 -0700

    Use GetCurrentRootWindow or equivalent instead of spriteTrace[0].
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index e506f6a..7a7bbdf 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2430,7 +2430,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         WindowPtr currentRoot;
 
         if (dev->spriteInfo->sprite)
-            currentRoot = dev->spriteInfo->sprite->spriteTrace[0];
+            currentRoot = GetCurrentRootWindow(dev);
         else /* new device auto-set to floating */
             currentRoot = screenInfo.screens[0]->root;
 
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 7a3ecf5..b1ee3fb 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -1251,11 +1251,6 @@ CoreFocusEvents(DeviceIntPtr dev,
     SetFocusIn(dev, to);
 }
 
-/**
- * The root window the given device is currently on.
- */
-#define RootWindow(dev) dev->spriteInfo->sprite->spriteTrace[0]
-
 static void
 DeviceFocusEvents(DeviceIntPtr dev,
                   WindowPtr from,
@@ -1284,7 +1279,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
         if ((from == NullWindow) || (from == PointerRootWin))
         {
             if (from == PointerRootWin)
-                DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
+                DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
                         NotifyPointer);
             /* Notify all the roots */
             for (i = 0; i < nscreens; i++)
@@ -1304,19 +1299,19 @@ DeviceFocusEvents(DeviceIntPtr dev,
         for (i = 0; i < nscreens; i++)
             DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root);
         if (to == PointerRootWin)
-            DeviceFocusInEvents(dev, RootWindow(dev), sprite->win, mode, NotifyPointer);
+            DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, mode, NotifyPointer);
     }
     else
     {
         if ((from == NullWindow) || (from == PointerRootWin))
         {
             if (from == PointerRootWin)
-                DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
+                DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
                         NotifyPointer);
             for (i = 0; i < nscreens; i++)
                 DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root);
             if (to->parent != NullWindow)
-                DeviceFocusInEvents(dev, RootWindow(dev), to, mode, NotifyNonlinearVirtual);
+                DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), to, mode, NotifyNonlinearVirtual);
             DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
             if (IsParent(to, sprite->win))
                 DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);
diff --git a/dix/events.c b/dix/events.c
index 01cec7b..e8cf8d4 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5055,7 +5055,7 @@ ProcSendEvent(ClientPtr client)
 	/* If the input focus is PointerRootWin, send the event to where
 	the pointer is if possible, then perhaps propogate up to root. */
 	if (inputFocus == PointerRootWin)
-	    inputFocus = pSprite->spriteTrace[0]; /* Root window! */
+	    inputFocus = RootWindow(dev);
 
 	if (IsParent(inputFocus, pSprite->win))
 	{
commit 32de0c19075b886c2fc03f6ad73d9c15df1b2309
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Aug 4 11:44:05 2010 -0700

    Move replay-window check from ComputeFreezes to CheckDeviceGrabs.
    
    This just simplifies ComputeFreezes, eliminating some duplicated code
    and a goto.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 51a04d5..01cec7b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1276,7 +1276,6 @@ static void
 ComputeFreezes(void)
 {
     DeviceIntPtr replayDev = syncEvents.replayDev;
-    int i;
     WindowPtr w;
     GrabPtr grab;
     DeviceIntPtr dev;
@@ -1294,29 +1293,15 @@ ComputeFreezes(void)
 	syncEvents.replayDev = (DeviceIntPtr)NULL;
 
         w = XYToWindow(replayDev, event->root_x, event->root_y);
-	for (i = 0; i < replayDev->spriteInfo->sprite->spriteTraceGood; i++)
-	{
-	    if (syncEvents.replayWin ==
-		replayDev->spriteInfo->sprite->spriteTrace[i])
-	    {
-		if (!CheckDeviceGrabs(replayDev, event, i+1)) {
-		    if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
-			DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
-		    else
-			DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
-                                            NullWindow, replayDev);
-		}
-		goto playmore;
-	    }
-	}
-	/* must not still be in the same stack */
-	if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
-	    DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
-	else
-	    DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
-                                NullWindow, replayDev);
+        if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin))
+        {
+            if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
+                DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
+            else
+                DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
+                                    NullWindow, replayDev);
+        }
     }
-playmore:
     for (dev = inputInfo.devices; dev; dev = dev->next)
     {
 	if (!dev->deviceGrab.sync.frozen)
@@ -3611,7 +3596,7 @@ CheckPassiveGrabsOnWindow(
 */
 
 Bool
-CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
+CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor)
 {
     int i;
     WindowPtr pWin = NULL;
@@ -3629,7 +3614,15 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
     if (device->deviceGrab.grab)
         return FALSE;
 
-    i = checkFirst;
+    i = 0;
+    if (ancestor)
+    {
+        while (i < device->spriteInfo->sprite->spriteTraceGood)
+            if (device->spriteInfo->sprite->spriteTrace[i++] == ancestor)
+                break;
+        if (i == device->spriteInfo->sprite->spriteTraceGood)
+            return FALSE;
+    }
 
     if (focus)
     {
@@ -3642,8 +3635,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
 
 	if ((focus->win == NoneWin) ||
 	    (i >= device->spriteInfo->sprite->spriteTraceGood) ||
-	    ((i > checkFirst) &&
-             (pWin != device->spriteInfo->sprite->spriteTrace[i-1])))
+	    (pWin && pWin != device->spriteInfo->sprite->spriteTrace[i-1]))
 	    return FALSE;
     }
 
diff --git a/include/dix.h b/include/dix.h
index a282a08..7485e8e 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -401,7 +401,7 @@ extern _X_EXPORT void WindowHasNewCursor(
 extern Bool CheckDeviceGrabs(
     DeviceIntPtr /* device */,
     DeviceEvent* /* event */,
-    int /* checkFirst */);
+    WindowPtr /* ancestor */);
 
 extern void DeliverFocusedEvent(
     DeviceIntPtr /* keybd */,
commit 1c1811ecafc144151630b3588394e2c345c53aa4
Author: Jamey Sharp <jamey at minilop.net>
Date:   Tue Aug 3 19:49:59 2010 -0700

    CheckDeviceGrabs: Delete redundant pWin->optional test.
    
    CheckPassiveGrabsOnWindow returns FALSE if pWin->optional is NULL,
    because wPassiveGrabs uses wUseDefault, so don't bother checking at the
    caller.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index e03e58c..51a04d5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3636,8 +3636,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
 	for (; i < focus->traceGood; i++)
 	{
 	    pWin = focus->trace[i];
-	    if (pWin->optional &&
-	        CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
+	    if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
 		return TRUE;
 	}
 
@@ -3651,8 +3650,7 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
     for (; i < device->spriteInfo->sprite->spriteTraceGood; i++)
     {
 	pWin = device->spriteInfo->sprite->spriteTrace[i];
-	if (pWin->optional &&
-	    CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
+	if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
 	    return TRUE;
     }
 
commit c360b3eb1deeac51913e7b1286b2767711c541fc
Author: Jamey Sharp <jamey at minilop.net>
Date:   Tue Aug 3 19:40:26 2010 -0700

    Let CheckPassiveGrabsOnWindow callers check if device is already grabbed.
    
    CheckDeviceGrabs checked all the ancestors of the window containing this
    device's pointer even if no new grabs could possibly apply due to the
    device already being grabbed.
    
    ActivateFocusInGrab and ActivateEnterGrab already checked whether they
    should break an existing grab, and then set up an event that was
    completely ignored if they didn't actually break the grab.
    
    In both cases, just do what we would have done eventually anyway--return
    FALSE from CheckPassiveGrabsOnWindow's caller--but do it sooner.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 07f7b1f..e03e58c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2648,11 +2648,11 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
     BOOL rc = FALSE;
     DeviceEvent event;
 
-    if (dev->deviceGrab.grab &&
-        dev->deviceGrab.fromPassiveGrab &&
-        dev->deviceGrab.grab->type == XI_Enter)
+    if (dev->deviceGrab.grab)
     {
-        if (dev->deviceGrab.grab->window == win ||
+        if (!dev->deviceGrab.fromPassiveGrab ||
+            dev->deviceGrab.grab->type != XI_Enter ||
+            dev->deviceGrab.grab->window == win ||
             IsParent(dev->deviceGrab.grab->window, win))
             return FALSE;
         DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
@@ -2688,11 +2688,11 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
     BOOL rc = FALSE;
     DeviceEvent event;
 
-    if (dev->deviceGrab.grab &&
-        dev->deviceGrab.fromPassiveGrab &&
-        dev->deviceGrab.grab->type == XI_Enter)
+    if (dev->deviceGrab.grab)
     {
-        if (dev->deviceGrab.grab->window == win ||
+        if (!dev->deviceGrab.fromPassiveGrab ||
+            dev->deviceGrab.grab->type != XI_Enter ||
+            dev->deviceGrab.grab->window == win ||
             IsParent(dev->deviceGrab.grab->window, win))
             return FALSE;
         DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
@@ -3403,9 +3403,6 @@ CheckPassiveGrabsOnWindow(
 #define XI2_MATCH        0x4
     int match = 0;
 
-    if (device->deviceGrab.grab)
-        return FALSE;
-
     if (!grab)
 	return FALSE;
     /* Fill out the grab details, but leave the type for later before
@@ -3629,6 +3626,9 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
         && (device->button->buttonsDown != 1))
 	return FALSE;
 
+    if (device->deviceGrab.grab)
+        return FALSE;
+
     i = checkFirst;
 
     if (focus)
commit 853d7ebfa3e2d281d92890a39010ff5787a00ffd
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Oct 5 11:24:28 2010 -0400

    vbe: Fix copying the mode info block
    
    Just use memcpy, seriously.
    
    Reviewed-by: Rémi Cardona <remi at gentoo.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 0b34648..7a64a4a 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -527,69 +527,9 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
     if (R16(pVbe->pInt10->ax) != 0x4f)
 	return NULL;
 
-    block = calloc(sizeof(VbeModeInfoBlock), 1);
-
-    block->ModeAttributes = *(CARD16*)pVbe->memory;
-    block->WinAAttributes = ((char*)pVbe->memory)[2];
-    block->WinBAttributes = ((char*)pVbe->memory)[3];
-    block->WinGranularity = *(CARD16*)(((char*)pVbe->memory) + 4);
-    block->WinSize = *(CARD16*)(((char*)pVbe->memory) + 6);
-    block->WinASegment = *(CARD16*)(((char*)pVbe->memory) + 8);
-    block->WinBSegment = *(CARD16*)(((char*)pVbe->memory) + 10);
-    block->WinFuncPtr = *(CARD32*)(((char*)pVbe->memory) + 12);
-    block->BytesPerScanline = *(CARD16*)(((char*)pVbe->memory) + 16);
-
-    /* mandatory information for VBE 1.2 and above */
-    block->XResolution = *(CARD16*)(((char*)pVbe->memory) + 18);
-    block->YResolution = *(CARD16*)(((char*)pVbe->memory) + 20);
-    block->XCharSize = ((char*)pVbe->memory)[22];
-    block->YCharSize = ((char*)pVbe->memory)[23];
-    block->NumberOfPlanes = ((char*)pVbe->memory)[24];
-    block->BitsPerPixel = ((char*)pVbe->memory)[25];
-    block->NumberOfBanks = ((char*)pVbe->memory)[26];
-    block->MemoryModel = ((char*)pVbe->memory)[27];
-    block->BankSize = ((char*)pVbe->memory)[28];
-    block->NumberOfImages = ((char*)pVbe->memory)[29];
-    block->Reserved = ((char*)pVbe->memory)[30];
-
-    /* Direct color fields (required for direct/6 and YUV/7 memory models) */
-    block->RedMaskSize = ((char*)pVbe->memory)[31];
-    block->RedFieldPosition = ((char*)pVbe->memory)[32];
-    block->GreenMaskSize = ((char*)pVbe->memory)[33];
-    block->GreenFieldPosition = ((char*)pVbe->memory)[34];
-    block->BlueMaskSize = ((char*)pVbe->memory)[35];
-    block->BlueFieldPosition = ((char*)pVbe->memory)[36];
-    block->RsvdMaskSize = ((char*)pVbe->memory)[37];
-    block->RsvdFieldPosition = ((char*)pVbe->memory)[38];
-    block->DirectColorModeInfo = ((char*)pVbe->memory)[39];
-
-    /* Mandatory information for VBE 2.0 and above */
-    if (pVbe->version >= 0x200) {
-	block->PhysBasePtr = *(CARD32*)(((char*)pVbe->memory) + 40);
-	block->Reserved32 = *(CARD32*)(((char*)pVbe->memory) + 44);
-	block->Reserved16 = *(CARD16*)(((char*)pVbe->memory) + 48);
-
-	/* Mandatory information for VBE 3.0 and above */
-	if (pVbe->version >= 0x300) {
-	    block->LinBytesPerScanLine = *(CARD16*)(((char*)pVbe->memory) + 50);
-	    block->BnkNumberOfImagePages = ((char*)pVbe->memory)[52];
-	    block->LinNumberOfImagePages = ((char*)pVbe->memory)[53];
-	    block->LinRedMaskSize = ((char*)pVbe->memory)[54];
-	    block->LinRedFieldPosition = ((char*)pVbe->memory)[55];
-	    block->LinGreenMaskSize = ((char*)pVbe->memory)[56];
-	    block->LinGreenFieldPosition = ((char*)pVbe->memory)[57];
-	    block->LinBlueMaskSize = ((char*)pVbe->memory)[58];
-	    block->LinBlueFieldPosition = ((char*)pVbe->memory)[59];
-	    block->LinRsvdMaskSize = ((char*)pVbe->memory)[60];
-	    block->LinRsvdFieldPosition = ((char*)pVbe->memory)[61];
-	    block->MaxPixelClock = *(CARD32*)(((char*)pVbe->memory) + 62);
-	    memcpy(&block->Reserved2, ((char*)pVbe->memory) + 66, 188);
-	}
-	else
-	memcpy(&block->LinBytesPerScanLine, ((char*)pVbe->memory) + 50, 206);
-    }
-    else
-	memcpy(&block->PhysBasePtr, ((char*)pVbe->memory) + 40, 216);
+    block = malloc(sizeof(VbeModeInfoBlock));
+    if (block)
+	memcpy(block, pVbe->memory, sizeof(*block));
 
     return block;
 }
commit b2f9ce201cc2a14d5d6ad055b46c9317b040ec2e
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Jul 27 17:34:36 2010 -0400

    edid: Fix the HDTV sync pulse adjustment
    
    Simple typo, should have been adjusting the horizontal timings
    consistently since we're not trying to mangle vertical at all.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index c367749..3d51b1d 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -484,8 +484,8 @@ DDCModesFromStandardTiming(struct std_timings *timing, ddc_quirk_t quirks,
 	     (hsize == 1368 && vsize == 769))) {
 	    Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE);
 	    Mode->HDisplay = 1366;
-	    Mode->VSyncStart--;
-	    Mode->VSyncEnd--;
+	    Mode->HSyncStart--;
+	    Mode->HSyncEnd--;
 	} else if (hsize && vsize && refresh) {
 	    Mode = FindDMTMode(hsize, vsize, refresh, rb);
 
commit 9a893fe52f1bfd415e9ffd9d2f5aff5c4da7a756
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Oct 3 16:56:03 2010 +0100

    xfree86: Do not call dlclose(NULL) [regression after ab7f057]
    
    During unwind following an error when attempting to a load a module, we
    attempt to call dlclose on a potentially NULL handle. This is a
    side-effect of removing the abstraction layer in ab7f057.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Cc: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 8921831..694c1c2 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -184,7 +184,8 @@ void
 LoaderUnload(const char *name, void *handle)
 {
     xf86Msg(X_INFO, "Unloading %s\n", name);
-    dlclose(handle);
+    if (handle)
+	dlclose(handle);
 }
 
 unsigned long LoaderOptions = 0;
commit 533faf7f43cb4b5155a74d78d6144b702e227efa
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Oct 1 10:57:48 2010 -0700

    Bump version to 1.9.99.1 (1.10 development series)
    
    Make the 1.10 development series distinguishable from the 1.9 branch.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 479f54f..c0bf98f 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.9.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-08-20"
+AC_INIT([xorg-server], 1.9.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-10-01"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit a769f4c22a9cfb5ba248c924a66c31ec966bd8a0
Author: Adrian Bunk <bunk at stusta.de>
Date:   Thu Sep 30 13:18:20 2010 +0300

    remove dolt
    
    With libtool 2.2.10 the difference in build time is so small
    (< 5% with -j8 builds) that it isn't worth having this hack.
    
    Signed-off-by: Adrian Bunk <bunk at stusta.de>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Makefile.am b/Makefile.am
index 8b7a2c8..62c8d95 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,8 +56,6 @@ DISTCHECK_CONFIGURE_FLAGS=\
 	--with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
 	--with-xkb-output='$${datadir}/X11/xkb/compiled'
 
-DISTCLEANFILES = doltcompile doltlibtool
-
 .PHONY: ChangeLog INSTALL
 
 INSTALL:
diff --git a/configure.ac b/configure.ac
index 825eb69..479f54f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,6 @@ AC_PROG_LN_S
 AC_LIBTOOL_WIN32_DLL
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-DOLT
 AC_PROG_MAKE_SET
 PKG_PROG_PKG_CONFIG
 AC_PROG_LEX
diff --git a/m4/dolt.m4 b/m4/dolt.m4
deleted file mode 100644
index 7c62b6c..0000000
--- a/m4/dolt.m4
+++ /dev/null
@@ -1,181 +0,0 @@
-dnl dolt, a replacement for libtool
-dnl Copyright © 2007-2008 Josh Triplett <josh at freedesktop.org>
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-dnl
-dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
-dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
-dnl installed when running autoconf on your project.
-
-AC_DEFUN([DOLT], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-# dolt, a replacement for libtool
-# Josh Triplett <josh at freedesktop.org>
-AC_PATH_PROG(DOLT_BASH, bash)
-AC_MSG_CHECKING([if dolt supports this host])
-dolt_supported=yes
-if test x$DOLT_BASH = x; then
-    dolt_supported=no
-fi
-if test x$GCC != xyes; then
-    dolt_supported=no
-fi
-case $host in
-i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
-|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
-    pic_options='-fPIC'
-    ;;
-i?86-pc-cygwin*)
-    pic_options='-DDLL_EXPORT'
-    ;;
-i?86-apple-darwin*)
-    pic_options='-fno-common'
-    ;;
-*)
-    dolt_supported=no
-    ;;
-esac
-if test x$dolt_supported = xno ; then
-    AC_MSG_RESULT([no, falling back to libtool])
-    LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
-    LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
-else
-    AC_MSG_RESULT([yes, replacing libtool])
-
-dnl Start writing out doltcompile.
-    cat <<__DOLTCOMPILE__EOF__ >doltcompile
-#!$DOLT_BASH
-__DOLTCOMPILE__EOF__
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-args=("$[]@")
-for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
-    if test x"${args@<:@$arg@:>@}" = x-o ; then
-        objarg=$((arg+1))
-        break
-    fi
-done
-if test x$objarg = x ; then
-    echo 'Error: no -o on compiler command line' 1>&2
-    exit 1
-fi
-lo="${args@<:@$objarg@:>@}"
-obj="${lo%.lo}"
-if test x"$lo" = x"$obj" ; then
-    echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
-    exit 1
-fi
-objbase="${obj##*/}"
-__DOLTCOMPILE__EOF__
-
-dnl Write out shared compilation code.
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-libobjdir="${obj%$objbase}.libs"
-if test ! -d "$libobjdir" ; then
-    mkdir_out="$(mkdir "$libobjdir" 2>&1)"
-    mkdir_ret=$?
-    if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
-	echo "$mkdir_out" 1>&2
-        exit $mkdir_ret
-    fi
-fi
-pic_object="$libobjdir/$objbase.o"
-args@<:@$objarg@:>@="$pic_object"
-__DOLTCOMPILE__EOF__
-    cat <<__DOLTCOMPILE__EOF__ >>doltcompile
-"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
-__DOLTCOMPILE__EOF__
-    fi
-
-dnl Write out static compilation code.
-dnl Avoid duplicate compiler output if also building shared objects.
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-non_pic_object="$obj.o"
-args@<:@$objarg@:>@="$non_pic_object"
-__DOLTCOMPILE__EOF__
-        if test x$enable_shared = xyes; then
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
-__DOLTCOMPILE__EOF__
-        else
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" || exit $?
-__DOLTCOMPILE__EOF__
-        fi
-    fi
-
-dnl Write out the code to write the .lo file.
-dnl The second line of the .lo file must match "^# Generated by .*libtool"
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-{
-echo "# $lo - a libtool object file"
-echo "# Generated by doltcompile, not libtool"
-__DOLTCOMPILE__EOF__
-
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "pic_object='.libs/${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "non_pic_object='${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo non_pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-} > "$lo"
-__DOLTCOMPILE__EOF__
-
-dnl Done writing out doltcompile; substitute it for libtool compilation.
-    chmod +x doltcompile
-    LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
-    LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
-
-dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
-dnl a target, so write out a libtool wrapper to handle that case.
-dnl Note that doltlibtool does not handle inferred tags or option arguments
-dnl without '=', because automake does not use them.
-    cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
-#!$DOLT_BASH
-__DOLTLIBTOOL__EOF__
-    cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
-top_builddir_slash="${0%%doltlibtool}"
-: ${top_builddir_slash:=./}
-args=()
-modeok=false
-tagok=false
-for arg in "$[]@"; do
-    case "$arg" in
-        --silent) ;;
-        --mode=compile) modeok=true ;;
-        --tag=CC|--tag=CXX) tagok=true ;;
-        *) args@<:@${#args[@]}@:>@="$arg" ;;
-    esac
-done
-if $modeok && $tagok ; then
-    . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
-else
-    exec ${top_builddir_slash}libtool "$[]@"
-fi
-__DOLTLIBTOOL__EOF__
-
-dnl Done writing out doltlibtool; substitute it for libtool.
-    chmod +x doltlibtool
-    LIBTOOL='$(top_builddir)/doltlibtool'
-fi
-AC_SUBST(LTCOMPILE)
-AC_SUBST(LTCXXCOMPILE)
-# end dolt
-])
commit c7e4222c9a27094ce4fc2831ac92acbb7b21fb1a
Author: Tobias Droste <tdroste at gmx.de>
Date:   Wed Sep 29 22:51:48 2010 +0200

    randr: set error numbers of resource types in RRExtenstionInit() (V2)
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30367
    
    Currently the ddx calls xf86RandR12Init()
      (-> RRScreenInit()
         -> RRInit()
           -> RRModeInit()
           -> RRCrtcInit()
           -> RROutputInit())
    before RRExtensionInit() is called. This causes RRErrorBase
    being 0 while setting resource type error values (resource types:
    RROutput, RRMode and RRCrtc). The fix moves the setting of error
    values to own functions which are called in RRExtensionInit()
    to get the right RRErrorBase.
    
    V2: With header file
    
    Signed-off-by: Tobias Droste <tdroste at gmx.de>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/randr.c b/randr/randr.c
index f52a46a..6077705 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -354,6 +354,11 @@ RRExtensionInit (void)
 	SRRScreenChangeNotifyEvent;
     EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr)
 	SRRNotifyEvent;
+
+    RRModeInitErrorValue();
+    RRCrtcInitErrorValue();
+    RROutputInitErrorValue();
+
 #ifdef PANORAMIX
     RRXineramaExtensionInit();
 #endif
diff --git a/randr/randrstr.h b/randr/randrstr.h
index aad126f..03652ef 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -701,6 +701,12 @@ extern _X_EXPORT Bool
 RRCrtcInit (void);
 
 /*
+ * Initialize crtc type error value
+ */
+extern _X_EXPORT void
+RRCrtcInitErrorValue (void);
+
+/*
  * Crtc dispatch
  */
 
@@ -762,6 +768,12 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret);
  */
 extern _X_EXPORT Bool
 RRModeInit (void);
+
+/*
+ * Initialize mode type error value
+ */
+extern _X_EXPORT void
+RRModeInitErrorValue (void);
     
 extern _X_EXPORT int
 ProcRRCreateMode (ClientPtr client);
@@ -856,6 +868,12 @@ ProcRRGetOutputPrimary (ClientPtr client);
  */
 extern _X_EXPORT Bool
 RROutputInit (void);
+
+/*
+ * Initialize output type error value
+ */
+extern _X_EXPORT void
+RROutputInitErrorValue (void);
     
 /* rrpointer.c */
 extern _X_EXPORT void
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 14f6e45..98206a2 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -631,10 +631,19 @@ RRCrtcInit (void)
     RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC");
     if (!RRCrtcType)
 	return FALSE;
-    SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc);
+    
     return TRUE;
 }
 
+/*
+ * Initialize crtc type error value
+ */
+void
+RRCrtcInitErrorValue(void)
+{
+    SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc);
+}
+
 int
 ProcRRGetCrtcInfo (ClientPtr client)
 {
diff --git a/randr/rrmode.c b/randr/rrmode.c
index deddd3c..5ffa400 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -260,6 +260,9 @@ RRModeDestroyResource (pointer value, XID pid)
     return 1;
 }
 
+/*
+ * Initialize mode type
+ */
 Bool
 RRModeInit (void)
 {
@@ -268,10 +271,19 @@ RRModeInit (void)
     RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
     if (!RRModeType)
 	return FALSE;
-    SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
+    
     return TRUE;
 }
 
+/*
+ * Initialize mode type error value
+ */
+void
+RRModeInitErrorValue(void)
+{
+    SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
+}
+
 int
 ProcRRCreateMode (ClientPtr client)
 {
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 937b14d..5edeb7d 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -418,10 +418,19 @@ RROutputInit (void)
     RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
     if (!RROutputType)
 	return FALSE;
-    SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
+
     return TRUE;
 }
 
+/*
+ * Initialize output type error value
+ */
+void
+RROutputInitErrorValue(void)
+{
+    SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
+}
+
 #define OutputInfoExtra	(SIZEOF(xRRGetOutputInfoReply) - 32)
 
 int
commit 72a9c686d7ecaa68d27687b316dbba92902809b4
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Sep 29 17:05:12 2010 +0100

    Cygwin/X: Fix compilation after "delete pervasively use of DISPATCH_PROC"
    
    commit cbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e
    removes the static declarations of ProcWindowsWMDispatch and
    SProcWindowsWMDispatch which precede their first use in
    winWindowsWMExtensionInit()
    
    Move winWindowsWMExtensionInit() to after the definition of those
    two functions to fix compilation.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index ca3dbc3..4027539 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -44,8 +44,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "protocol-versions.h"
 
 static int WMErrorBase;
-
-
 static unsigned char WMReqCode = 0;
 static int WMEventBase = 0;
 
@@ -78,31 +76,6 @@ make_box (int x, int y, int w, int h)
   return r;
 }
 
-void
-winWindowsWMExtensionInit (void)
-{
-  ExtensionEntry* extEntry;
-
-  ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
-  eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
-  eventResource = FakeClientID(0);
-
-  if (ClientType && eventResourceType &&
-      (extEntry = AddExtension(WINDOWSWMNAME,
-			       WindowsWMNumberEvents,
-			       WindowsWMNumberErrors,
-			       ProcWindowsWMDispatch,
-			       SProcWindowsWMDispatch,
-			       NULL,
-			       StandardMinorOpcode)))
-    {
-      WMReqCode = (unsigned char)extEntry->base;
-      WMErrorBase = extEntry->errorBase;
-      WMEventBase = extEntry->eventBase;
-      EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
-    }
-}
-
 static int
 ProcWindowsWMQueryVersion(register ClientPtr client)
 {
@@ -639,3 +612,28 @@ SProcWindowsWMDispatch (register ClientPtr client)
       return BadRequest;
     }
 }
+
+void
+winWindowsWMExtensionInit (void)
+{
+  ExtensionEntry* extEntry;
+
+  ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
+  eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
+  eventResource = FakeClientID(0);
+
+  if (ClientType && eventResourceType &&
+      (extEntry = AddExtension(WINDOWSWMNAME,
+			       WindowsWMNumberEvents,
+			       WindowsWMNumberErrors,
+			       ProcWindowsWMDispatch,
+			       SProcWindowsWMDispatch,
+			       NULL,
+			       StandardMinorOpcode)))
+    {
+      WMReqCode = (unsigned char)extEntry->base;
+      WMErrorBase = extEntry->errorBase;
+      WMEventBase = extEntry->eventBase;
+      EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+    }
+}
commit 1a9022d3289ff74043112808cc8aa315fd9c40e8
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Tue Sep 28 13:59:19 2010 -0700

    Bump video driver ABI version to 9.0
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 51b9b16..7a8f62f 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -82,7 +82,7 @@ typedef enum {
  * mask is 0xFFFF0000.
  */
 #define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(8, 0)
+#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(9, 0)
 #define ABI_XINPUT_VERSION	SET_ABI_VERSION(11, 0)
 #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(4, 0)
 #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 6)


More information about the Xquartz-changes mailing list