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

Jeremy Huddleston jeremyhu at freedesktop.org
Fri Jul 15 10:46:56 PDT 2011


 Xext/xtest.c                            |    9 +
 Xext/xvmc.c                             |   11 +-
 configure.ac                            |   14 ---
 dix/dixutils.c                          |   10 +-
 dix/getevents.c                         |   25 +++--
 dix/grabs.c                             |  112 ++++++++++++++++++++++++
 dix/window.c                            |  149 ++++++++++++++++++++++++++------
 exa/exa.c                               |    4 
 exa/exa_accel.c                         |    6 -
 exa/exa_classic.c                       |    2 
 exa/exa_driver.c                        |    2 
 exa/exa_migration_classic.c             |    4 
 exa/exa_migration_mixed.c               |    2 
 exa/exa_mixed.c                         |    2 
 exa/exa_unaccel.c                       |    2 
 fb/fb24_32.c                            |    4 
 fb/fbarc.c                              |    9 -
 fb/fbfill.c                             |    6 -
 fb/fbgc.c                               |    4 
 fb/fbpush.c                             |    2 
 glx/Makefile.am                         |    6 -
 glx/glxdri2.c                           |    9 -
 glx/glxscreens.c                        |    7 +
 glx/glxscreens.h                        |    1 
 hw/dmx/config/xdmxconfig.c              |    8 -
 hw/dmx/dmxinput.c                       |    1 
 hw/dmx/examples/xbell.c                 |    3 
 hw/dmx/glxProxy/glxscreens.h            |    1 
 hw/dmx/input/dmxinputinit.c             |    3 
 hw/kdrive/ephyr/ephyr.c                 |    2 
 hw/kdrive/ephyr/ephyr.h                 |    2 
 hw/kdrive/ephyr/ephyr_draw.c            |    2 
 hw/kdrive/ephyr/ephyrinit.c             |    3 
 hw/kdrive/ephyr/hostx.c                 |    2 
 hw/kdrive/ephyr/hostx.h                 |    2 
 hw/kdrive/ephyr/os.c                    |    2 
 hw/kdrive/fake/fakeinit.c               |    1 
 hw/kdrive/fake/kbd.c                    |    2 
 hw/kdrive/fbdev/fbdev.c                 |    2 
 hw/kdrive/fbdev/fbdev.h                 |    2 
 hw/kdrive/fbdev/fbinit.c                |    3 
 hw/kdrive/linux/keyboard.c              |    8 -
 hw/kdrive/linux/linux.c                 |    2 
 hw/kdrive/linux/mouse.c                 |    2 
 hw/kdrive/linux/ps2.c                   |    2 
 hw/kdrive/linux/tslib.c                 |   10 +-
 hw/kdrive/src/kcmap.c                   |    2 
 hw/kdrive/src/kdrive.h                  |    4 
 hw/kdrive/src/kinfo.c                   |    2 
 hw/kdrive/src/kinput.c                  |   11 +-
 hw/kdrive/src/kshadow.c                 |    2 
 hw/vfb/InitInput.c                      |    1 
 hw/xfree86/common/xf86Init.c            |    1 
 hw/xfree86/dixmods/xkbPrivate.c         |   15 +++
 hw/xfree86/dri2/dri2.c                  |    1 
 hw/xfree86/dri2/dri2.h                  |    2 
 hw/xfree86/dri2/dri2ext.c               |    7 -
 hw/xfree86/exa/examodule.c              |    2 
 hw/xfree86/modes/xf86Modes.h            |    2 
 hw/xfree86/modes/xf86cvt.c              |    4 
 hw/xfree86/os-support/solaris/sun_agp.c |    4 
 hw/xnest/Init.c                         |    1 
 hw/xquartz/GL/indirect.c                |    3 
 hw/xquartz/darwin.c                     |    4 
 hw/xquartz/darwinEvents.c               |    4 
 hw/xquartz/darwinEvents.h               |    1 
 hw/xquartz/darwinXinput.c               |    5 -
 hw/xwin/InitInput.c                     |    1 
 hw/xwin/XWin.rc                         |    2 
 hw/xwin/glx/Makefile.am                 |    6 +
 hw/xwin/glx/gen_gl_wrappers.py          |    2 
 hw/xwin/glx/indirect.c                  |  102 ++++++++++++++++-----
 hw/xwin/glx/wgl_ext_api.c               |   13 +-
 hw/xwin/glx/winpriv.c                   |    5 -
 hw/xwin/man/XWin.man                    |    4 
 hw/xwin/man/XWinrc.man                  |    2 
 hw/xwin/windialogs.c                    |    2 
 hw/xwin/winmultiwindowwindow.c          |   64 +++++++++----
 hw/xwin/winmultiwindowwndproc.c         |   72 +++++++++++++++
 hw/xwin/winwindow.h                     |    4 
 include/dixgrabs.h                      |    3 
 include/input.h                         |    9 +
 include/window.h                        |    2 
 mi/mipointer.c                          |    2 
 miext/shadow/shadow.c                   |    2 
 miext/shadow/shpacked.c                 |    2 
 miext/shadow/shplanar.c                 |    2 
 miext/shadow/shplanar8.c                |    2 
 miext/shadow/shrotate.c                 |    2 
 miext/shadow/shrotpack.h                |    2 
 miext/shadow/shrotpackYX.h              |    2 
 test/Makefile.am                        |    1 
 test/xi2/protocol-eventconvert.c        |   18 ++-
 xfixes/cursor.c                         |    4 
 xfixes/region.c                         |    2 
 xkb/xkb.c                               |   19 +++-
 xkb/xkmread.c                           |   31 ++++++
 97 files changed, 697 insertions(+), 232 deletions(-)

New commits:
commit 89bfa0c633f3096cca6f983bca1507d3f4b902a8
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Jul 15 10:39:39 2011 -0700

    XQuartz: DarwinEQFini doesn't return Bool
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 1f22099..c367e3c 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -371,7 +371,7 @@ Bool DarwinEQInit(void) {
     return TRUE;
 }
 
-Bool DarwinEQFini(void) {
+void DarwinEQFini(void) {
     mieqFini();
 }
 
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index bd29d51..aefb5c7 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -32,7 +32,7 @@
 #define XQUARTZ_VALUATOR_LIMIT (1 << 16)
 
 Bool DarwinEQInit(void);
-Bool DarwinEQFini(void);
+void DarwinEQFini(void);
 void DarwinEQEnqueue(const xEventPtr e);
 void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
 void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
commit 82f5521a6d91ebcd2a4400f6c221ad625edc99a1
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 13 12:08:04 2011 +0100

    XKB: Work around broken interps from old xkbcomp
    
    Bugfix for broken xkbcomp: if we encounter an XFree86Private action with
    Any+AnyOfOrNone(All), then we skip the interp as broken.  Versions of
    xkbcomp below 1.2.2 had a bug where they would interpret a symbol that
    couldn't be found in an interpret as Any.  So, an
    XF86LogWindowTree+AnyOfOrNone(All) interp that triggered the PrWins
    action would make every key without an action trigger PrWins if libX11
    didn't yet know about the XF86LogWindowTree keysym.  None too useful.
    
    We only do this for XFree86 actions, as the current XKB dataset relies
    on Any+AnyOfOrNone(All) -> SetMods for Ctrl in particular.
    
    See xkbcomp commits 2a473b906943ffd807ad81960c47530ee7ae9a60 and
    3caab5aa37decb7b5dc1642a0452efc3e1f5100e for more details.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 86231a8..9c66955 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2786,6 +2786,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
     if (req->nSI>0) {
 	xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data;
 	XkbSymInterpretPtr	sym;
+	unsigned int		skipped = 0;
 	if ((unsigned)(req->firstSI+req->nSI)>compat->num_si) {
 	    compat->num_si= req->firstSI+req->nSI;
 	    compat->sym_interpret= realloc(compat->sym_interpret,
@@ -2799,11 +2800,19 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
 	    compat->num_si = req->firstSI+req->nSI;
 	}
 	sym = &compat->sym_interpret[req->firstSI];
-	for (i=0;i<req->nSI;i++,wire++,sym++) {
+	for (i=0;i<req->nSI;i++,wire++) {
 	    if (client->swapped) {
 		int n;
 		swapl(&wire->sym,n);
 	    }
+	    if (wire->sym == NoSymbol && wire->match == XkbSI_AnyOfOrNone &&
+		(wire->mods & 0xff) == 0xff &&
+		wire->act.type == XkbSA_XFree86Private) {
+		ErrorF("XKB: Skipping broken Any+AnyOfOrNone(All) -> Private "
+		       "action from client\n");
+		skipped++;
+		continue;
+	    }
 	    sym->sym= wire->sym;
 	    sym->mods= wire->mods;
 	    sym->match= wire->match;
@@ -2811,6 +2820,14 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
 	    sym->virtual_mod= wire->virtualMod;
 	    memcpy((char *)&sym->act,(char *)&wire->act,
                    SIZEOF(xkbActionWireDesc));
+            sym++;
+	}
+	if (skipped) {
+	    if (req->firstSI + req->nSI < compat->num_si)
+		memmove(sym, sym + skipped,
+	                (compat->num_si - req->firstSI - req->nSI) *
+			 sizeof(*sym));
+	    compat->num_si -= skipped;
 	}
 	data = (char *)wire;
     }
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index e8b97dc..a5c1ecf 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -425,9 +425,9 @@ XkbAction               *act;
     if (XkbAllocCompatMap(xkb,XkbAllCompatMask,num_si)!=Success)
 	return -1;
     compat= xkb->compat;
-    compat->num_si= num_si;
+    compat->num_si= 0;
     interp= compat->sym_interpret;
-    for (i=0;i<num_si;i++,interp++) {
+    for (i=0;i<num_si;i++) {
 	tmp= fread(&wire,SIZEOF(xkmSymInterpretDesc),1,file);
 	nRead+= tmp*SIZEOF(xkmSymInterpretDesc);
 	interp->sym= wire.sym;
@@ -520,6 +520,29 @@ XkbAction               *act;
             break;
 
         case XkbSA_XFree86Private:
+            /*
+             * Bugfix for broken xkbcomp: if we encounter an XFree86Private
+             * action with Any+AnyOfOrNone(All), then we skip the interp as
+             * broken.  Versions of xkbcomp below 1.2.2 had a bug where they
+             * would interpret a symbol that couldn't be found in an interpret
+             * as Any.  So, an XF86LogWindowTree+AnyOfOrNone(All) interp that
+             * triggered the PrWins action would make every key without an
+             * action trigger PrWins if libX11 didn't yet know about the
+             * XF86LogWindowTree keysym.  None too useful.
+             *
+             * We only do this for XFree86 actions, as the current XKB
+             * dataset relies on Any+AnyOfOrNone(All) -> SetMods for Ctrl in
+             * particular.
+             *
+             * See xkbcomp commits 2a473b906943ffd807ad81960c47530ee7ae9a60 and
+             * 3caab5aa37decb7b5dc1642a0452efc3e1f5100e for more details.
+             */
+            if (interp->sym == NoSymbol && interp->match == XkbSI_AnyOfOrNone &&
+                (interp->mods & 0xff) == 0xff) {
+                ErrorF("XKB: Skipping broken Any+AnyOfOrNone(All) -> Private "
+                       "action from compiled keymap\n");
+                continue;
+            }
             /* copy the kind of action */
             memcpy(act->any.data, wire.actionData, XkbAnyActionDataSize);
             break ;
@@ -531,10 +554,12 @@ XkbAction               *act;
             /* unsupported. */
             break;
         }
+        interp++;
+        compat->num_si++;
     }
     if ((num_si>0)&&(changes)) {
 	changes->compat.first_si= 0;
-	changes->compat.num_si= num_si;
+	changes->compat.num_si= compat->num_si;
     }
     if (groups) {
 	register unsigned bit;
commit c177a5bcaa170d24a784540460906cc04ac5c752
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 13 12:08:03 2011 +0100

    Fix non-Composite builds in PrintWindowTree
    
    The previous patch accidentally introduced a hard dependency on
    Composite.  Sorry, OS X.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reported-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/window.c b/dix/window.c
index 556509a..1953f02 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -125,7 +125,9 @@ Equipment Corporation.
 #include "dixevents.h"
 #include "globals.h"
 #include "mi.h" /* miPaintWindow */
+#ifdef COMPOSITE
 #include "compint.h"
+#endif
 
 #include "privates.h"
 #include "xace.h"
@@ -180,19 +182,23 @@ static Bool TileScreenSaver(ScreenPtr pScreen, int kind);
 
 #define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
 
+#ifdef COMPOSITE
 static const char *overlay_win_name = "<composite overlay>";
+#endif
 
 static const char *
 get_window_name(WindowPtr pWin)
 {
 #define WINDOW_NAME_BUF_LEN 512
     PropertyPtr prop;
-    CompScreenPtr comp_screen = GetCompScreen(pWin->drawable.pScreen);
     static char buf[WINDOW_NAME_BUF_LEN];
     int len;
+#ifdef COMPOSITE
+    CompScreenPtr comp_screen = GetCompScreen(pWin->drawable.pScreen);
 
     if (comp_screen && pWin == comp_screen->pOverlayWin)
         return overlay_win_name;
+#endif
 
     for (prop = wUserProps(pWin); prop; prop = prop->next)
     {
@@ -230,11 +236,13 @@ static void log_window_info(WindowPtr pWin, int depth)
 
     if (pWin->overrideRedirect)
         ErrorF(" (override redirect)");
+#ifdef COMPOSITE
     if (pWin->redirectDraw)
         ErrorF(" (%s compositing: pixmap %x)",
                (pWin->redirectDraw == RedirectDrawAutomatic) ?
                 "automatic" : "manual",
                pScreen->GetWindowPixmap(pWin)->drawable.id);
+#endif
 
     switch (pWin->visibility)
     {
commit 01dbf2514aa0cc8c40a876a24e3cb0737c41da19
Merge: 5a801af... af0fbc3...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Jul 13 11:44:15 2011 -0700

    Merge remote-tracking branch 'jturney/master'

commit 5a801af689fce9dfe84453bbc2b029cb4782de83
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Tue Jul 12 19:50:05 2011 -0400

    XWinrc: replace hard coded section number with __filemansuffix__
    
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man
index 5c1fb97..e4c454f 100644
--- a/hw/xwin/man/XWinrc.man
+++ b/hw/xwin/man/XWinrc.man
@@ -1,4 +1,4 @@
-.TH XWIN 5 __vendorversion__
+.TH XWIN __filemansuffix__ __vendorversion__
 
 
 .SH NAME
commit af0fbc37e35ddaabf12a8d7abc79ea11958ec8ac
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Jun 23 07:45:13 2011 -0400

    XWinrc: replace hard coded section number with __filemansuffix__
    
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man
index 5c1fb97..e4c454f 100644
--- a/hw/xwin/man/XWinrc.man
+++ b/hw/xwin/man/XWinrc.man
@@ -1,4 +1,4 @@
-.TH XWIN 5 __vendorversion__
+.TH XWIN __filemansuffix__ __vendorversion__
 
 
 .SH NAME
commit 42bc198775a78b328612427c4c8ed4d17e005ae9
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jan 24 18:29:41 2011 +0000

    glx: Remove a few lingering traces of __GLXscreen.GLXVersion
    
    The GLXversion member of the __GLXscreen struct
    is just cruft since commit ad5c0d9efa47476ed5cf75c82265c73919e468b4,
    when we started returning the minimum GLX version supported by all
    of the screens on the display, rather than the maximum version supported
    by the server.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index 93b4109..eb29260 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -142,7 +142,6 @@ struct __GLXscreen {
     char *GLextensions;
 
     char *GLXvendor;
-    char *GLXversion;
     char *GLXextensions;
 
     /**
diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h
index a57c387..da50bdc 100644
--- a/hw/dmx/glxProxy/glxscreens.h
+++ b/hw/dmx/glxProxy/glxscreens.h
@@ -43,7 +43,6 @@ typedef struct {
     GLint *isGLXvis;
 
     char *GLXvendor;
-    char *GLXversion;
     char *GLXextensions;
 
 } __GLXscreenInfo;
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 4116872..4876ab9 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -477,7 +477,8 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
 
     __glXScreenInit(&screen->base, pScreen);
 
-    screen->base.GLXversion = strdup("1.4");
+    screen->base.GLXmajor = 1;
+    screen->base.GLXminor = 4;
     screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig "
                                         "GLX_SGIS_multisample "
                                         "GLX_ARB_multisample "
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 235e96b..86fef55 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -735,30 +735,26 @@ glxWinScreenProbe(ScreenPtr pScreen)
 
       //
       // Override the GLX version (__glXScreenInit() sets it to "1.2")
-      // if we have all the needed extensionsto operate as a higher version
+      // if we have all the needed extensions to operate as a higher version
       //
       // SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3
       // ARB_multisample -> 1.4
       //
       if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read)
         {
-          free(screen->base.GLXversion);
-
           if (screen->has_WGL_ARB_multisample)
             {
-              screen->base.GLXversion = strdup("1.4");
               screen->base.GLXmajor = 1;
               screen->base.GLXminor = 4;
             }
           else
             {
-              screen->base.GLXversion = strdup("1.3");
               screen->base.GLXmajor = 1;
               screen->base.GLXminor = 3;
             }
-          LogMessage(X_INFO, "AIGLX: Set GLX version to %s\n", screen->base.GLXversion);
         }
     }
+    LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n", screen->base.GLXmajor, screen->base.GLXminor);
 
     wglMakeCurrent(NULL, NULL);
     wglDeleteContext(hglrc);
commit 005e68ba59782b60dd5c44a06c75b1fa5e8d70d8
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jan 20 16:21:04 2011 +0000

    hw/xwin: Add -wgl option to XWin manpage
    
    Document the -[no]wgl options in the XWin manpage
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index 7975fd3..6e69a18 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -208,6 +208,10 @@ Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
 signal to exit the X Server.  The \fICtrl-Alt-Backspace\fP key combination
 is disabled by default.
 .TP 8
+.B \-[no]wgl
+Enable [disable] the GLX extension to use the native Windows WGL interface
+for hardware accelerated OpenGL (AIGLX). (Experimental)
+.TP 8
 .B \-[no]winkill
 Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
 X Server.
commit d62726019e4b7bfac8a23d0d733677b141047d66
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue Nov 2 11:38:53 2010 +0000

    hw/xwin: Add items to WGL AIGLX todo
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 478e0ec..235e96b 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -49,8 +49,17 @@
   - pbuffer clobbering: we don't get async notification, but can we arrange to emit the
     event when we notice it's been clobbered? at the very least, check if it's been clobbered
     before using it?
-  - are the __GLXConfig * we get handed back ones we are made (so we can extend the structure
-    with privates?) Or are they created inside the GLX core as well?
+  - XGetImage() doesn't work on pixmaps; need to do more work to make the format and location
+    of the native pixmap compatible
+  - implement GLX_EXT_texture_from_pixmap in terms of WGL_ARB_render_texture
+    (not quite straightforward as we will have to create a pbuffer and copy the pixmap texture
+     into it)
+*/
+
+/*
+  Assumptions:
+  - the __GLXConfig * we get handed back ones we are made (so we can extend the structure
+    with privates) and never get created inside the GLX core
 */
 
 /*
commit 276735ef5d12e79fe051996f100c5730c1e69334
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Oct 11 16:22:49 2010 +0100

    hw/xwin: Report Window XIDs in Window debug messages
    
    Report Window XIDs in Window create/destroy/reparent debug messages
    
    It's actually quite useful if you are trying to corrolate those events
    with what a client is doing...
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index 7772a75..4609737 100644
--- a/hw/xwin/glx/winpriv.c
+++ b/hw/xwin/glx/winpriv.c
@@ -19,7 +19,7 @@ winCreateWindowsWindow (WindowPtr pWin);
  */
 HWND winGetWindowInfo(WindowPtr pWin)
 {
-    winDebug("%s: pWin=%p\n", __FUNCTION__, pWin);
+    winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id);
 
     /* a real window was requested */
     if (pWin != NULL)
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 2139c7c..2329d16 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -375,9 +375,8 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
   ScreenPtr		pScreen = pWin->drawable.pScreen;
   winScreenPriv(pScreen);
 
-#if CYGMULTIWINDOW_DEBUG
-  ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin);
-#endif
+  winDebug("winReparentMultiWindow - pWin:%08x XID:0x%x, reparent from pWin:%08x XID:0x%x to pWin:%08x XID:0x%x\n",
+           pWin, pWin->drawable.id, pPriorParent, pPriorParent->drawable.id, pWin->parent, pWin->parent->drawable.id);
 
   WIN_UNWRAP(ReparentWindow);
   if (pScreen->ReparentWindow) 
@@ -501,9 +500,7 @@ winCreateWindowsWindow (WindowPtr pWin)
 
   winInitMultiWindowClass();
 
-#if CYGMULTIWINDOW_DEBUG
-  ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
-#endif
+  winDebug("winCreateWindowsTopLevelWindow - pWin:%08x XID:0x%x \n", pWin, pWin->drawable.id);
 
   iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
   iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
@@ -629,9 +626,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
   HICON hIcon;
   HICON hIconSm;
 
-#if CYGMULTIWINDOW_DEBUG
-  ErrorF ("winDestroyWindowsWindow\n");
-#endif
+  winDebug("winDestroyWindowsWindow - pWin:%08x XID:0x%x \n", pWin, pWin->drawable.id);
 
   /* Bail out if the Windows window handle is invalid */
   if (pWinPriv->hWnd == NULL)
@@ -671,9 +666,7 @@ winDestroyWindowsWindow (WindowPtr pWin)
 
   winInDestroyWindowsWindow = oldstate;
 
-#if CYGMULTIWINDOW_DEBUG
-  ErrorF ("-winDestroyWindowsWindow\n");
-#endif
+  winDebug("winDestroyWindowsWindow - done\n");
 }
 
 
commit b0b54338e2f8aed6e6a683ebddd2a2acbefabecd
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Oct 11 16:25:03 2010 +0100

    hw/xwin: Add a flag to track which windows have been drawn to using WGL.
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index cdcba35..6b840ba 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -16,7 +16,11 @@ if XWIN_MULTIWINDOWEXTWM
 DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
 endif
 
-DEFS =  $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM)
+if XWIN_GLX_WINDOWS
+DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
+endif
+
+DEFS =  $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS)
 
 INCLUDES = -I$(top_srcdir)/miext/rootless
 
diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index a35392b..7772a75 100644
--- a/hw/xwin/glx/winpriv.c
+++ b/hw/xwin/glx/winpriv.c
@@ -61,6 +61,9 @@ HWND winGetWindowInfo(WindowPtr pWin)
               {
                 /* copy window handle */
                 hwnd = pWinPriv->hWnd;
+
+                /* mark GLX active on that hwnd */
+                pWinPriv->fWglUsed = TRUE;
               }
 
             return hwnd;
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 2d9a46e..2139c7c 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -110,7 +110,10 @@ winCreateWindowMultiWindow (WindowPtr pWin)
   pWinPriv->hWnd = NULL;
   pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
   pWinPriv->fXKilled = FALSE;
- 
+#ifdef XWIN_GLX_WINDOWS
+  pWinPriv->fWglUsed = FALSE;
+#endif
+
   return fResult;
 }
 
@@ -652,6 +655,11 @@ winDestroyWindowsWindow (WindowPtr pWin)
   winDestroyIcon(hIcon);
   winDestroyIcon(hIconSm);
 
+#ifdef XWIN_GLX_WINDOWS
+  /* No longer note WGL used on this window */
+  pWinPriv->fWglUsed = FALSE;
+#endif
+
   /* Process all messages on our queue */
   while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
     {
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 1a3be78..fb1938b 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -472,6 +472,20 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
 	return 0;
       }
 
+#ifdef XWIN_GLX_WINDOWS
+      if (pWinPriv->fWglUsed)
+        {
+          /*
+             For regions which are being drawn by GL, the shadow framebuffer doesn't have the
+             correct bits, so don't bitblt from the shadow framebuffer
+
+             XXX: For now, just leave it alone, but ideally we want to send an expose event to
+             the window so it really redraws the affected region...
+          */
+          ValidateRect(hwnd, &(ps.rcPaint));
+        }
+      else
+#endif
       /* Try to copy from the shadow buffer */
       if (!BitBlt (hdcUpdate,
 		   ps.rcPaint.left, ps.rcPaint.top,
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index ebe4309..a6c8e05 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -80,6 +80,9 @@ typedef struct
   winPrivScreenPtr	pScreenPriv;
   Bool			fXKilled;
   HDWP                  hDwp;
+#ifdef XWIN_GLX_WINDOWS
+  Bool			fWglUsed;
+#endif
 
   /* Privates used by primary fb DirectDraw server */
   LPDDSURFACEDESC	pddsdPrimary;
commit 98c6d91a48f460fdbca93700ab637eadf946fb0e
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Thu Mar 24 20:39:51 2011 +0000

    hw/xwin/glx: Fix some warnings in generated wrapper code
    
    Add a suitable cast to the generated code for glWinSetupDispatchTable()
    so it doesn't generate screeds of warnings
    
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index d7fe98d..e2d960e 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -312,7 +312,7 @@ if dispatchheader :
 
         for d in sorted(dispatch.keys()) :
                 if wrappers.has_key(d) :
-                        print '  SET_'+ d + '(disp, ' + prefix + d + 'Wrapper);'
+                        print '  SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);'
                 else :
                         print '#warning  No wrapper for ' + prefix + d + ' !'
 
commit b67e80c84e4af54007aa1bd1e4a97a4d1b3d3765
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jan 24 18:41:05 2011 +0000

    hw/xwin/glx: Handle failure to get any fbconfigs more gracefully.
    
    Handle failure to get any useful pixel formats for GLX fbconfigs
    more gracefully:  If we didn't get any useful pixel formats from
    wglGetPixelFormatAttribivARB(), fall back to using DescribePixelFormat().
    If that doesn't give us any useful pixel formats, fallback to software
    rendering.
    
    This works around a problem with Intel 845G drivers, where
    wglGetPixelFormatAttribivARB() doesn't seem to work as we expect it to...
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index ea4f97b..478e0ec 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -668,17 +668,37 @@ glxWinScreenProbe(ScreenPtr pScreen)
       screen->base.swapInterval = glxWinScreenSwapInterval;
       screen->base.pScreen = pScreen;
 
+      // Creating the fbConfigs initializes screen->base.fbconfigs and screen->base.numFBConfigs
       if (strstr(wgl_extensions, "WGL_ARB_pixel_format"))
         {
           glxWinCreateConfigsExt(hdc, screen);
-          screen->has_WGL_ARB_pixel_format = TRUE;
+
+          /*
+            Some graphics drivers appear to advertise WGL_ARB_pixel_format,
+            but it doesn't work usefully, so we have to be prepared for it
+            to fail and fall back to using DescribePixelFormat()
+          */
+          if (screen->base.numFBConfigs > 0)
+            {
+              screen->has_WGL_ARB_pixel_format = TRUE;
+            }
         }
-      else
+
+      if (screen->base.numFBConfigs <= 0)
         {
           glxWinCreateConfigs(hdc, screen);
           screen->has_WGL_ARB_pixel_format = FALSE;
         }
-      // Initializes screen->base.fbconfigs and screen->base.numFBConfigs
+
+      /*
+        If we still didn't get any fbConfigs, we can't provide GLX for this screen
+       */
+      if (screen->base.numFBConfigs <= 0)
+        {
+          free(screen);
+          LogMessage(X_ERROR,"AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n");
+          return NULL;
+        }
 
       /* These will be set by __glXScreenInit */
       screen->base.visuals = NULL;
commit 9915b169237e3b2d817bd3d4455f3c01dd7dd2b5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Nov 1 19:53:42 2010 +0000

    hw/xwin/glx: Don't spam log with wglwrap symbol resolution status at startup
    
    ... instead just log if an attempt is made to call a wrapper for
    a function which didn't resolve
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/wgl_ext_api.c b/hw/xwin/glx/wgl_ext_api.c
index 1020916..78b6e2a 100644
--- a/hw/xwin/glx/wgl_ext_api.c
+++ b/hw/xwin/glx/wgl_ext_api.c
@@ -43,17 +43,14 @@
     static type type##proc = NULL;
 
 #define PRERESOLVE(type, symbol) \
-    type##proc = (type)wglGetProcAddress(symbol); \
-    if (type##proc == NULL) \
-        ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \
-    else \
-        ErrorF("wglwrap: Resolved \"%s\"\n", symbol);
+    type##proc = (type)wglGetProcAddress(symbol);
 
 #define RESOLVE_RET(type, symbol, retval) \
   if (type##proc == NULL) { \
-  __glXErrorCallBack(0); \
-  return retval; \
-      }
+    ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \
+    __glXErrorCallBack(0); \
+    return retval; \
+  }
 
 #define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,)
 
commit 8216316867f07819b8e8b377f2633fbf8876abf7
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Oct 30 17:23:52 2010 +0100

    hw/xwin/glx: Better handling of SetPixelFormat() failure
    
    Propagate and report the failure if SetPixelFormat() fails
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 3232299..ea4f97b 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -987,7 +987,7 @@ int glxWinReleaseTexImage(__GLXcontext  *baseContext,
  * lists with the old one...
  */
 
-static void
+static Bool
 glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawableTypeOverride)
 {
   __GLXscreen *screen = gc->base.pGlxScreen;
@@ -1009,10 +1009,10 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (!SetPixelFormat(hdc, winConfig->pixelFormatIndex, NULL))
         {
           ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
-          return;
+          return FALSE;
         }
 
-      return;
+      return TRUE;
     }
 
   /*
@@ -1044,7 +1044,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (fbConfigToPixelFormat(gc->base.config, &pfd, drawableTypeOverride))
         {
           ErrorF("glxWinSetPixelFormat: fbConfigToPixelFormat failed\n");
-          return;
+          return FALSE;
         }
 
       if (glxWinDebugSettings.dumpPFD)
@@ -1060,7 +1060,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (pixelFormat == 0)
         {
           ErrorF("ChoosePixelFormat error: %s\n", glxWinErrorMessage());
-          return;
+          return FALSE;
         }
 
       GLWIN_DEBUG_MSG("ChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat);
@@ -1069,7 +1069,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (!SetPixelFormat(hdc, pixelFormat, &pfd))
         {
           ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
-          return;
+          return FALSE;
         }
     }
   else
@@ -1078,7 +1078,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (pixelFormat == 0)
         {
           ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage());
-          return;
+          return FALSE;
         }
 
       GLWIN_DEBUG_MSG("wglChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat);
@@ -1087,9 +1087,11 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable
       if (!SetPixelFormat(hdc, pixelFormat, NULL))
         {
           ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage());
-          return;
+          return FALSE;
         }
     }
+
+  return TRUE;
 }
 
 static HDC
@@ -1140,7 +1142,13 @@ glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd)
           gc->hwnd = *hwnd;
 
           /* We must select a pixelformat, but SetPixelFormat can only be called once for a window... */
-          glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT);
+          if (!glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT))
+            {
+              ErrorF("glxWinSetPixelFormat error: %s\n", glxWinErrorMessage());
+              ReleaseDC(*hwnd, *hdc);
+              *hdc = NULL;
+              return NULL;
+            }
         }
     }
     break;
commit eecc8e06eb4bdfd4354144206d990cd9ccb69721
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Oct 30 17:22:33 2010 +0100

    hw/xwin/glx: Improvements to glxWinErrorMessage() reporting in WGL GLX provider
    
    Request the message using languageID 0 (best effort), rather than only using language neutral messages
    Always report the numeric error code.
    Trim any trailing \r from FormatMessage() output
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 720b2f0..3232299 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -211,22 +211,25 @@ static
 const char *glxWinErrorMessage(void)
 {
   static char errorbuffer[1024];
+  unsigned int last_error = GetLastError();
 
   if (!FormatMessage(
-                     FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+                     FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK,
                      NULL,
-                     GetLastError(),
-                     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                     last_error,
+                     0,
                      (LPTSTR) &errorbuffer,
                      sizeof(errorbuffer),
                      NULL ))
     {
-      snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error in FormatMessage: %08x!", (unsigned)GetLastError());
+      snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error");
     }
 
-  if (errorbuffer[strlen(errorbuffer)-1] == '\n')
+  if ((errorbuffer[strlen(errorbuffer)-1] == '\n') || (errorbuffer[strlen(errorbuffer)-1] == '\r'))
     errorbuffer[strlen(errorbuffer)-1] = 0;
 
+  sprintf(errorbuffer + strlen(errorbuffer), " (%08x)", last_error);
+
   return errorbuffer;
 }
 
commit 3873be16d050ab12fc78f1e7f0c36c2ac88d0a98
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Oct 11 16:21:40 2010 +0100

    hw/xwin/glx: Fix fbconfig dumper formatting for 3 digit index numbers
    
    Some graphics hardware supports hundreds of pixel formats, so adjust
    formatting in fbconfig dumper for 3 digit index numbers
    
    Also report the PFD_SUPPORT_DIRECTDRAW, PFD_DIRECT3D_ACCELERATED and
    PFD_SUPPORT_COMPOSITION flags introduced with aero
    
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index bd2a1ad..720b2f0 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -80,6 +80,17 @@
 
 #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1]))
 
+/* Not yet in w32api */
+#ifndef PFD_SUPPORT_DIRECTDRAW
+#define PFD_SUPPORT_DIRECTDRAW   0x00002000
+#endif
+#ifndef PFD_DIRECT3D_ACCELERATED
+#define PFD_DIRECT3D_ACCELERATED 0x00004000
+#endif
+#ifndef PFD_SUPPORT_COMPOSITION
+#define PFD_SUPPORT_COMPOSITION  0x00008000
+#endif
+
 /* ---------------------------------------------------------------------- */
 /*
  *   structure definitions
@@ -247,6 +258,9 @@ static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd)
         DUMP_PFD_FLAG(PFD_SWAP_COPY);
         DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS);
         DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED);
+        DUMP_PFD_FLAG(PFD_SUPPORT_DIRECTDRAW);
+        DUMP_PFD_FLAG(PFD_DIRECT3D_ACCELERATED);
+        DUMP_PFD_FLAG(PFD_SUPPORT_COMPOSITION);
         DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE);
         DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE);
         DUMP_PFD_FLAG(PFD_STEREO_DONTCARE);
@@ -328,7 +342,7 @@ fbConfigsDump(unsigned int n, __GLXconfig *c)
     {
       unsigned int i = ((GLXWinConfig *)c)->pixelFormatIndex;
 
-      ErrorF("%3d  %2x  %2x "
+      ErrorF("%3d %3x %3x "
              "%-11s"
              " %3d %3d   %s   %s  %s %s  %s  "
              "%2d %2d %2d %2d  "
commit d4096abb591353405417e53816e5c46e904e7b25
Merge: 61f87a7... 87d4f90...
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Jul 1 15:45:45 2011 -0700

    Merge remote-tracking branch 'whot/for-keith'

commit 87d4f90bfcb509471ac9e7886e14a92b33223fd7
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jun 27 09:10:42 2011 +1000

    input: free the EQ allocated memory on shutdown (#38634)
    
    mieqFini() already does the right thing, but it needs to be called by the
    various DDXs and the XTest Extension.
    
    X.Org Bug 38634 <http://bugs.freedesktop.org/show_bug.cgi?id=38634>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Acked-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/xtest.c b/Xext/xtest.c
index daa6430..cc675c1 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -679,12 +679,19 @@ GetXTestDevice(DeviceIntPtr master)
     return NULL;
 }
 
+static void
+XTestExtensionTearDown(ExtensionEntry *e)
+{
+    FreeEventList(xtest_evlist, GetMaximumEventsNum());
+    xtest_evlist = NULL;
+}
+
 void
 XTestExtensionInit(INITARGS)
 {
     AddExtension(XTestExtensionName, 0, 0,
             ProcXTestDispatch, SProcXTestDispatch,
-            NULL, StandardMinorOpcode);
+            XTestExtensionTearDown, StandardMinorOpcode);
 
     xtest_evlist = InitEventList(GetMaximumEventsNum());
 }
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index 568bb88..f006af4 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -77,6 +77,7 @@ void InitInput(int argc, char **argv)
 
 void CloseInput(void)
 {
+    mieqFini();
 }
 
 /** Called from dix/dispatch.c in Dispatch() whenever input events
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 7d4cadb..b674bb8 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -97,6 +97,7 @@ InitInput (int argc, char **argv)
 void
 CloseInput (void)
 {
+  KdCloseInput();
 }
 
 #ifdef DDXBEFORERESET
diff --git a/hw/kdrive/fake/fakeinit.c b/hw/kdrive/fake/fakeinit.c
index ba61959..e25093f 100644
--- a/hw/kdrive/fake/fakeinit.c
+++ b/hw/kdrive/fake/fakeinit.c
@@ -61,6 +61,7 @@ InitInput (int argc, char **argv)
 void
 CloseInput (void)
 {
+    KdCloseInput ();
 }
 
 #ifdef DDXBEFORERESET
diff --git a/hw/kdrive/fbdev/fbinit.c b/hw/kdrive/fbdev/fbinit.c
index 3b55ab1..1d66fce 100644
--- a/hw/kdrive/fbdev/fbinit.c
+++ b/hw/kdrive/fbdev/fbinit.c
@@ -47,6 +47,7 @@ InitInput (int argc, char **argv)
 void
 CloseInput (void)
 {
+    KdCloseInput ();
 }
 
 void
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 847d89b..9ac5a19 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -500,6 +500,8 @@ KdScreenInfoDispose (KdScreenInfo *si);
 /* kinput.c */
 void
 KdInitInput(void);
+void
+KdCloseInput(void);
 
 void
 KdAddPointerDriver(KdPointerDriver *);
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 7fa4a8f..c14dd82 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1305,6 +1305,12 @@ KdInitInput (void)
     mieqInit();
 }
 
+void
+KdCloseInput (void)
+{
+    mieqFini();
+}
+
 /*
  * Middle button emulation state machine
  *
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 60b59c1..8836bbd 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -148,4 +148,5 @@ InitInput(int argc, char *argv[])
 void
 CloseInput (void)
 {
+    mieqFini();
 }
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 53f763a..15fdbc3 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -825,6 +825,7 @@ void
 CloseInput (void)
 {
     config_fini();
+    mieqFini();
 }
 
 /*
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index ee74101..ea0669a 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -108,6 +108,7 @@ InitInput(int argc, char *argv[])
 void
 CloseInput(void)
 {
+  mieqFini();
 }
 
 /*
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 29ab836..73685b0 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -505,6 +505,10 @@ void InitInput( int argc, char **argv )
     QuartzInitInput(argc, argv);
 }
 
+void CloseInput(void)
+{
+    DarwinEQFini();
+}
 
 /*
  * DarwinAdjustScreenOrigins
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index fe744b7..1f22099 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -371,6 +371,10 @@ Bool DarwinEQInit(void) {
     return TRUE;
 }
 
+Bool DarwinEQFini(void) {
+    mieqFini();
+}
+
 /*
  * ProcessInputEvents
  *  Read and process events from the event queue until it is empty.
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index 6769c8b..bd29d51 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -32,6 +32,7 @@
 #define XQUARTZ_VALUATOR_LIMIT (1 << 16)
 
 Bool DarwinEQInit(void);
+Bool DarwinEQFini(void);
 void DarwinEQEnqueue(const xEventPtr e);
 void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
 void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c
index 3ef34fe..94c31bb 100644
--- a/hw/xquartz/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -149,8 +149,3 @@ DeleteInputDeviceRequest(DeviceIntPtr dev)
   DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev);
 }
 
-void
-CloseInput (void)
-{
-}
-
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index 70578b1..bc48a93 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -156,4 +156,5 @@ InitInput (int argc, char *argv[])
 void
 CloseInput (void)
 {
+  mieqFini ();
 }
commit e084ac30b37c36016bb0dbb1b79e60a7799aee02
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Mar 2 14:52:42 2011 +0000

    Input: Reset SD remainder when copying co-ords from MD
    
    In updateSlaveDeviceCoords, pDev->last.valuators was being copied from
    the master, but pDev->last.remainder wasn't.  Make sure we copy both, to
    avoid minor inconsistencies.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    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 fbc15e0..a12462a 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -320,6 +320,8 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
      * position of the pointer */
     pDev->last.valuators[0] = master->last.valuators[0];
     pDev->last.valuators[1] = master->last.valuators[1];
+    pDev->last.remainder[0] = master->last.remainder[0];
+    pDev->last.remainder[1] = master->last.remainder[1];
 
     if (!pDev->valuator)
         return;
@@ -339,14 +341,19 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
     if ((lastSlave = master->last.slave) && lastSlave->valuator) {
         for (i = 2; i < pDev->valuator->numAxes; i++) {
             if (i >= lastSlave->valuator->numAxes)
+            {
                 pDev->last.valuators[i] = 0;
+                pDev->last.remainder[i] = 0;
+            }
             else
+            {
                 pDev->last.valuators[i] =
                     rescaleValuatorAxis(pDev->last.valuators[i],
                             pDev->last.remainder[i],
                             &pDev->last.remainder[i],
                             lastSlave->valuator->axes + i,
                             pDev->valuator->axes + i, 0);
+            }
         }
     }
 
commit 23a783278963919778d017965542e0f983814e37
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jun 24 11:02:23 2011 +1000

    input: add POINTER_NORAW to avoid generation of raw events (#30068)
    
    RawEvents are supposed to be events coming from the driver. When warping the
    pointer, this should not generate a raw event.
    
    X.Org Bug 30068 <http://bugs.freedesktop.org/show_bug.cgi?id=30068>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index c935c97..fbc15e0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1164,14 +1164,17 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
 
     events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
 
-    raw = &events->raw_event;
-    events++;
-    num_events++;
-
     valuator_mask_copy(&mask, mask_in);
 
-    init_raw(pDev, raw, ms, type, buttons);
-    set_raw_valuators(raw, &mask, raw->valuators.data_raw);
+    if ((flags & POINTER_NORAW) == 0)
+    {
+	raw = &events->raw_event;
+	events++;
+	num_events++;
+
+	init_raw(pDev, raw, ms, type, buttons);
+	set_raw_valuators(raw, &mask, raw->valuators.data_raw);
+    }
 
     if (flags & POINTER_ABSOLUTE)
     {
@@ -1210,7 +1213,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
         moveRelative(pDev, &x, &y, &mask);
     }
 
-    set_raw_valuators(raw, &mask, raw->valuators.data);
+    if ((flags & POINTER_NORAW) == 0)
+	set_raw_valuators(raw, &mask, raw->valuators.data);
 
     positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
                    &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
diff --git a/include/input.h b/include/input.h
index 56847ed..5377a0c 100644
--- a/include/input.h
+++ b/include/input.h
@@ -62,10 +62,11 @@ SOFTWARE.
 #define DEVICE_OFF	2
 #define DEVICE_CLOSE	3
 
-#define POINTER_RELATIVE (1 << 1)
-#define POINTER_ABSOLUTE (1 << 2)
-#define POINTER_ACCELERATE (1 << 3)
-#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
+#define POINTER_RELATIVE	(1 << 1)
+#define POINTER_ABSOLUTE	(1 << 2)
+#define POINTER_ACCELERATE	(1 << 3)
+#define POINTER_SCREEN		(1 << 4)	/* Data in screen coordinates */
+#define POINTER_NORAW		(1 << 5)	/* Don't generate RawEvents */
 
 /*int constants for pointer acceleration schemes*/
 #define PtrAccelNoOp            0
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 322be9e..7680ca1 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -683,7 +683,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 
     valuator_mask_set_range(&mask, 0, 2, valuators);
     nevents = GetPointerEvents(events, pDev, MotionNotify, 0,
-                               POINTER_SCREEN | POINTER_ABSOLUTE, &mask);
+                               POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask);
 
     OsBlockSignals();
 #ifdef XQUARTZ
commit 9444e40d77508d545e3c0a8123f61950c22d89fa
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Mar 1 11:11:22 2011 +0000

    Test: Input: Only ever set up to MAX_VALUATORS valuators
    
    Previously, the input tests were working up to sizeof(mask) * 8, which
    could be more than the arrays; the latter only being sized as
    MAX_VALUATORS.
    
    Hypothetically, if you were switching the stored valuator values to
    double instead of uint32_t, and you attempted to set the 39th member of
    a MAX_VALUATORS-sized (36) array, you'd probably end up smashing
    ev->key_repeat into oblivion and then tripping the check for invalid
    flags because you haven't yet put XIPointerEmulated into the valid flags
    for XI_Motion.  Probably.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index edba974..6e61d74 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -70,6 +70,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
 
     for (i = 0; out->valuators_len && i < sizeof(in->valuators.mask) * 8; i++)
     {
+        if (i >= MAX_VALUATORS)
+            assert (!XIMaskIsSet(in->valuators.mask, i));
         assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i));
         if (XIMaskIsSet(in->valuators.mask, i))
             bits_set++;
@@ -238,7 +240,7 @@ static void test_convert_XIRawEvent(void)
     test_XIRawEvent(&in);
 
     printf("Testing valuator masks\n");
-    for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
     {
         XISetMask(in.valuators.mask, i);
         test_XIRawEvent(&in);
@@ -257,7 +259,7 @@ static void test_convert_XIRawEvent(void)
         XIClearMask(in.valuators.mask, i);
     }
 
-    for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
     {
         XISetMask(in.valuators.mask, i);
         test_XIRawEvent(&in);
@@ -354,7 +356,7 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
 
 
     valuators = 0;
-    for (i = 0; i < sizeof(in->valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
         if (XIMaskIsSet(in->valuators.mask, i))
             valuators++;
 
@@ -365,7 +367,9 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
     for (i = 0; i < sizeof(in->valuators.mask) * 8 ||
                 i < (out->valuators_len * 4) * 8; i++)
     {
-        if (i > sizeof(in->valuators.mask) * 8)
+        if (i >= MAX_VALUATORS)
+            assert(!XIMaskIsSet(in->valuators.mask, i) && !XIMaskIsSet(ptr, i));
+        else if (i > sizeof(in->valuators.mask) * 8)
             assert(!XIMaskIsSet(ptr, i));
         else if (i > out->valuators_len * 4 * 8)
             assert(!XIMaskIsSet(in->valuators.mask, i));
@@ -610,14 +614,14 @@ static void test_convert_XIDeviceEvent(void)
     }
 
     printf("Testing valuator masks\n");
-    for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
     {
         XISetMask(in.valuators.mask, i);
         test_XIDeviceEvent(&in);
         XIClearMask(in.valuators.mask, i);
     }
 
-    for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
     {
         XISetMask(in.valuators.mask, i);
 
@@ -627,7 +631,7 @@ static void test_convert_XIDeviceEvent(void)
         XIClearMask(in.valuators.mask, i);
     }
 
-    for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+    for (i = 0; i < MAX_VALUATORS; i++)
     {
         XISetMask(in.valuators.mask, i);
         test_XIDeviceEvent(&in);
commit 1e65a01cf73f1fbdfe0d63eaecea412cf8472cb4
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Jun 17 16:28:05 2011 +0100

    Test: Ensure libxservertest gets relinked when necessary
    
    Similar to how we link Xorg, make sure that whenever any of the
    component libraries changes, we relink libxservertest and the tests.
    Not much use testing anything other than the actual source in your tree.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/Makefile.am b/test/Makefile.am
index 370e09a..7ef408c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -40,5 +40,6 @@ libxservertest_la_LIBADD = \
             $(top_builddir)/mi/libmi.la \
             $(top_builddir)/os/libos.la \
             @XORG_LIBS@
+libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD)
 endif
 endif
commit 0f41d6c851df76d0423d9c37ad809d3440906944
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Jun 17 13:20:19 2011 +0100

    KDrive: Remove useless miPointerUpdateSprite call
    
    miPointerUpdateSprite is already called from mieqProcessInputEvents, so
    calling it by hand immediately after isn't massively helpful.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index c863950..7fa4a8f 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2159,7 +2159,6 @@ void
 ProcessInputEvents (void)
 {
     mieqProcessInputEvents();
-    miPointerUpdateSprite(inputInfo.pointer);
     if (kdSwitchPending)
 	KdProcessSwitch ();
     KdCheckLock ();
commit 57b767d2927e5c2e561a431be4e604df65423422
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Jun 17 13:19:46 2011 +0100

    DMX: Remove useless miPointerUpdateSprite call
    
    miPointerUpdateSprite is already called from mieqProcessInputEvents, so
    calling it by hand immediately after isn't massively helpful.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 5cbd620..1b067c7 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -546,9 +546,6 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
         return;
     for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
         if (dmxInput->devs[i]->process_input) {
-#if 11 /*BP*/
-            miPointerUpdateSprite(dmxInput->devs[i]->pDevice);
-#endif
             dmxInput->devs[i]->process_input(dmxInput->devs[i]->private);
         }
 
commit cf398755c0ca1e031514862b670956e7b9ace5ef
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Jun 17 15:29:44 2011 +0100

    XWin: Remove executable bit from headers
    
    Headers don't really need to be mode 0755.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xwin/xlaunch/resources/resources.h b/hw/xwin/xlaunch/resources/resources.h
old mode 100755
new mode 100644
diff --git a/hw/xwin/xlaunch/window/dialog.h b/hw/xwin/xlaunch/window/dialog.h
old mode 100755
new mode 100644
diff --git a/hw/xwin/xlaunch/window/window.h b/hw/xwin/xlaunch/window/window.h
old mode 100755
new mode 100644
diff --git a/hw/xwin/xlaunch/window/wizard.h b/hw/xwin/xlaunch/window/wizard.h
old mode 100755
new mode 100644
commit 7d2543a3cb3089241982ce4f8984fd723d5312a1
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Dec 29 12:03:01 2010 +0000

    XKB: Add debug key actions for grabs & window tree
    
    Add four new private XKB actions for debugging:
        * PrGrbs: print active grabs to the log file
        * Ungrab: ungrab all currently active grabs
        * ClsGrb: kill clients with active grabs
        * PrWins: dump the current window tree to the log file
    
    To use these, you need to modify your XKB maps, e.g. the following to
    have Ctrl+Alt+(F9-F12) mapped to the above:
     - compat/xfree86:
        interpret XF86LogGrabInfo {
            action = Private(type=0x86, data="PrGrbs");
        };
        interpret XF86Ungrab {
            action = Private(type=0x86, data="Ungrab");
        }
        interpret XF86ClearGrab {
            action = Private(type=0x86, data="ClsGrb");
        }
        interpret XF86LogWindowTree {
            action = Private(type=0x86, data="PrWins");
        }
    
     - symbols/pc:
        key <FK09> {        type="CTRL+ALT", [ Return, XF86LogGrabInfo      ]   };
        key <FK10> {        type="CTRL+ALT", [ Return, XF86Ungrab           ]   };
        key <FK11> {        type="CTRL+ALT", [ Return, XF86ClearGrab        ]   };
        key <FK12> {        type="CTRL+ALT", [ Return, XF86LogWindowTree    ]   };
    
    At the moment, this only works if the grabbing client continues to call
    AllowEvents, as the server does no event processing at all when a device
    is frozen.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    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/grabs.c b/dix/grabs.c
index 69c58df..85ca9ee 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -68,6 +68,118 @@ SOFTWARE.
 #define BITCLEAR(buf, i) MASKWORD(buf, i) &= ~BITMASK(i)
 #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i))
 
+void
+PrintDeviceGrabInfo(DeviceIntPtr dev)
+{
+    ClientPtr client;
+    LocalClientCredRec *lcc;
+    int i, j;
+    GrabInfoPtr devGrab = &dev->deviceGrab;
+    GrabPtr grab = devGrab->grab;
+
+    ErrorF("Active grab 0x%lx (%s) on device '%s' (%d):",
+           (unsigned long) grab->resource,
+           (grab->grabtype == GRABTYPE_XI2) ? "xi2" :
+            ((grab->grabtype == GRABTYPE_CORE) ? "core" : "xi1"),
+           dev->name, dev->id);
+
+    client = clients[CLIENT_ID(grab->resource)];
+    if (client && GetLocalClientCreds(client, &lcc) != -1)
+    {
+        ErrorF("      client pid %ld uid %ld gid %ld\n",
+               (lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0,
+               (lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0,
+               (lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0);
+        FreeLocalClientCreds(lcc);
+    }
+    else
+    {
+        ErrorF("      (no client information available)\n");
+    }
+
+    /* XXX is this even correct? */
+    if (devGrab->sync.other)
+        ErrorF("      grab ID 0x%lx from paired device\n",
+               (unsigned long) devGrab->sync.other->resource);
+
+    ErrorF("      at %ld (from %s grab)%s (device %s, state %d)\n",
+           (unsigned long) devGrab->grabTime.milliseconds,
+           devGrab->fromPassiveGrab ? "passive" : "active",
+           devGrab->implicitGrab ? " (implicit)" : "",
+           devGrab->sync.frozen ? "frozen" : "thawed",
+           devGrab->sync.state);
+
+    if (grab->grabtype == GRABTYPE_CORE)
+    {
+        ErrorF("        core event mask 0x%lx\n",
+               (unsigned long) grab->eventMask);
+    }
+    else if (grab->grabtype == GRABTYPE_XI)
+    {
+        ErrorF("      xi1 event mask 0x%lx\n",
+               devGrab->implicitGrab ? (unsigned long) grab->deviceMask :
+                                       (unsigned long) grab->eventMask);
+    }
+    else if (grab->grabtype == GRABTYPE_XI2)
+    {
+        for (i = 0; i < EMASKSIZE; i++)
+        {
+            int print;
+            print = 0;
+            for (j = 0; j < XI2MASKSIZE; j++)
+            {
+                if (grab->xi2mask[i][j])
+                {
+                    print = 1;
+                    break;
+                }
+            }
+            if (!print)
+                continue;
+            ErrorF("      xi2 event mask for device %d: 0x", dev->id);
+            for (j = 0; j < XI2MASKSIZE; j++)
+                ErrorF("%x", grab->xi2mask[i][j]);
+            ErrorF("\n");
+        }
+    }
+
+    if (devGrab->fromPassiveGrab)
+    {
+        ErrorF("      passive grab type %d, detail 0x%x, "
+               "activating key %d\n", grab->type, grab->detail.exact,
+               devGrab->activatingKey);
+    }
+
+    ErrorF("      owner-events %s, kb %d ptr %d, confine %lx, cursor 0x%lx\n",
+           grab->ownerEvents ? "true" : "false",
+           grab->keyboardMode, grab->pointerMode,
+           grab->confineTo ? (unsigned long) grab->confineTo->drawable.id : 0,
+           grab->cursor ? (unsigned long) grab->cursor->id : 0);
+}
+
+void
+UngrabAllDevices(Bool kill_client)
+{
+    DeviceIntPtr dev;
+    ClientPtr client;
+
+    ErrorF("Ungrabbing all devices%s; grabs listed below:\n",
+           kill_client ? " and killing their owners" : "");
+
+    for (dev = inputInfo.devices; dev; dev = dev->next)
+    {
+        if (!dev->deviceGrab.grab)
+            continue;
+        PrintDeviceGrabInfo(dev);
+        client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)];
+        if (!client || client->clientGone)
+            dev->deviceGrab.DeactivateGrab(dev);
+        CloseDownClient(client);
+    }
+
+    ErrorF("End list of ungrabbed devices\n");
+}
+
 GrabPtr
 CreateGrab(
     int client,
diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/dixmods/xkbPrivate.c
index 9742eaf..06d1c2b 100644
--- a/hw/xfree86/dixmods/xkbPrivate.c
+++ b/hw/xfree86/dixmods/xkbPrivate.c
@@ -13,6 +13,7 @@
 #define XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>
 
+#include "dixgrabs.h"
 #include "os.h"
 #include "xf86.h"
 
@@ -29,6 +30,20 @@ XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
             xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
         else if (strcasecmp(msgbuf, "+vmode")==0)
             xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
+        else if (strcasecmp(msgbuf, "prgrbs")==0) {
+            DeviceIntPtr tmp;
+            xf86Msg(X_INFO, "Printing all currently active device grabs:\n");
+            for (tmp = inputInfo.devices; tmp; tmp = tmp->next)
+                if (tmp->deviceGrab.grab)
+                    PrintDeviceGrabInfo(tmp);
+            xf86Msg(X_INFO, "End list of active device grabs\n");
+        }
+        else if (strcasecmp(msgbuf, "ungrab")==0)
+            UngrabAllDevices(FALSE);
+        else if (strcasecmp(msgbuf, "clsgrb")==0)
+            UngrabAllDevices(TRUE);
+        else if (strcasecmp(msgbuf, "prwins")==0)
+            PrintWindowTree();
     }
 
     return 0;
diff --git a/include/dixgrabs.h b/include/dixgrabs.h
index 3b2a46d..229c8bb 100644
--- a/include/dixgrabs.h
+++ b/include/dixgrabs.h
@@ -28,6 +28,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 struct _GrabParameters;
 
+extern void PrintDeviceGrabInfo(DeviceIntPtr dev);
+extern void UngrabAllDevices(Bool kill_client);
+
 extern GrabPtr CreateGrab(
 	int /* client */,
 	DeviceIntPtr /* device */,
commit ddf735fd4e9658bb5610f5e911f3b4055d5acf89
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Oct 13 19:56:57 2009 +1100

    DIX: Make PrintWindowTree actually useful
    
    Rewrite PrintWindowTree to make it actually tell you what you want to
    know.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    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/window.c b/dix/window.c
index 5defe58..556509a 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -108,6 +108,7 @@ Equipment Corporation.
 #include "regionstr.h"
 #include "validate.h"
 #include "windowstr.h"
+#include "propertyst.h"
 #include "input.h"
 #include "inputstr.h"
 #include "resource.h"
@@ -124,10 +125,13 @@ Equipment Corporation.
 #include "dixevents.h"
 #include "globals.h"
 #include "mi.h" /* miPaintWindow */
+#include "compint.h"
 
 #include "privates.h"
 #include "xace.h"
 
+#include <X11/Xatom.h> /* must come after server includes */
+
 /******
  * Window stuff for server 
  *
@@ -176,46 +180,129 @@ static Bool TileScreenSaver(ScreenPtr pScreen, int kind);
 
 #define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
 
-#ifdef DEBUG
-/******
- * PrintWindowTree
- *    For debugging only
- ******/
+static const char *overlay_win_name = "<composite overlay>";
 
-static void
-PrintChildren(WindowPtr p1, int indent)
+static const char *
+get_window_name(WindowPtr pWin)
 {
-    WindowPtr p2;
-    int i;
+#define WINDOW_NAME_BUF_LEN 512
+    PropertyPtr prop;
+    CompScreenPtr comp_screen = GetCompScreen(pWin->drawable.pScreen);
+    static char buf[WINDOW_NAME_BUF_LEN];
+    int len;
+
+    if (comp_screen && pWin == comp_screen->pOverlayWin)
+        return overlay_win_name;
 
-    while (p1)
+    for (prop = wUserProps(pWin); prop; prop = prop->next)
     {
-	p2 = p1->firstChild;
-        ErrorF("[dix] ");
-	for (i=0; i<indent; i++) ErrorF(" ");
-	ErrorF("%lx\n", p1->drawable.id);
-	RegionPrint(&p1->clipList);
-	PrintChildren(p2, indent+4);
-	p1 = p1->nextSib;
+        if (prop->propertyName == XA_WM_NAME && prop->type == XA_STRING &&
+            prop->data)
+        {
+            len = min(prop->size, WINDOW_NAME_BUF_LEN - 1);
+            memcpy(buf, prop->data, len);
+            buf[len] = '\0';
+            return buf;
+        }
     }
+
+    return NULL;
+#undef WINDOW_NAME_BUF_LEN
 }
 
-static void
-PrintWindowTree(void)
+static void log_window_info(WindowPtr pWin, int depth)
 {
     int i;
-    WindowPtr pWin, p1;
+    const char *win_name, *visibility;
+    BoxPtr rects;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+
+    for (i = 0; i < (depth << 2); i++)
+        ErrorF(" ");
+
+    win_name = get_window_name(pWin);
+    ErrorF("win 0x%.8x (%s), [%d, %d] to [%d, %d]",
+           pWin->drawable.id,
+           win_name ? win_name : "no name",
+           pWin->drawable.x, pWin->drawable.y,
+           pWin->drawable.x + pWin->drawable.width,
+           pWin->drawable.y + pWin->drawable.height);
+
+    if (pWin->overrideRedirect)
+        ErrorF(" (override redirect)");
+    if (pWin->redirectDraw)
+        ErrorF(" (%s compositing: pixmap %x)",
+               (pWin->redirectDraw == RedirectDrawAutomatic) ?
+                "automatic" : "manual",
+               pScreen->GetWindowPixmap(pWin)->drawable.id);
+
+    switch (pWin->visibility)
+    {
+    case VisibilityUnobscured:
+         visibility = "unobscured";
+         break;
+    case VisibilityPartiallyObscured:
+         visibility = "partially obscured";
+         break;
+    case VisibilityFullyObscured:
+         visibility = "fully obscured";
+         break;
+    case VisibilityNotViewable:
+         visibility = "unviewable";
+         break;
+    }
+    ErrorF(", %s", visibility);
+
+    if (REGION_NOTEMPTY(pScreen, &pWin->clipList))
+    {
+        ErrorF(", clip list:");
+        rects = REGION_RECTS(&pWin->clipList);
+        for (i = 0; i < REGION_NUM_RECTS(&pWin->clipList); i++)
+            ErrorF(" [(%d, %d) to (%d, %d)]",
+                   rects[i].x1, rects[i].y1,
+                   rects[i].x2, rects[i].y2);
+        ErrorF("; extents [(%d, %d) to (%d, %d)]",
+               pWin->clipList.extents.x1, pWin->clipList.extents.y1,
+               pWin->clipList.extents.x2, pWin->clipList.extents.y2);
+    }
+
+    ErrorF("\n");
+}
+
+void
+PrintWindowTree(void)
+{
+    int scrnum, depth;
+    ScreenPtr pScreen;
+    WindowPtr pWin;
 
-    for (i=0; i<screenInfo.numScreens; i++)
+    for (scrnum = 0; scrnum < screenInfo.numScreens; scrnum++)
     {
-	ErrorF("[dix] WINDOW %d\n", i);
-	pWin = screenInfo.screens[i]->root;
-	RegionPrint(&pWin->clipList);
-	p1 = pWin->firstChild;
-	PrintChildren(p1, 4);
+        pScreen = screenInfo.screens[scrnum];
+        ErrorF("[dix] Dumping windows for screen %d (pixmap %x):\n", scrnum,
+               pScreen->GetScreenPixmap(pScreen)->drawable.id);
+        pWin = pScreen->root;
+        depth = 1;
+        while (pWin)
+        {
+            log_window_info(pWin, depth);
+            if (pWin->firstChild)
+            {
+                pWin = pWin->firstChild;
+                depth++;
+                continue;
+            }
+            while (pWin && !pWin->nextSib)
+            {
+                pWin = pWin->parent;
+                depth--;
+            }
+            if (!pWin)
+                break;
+            pWin = pWin->nextSib;
+	}
     }
 }
-#endif
 
 int
 TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data)
diff --git a/include/window.h b/include/window.h
index 1e4e9bf..e13598b 100644
--- a/include/window.h
+++ b/include/window.h
@@ -267,4 +267,6 @@ extern _X_EXPORT void EnableMapUnmapEvents(
     WindowPtr /* pWin */ );
 
 extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable);
+extern _X_EXPORT void PrintWindowTree(void);
+
 #endif /* WINDOW_H */
commit b27d61e4433a2a0140ed8a6128e4427451e37fec
Author: Matěj Cepl <mcepl at redhat.com>
Date:   Fri Jun 17 15:26:17 2011 +0100

    Fix UTF-8 encoding
    
    Report to find out all non-UTF-8 files created by
    
    cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do
        if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then
            /bin/true
        else
            echo $FILE
        fi
    done >>report
    
    Signed-off-by: Matěj Cepl <mcepl at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    
    [Daniel: git am failed for me, so I redid it.  The method listed in the
             commit message also failed, so I just used file/grep/iconv.  The
             results are the same though.]
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/exa/exa.c b/exa/exa.c
index a4e294a..4ce983b 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -1,7 +1,7 @@
 /*
- * Copyright © 2001 Keith Packard
+ * Copyright © 2001 Keith Packard
  *
- * Partly based on code that is Copyright © The XFree86 Project Inc.
+ * Partly based on code that is Copyright © The XFree86 Project Inc.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index b4c0f83..5600539 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1,7 +1,7 @@
 /*
- * Copyright © 2001 Keith Packard
+ * Copyright © 2001 Keith Packard
  *
- * Partly based on code that is Copyright © The XFree86 Project Inc.
+ * Partly based on code that is Copyright © The XFree86 Project Inc.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -23,7 +23,7 @@
  *
  * Authors:
  *    Eric Anholt <eric at anholt.net>
- *    Michel Dänzer <michel at tungstengraphics.com>
+ *    Michel Dänzer <michel at tungstengraphics.com>
  *
  */
 
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 169ce3a..919b29d 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2009 Maarten Maathuis
+ * Copyright © 2009 Maarten Maathuis
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index b9903d1..795cb00 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2009 Maarten Maathuis
+ * Copyright © 2009 Maarten Maathuis
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c
index 6c49fb7..dd3cd49 100644
--- a/exa/exa_migration_classic.c
+++ b/exa/exa_migration_classic.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Intel Corporation
+ * Copyright © 2006 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -22,7 +22,7 @@
  *
  * Authors:
  *    Eric Anholt <eric at anholt.net>
- *    Michel Dänzer <michel at tungstengraphics.com>
+ *    Michel Dänzer <michel at tungstengraphics.com>
  *
  */
 
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index fb47151..4b22619 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2009 Maarten Maathuis
+ * Copyright © 2009 Maarten Maathuis
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index fd1afb2..58645ae 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2009 Maarten Maathuis
+ * Copyright © 2009 Maarten Maathuis
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index df416d5..219f903 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -1,6 +1,6 @@
 /*
  *
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index ac8e5be..7ebf1c2 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at openedhand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h
index 41a82bf..2384800 100644
--- a/hw/kdrive/ephyr/ephyr.h
+++ b/hw/kdrive/ephyr/ephyr.h
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at o-hand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index b1982a5..cf5f553 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Intel Corporation
+ * Copyright © 2006 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 2deb7b8..7d4cadb 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at o-hand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 2ebeca9..4caf451 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at o-hand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index e65e0c9..4257857 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at o-hand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/ephyr/os.c b/hw/kdrive/ephyr/os.c
index 4bf6e88..e4dc678 100644
--- a/hw/kdrive/ephyr/os.c
+++ b/hw/kdrive/ephyr/os.c
@@ -2,7 +2,7 @@
  * Xephyr - A kdrive X server thats runs in a host X window.
  *          Authored by Matthew Allum <mallum at o-hand.com>
  * 
- * Copyright © 2004 Nokia 
+ * Copyright © 2004 Nokia 
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/fake/kbd.c b/hw/kdrive/fake/kbd.c
index 51fba04..769730d 100644
--- a/hw/kdrive/fake/kbd.c
+++ b/hw/kdrive/fake/kbd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index 2c7fa91..661e5b4 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/fbdev/fbdev.h b/hw/kdrive/fbdev/fbdev.h
index ebac6ad..ec53784 100644
--- a/hw/kdrive/fbdev/fbdev.h
+++ b/hw/kdrive/fbdev/fbdev.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/fbdev/fbinit.c b/hw/kdrive/fbdev/fbinit.c
index 51e7e00..3b55ab1 100644
--- a/hw/kdrive/fbdev/fbinit.c
+++ b/hw/kdrive/fbdev/fbinit.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index e05c5ab..f5f9d9b 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -1,10 +1,10 @@
 /*
- * Copyright © 1999 Keith Packard
- * XKB integration © 2006 Nokia Corporation, author: Tomas Frydrych <tf at o-hand.com>
+ * Copyright © 1999 Keith Packard
+ * XKB integration © 2006 Nokia Corporation, author: Tomas Frydrych <tf at o-hand.com>
  *
  * LinuxKeyboardRead() XKB code based on xf86KbdLnx.c:
- * Copyright © 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- * Copyright © 1994-2001 by The XFree86 Project, Inc.
+ * Copyright © 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ * Copyright © 1994-2001 by The XFree86 Project, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index 9863c14..a53db49 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c
index 1db5348..93c2078 100644
--- a/hw/kdrive/linux/mouse.c
+++ b/hw/kdrive/linux/mouse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2001 Keith Packard
+ * Copyright © 2001 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c
index 552a3c7..465b963 100644
--- a/hw/kdrive/linux/ps2.c
+++ b/hw/kdrive/linux/ps2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c
index 570cbf9..1f30cca 100644
--- a/hw/kdrive/linux/tslib.c
+++ b/hw/kdrive/linux/tslib.c
@@ -4,11 +4,11 @@
  * Derived from ts.c by Keith Packard
  * Derived from ps2.c by Jim Gettys
  *
- * Copyright © 1999 Keith Packard
- * Copyright © 2000 Compaq Computer Corporation
- * Copyright © 2002 MontaVista Software Inc.
- * Copyright © 2005 OpenedHand Ltd.
- * Copyright © 2006 Nokia Corporation
+ * Copyright © 1999 Keith Packard
+ * Copyright © 2000 Compaq Computer Corporation
+ * Copyright © 2002 MontaVista Software Inc.
+ * Copyright © 2005 OpenedHand Ltd.
+ * Copyright © 2006 Nokia Corporation
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c
index 9bfdd78..6e0fc14 100644
--- a/hw/kdrive/src/kcmap.c
+++ b/hw/kdrive/src/kcmap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 2ab535a..847d89b 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c
index 8193215..7055fbf 100644
--- a/hw/kdrive/src/kinfo.c
+++ b/hw/kdrive/src/kinfo.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index cdf55d7..c863950 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1,6 +1,6 @@
 /*
- * Copyright © 1999 Keith Packard
- * Copyright © 2006 Nokia Corporation
+ * Copyright © 1999 Keith Packard
+ * Copyright © 2006 Nokia Corporation
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/kdrive/src/kshadow.c b/hw/kdrive/src/kshadow.c
index 6f5a2f3..63bb87b 100644
--- a/hw/kdrive/src/kshadow.c
+++ b/hw/kdrive/src/kshadow.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 1999 Keith Packard
+ * Copyright © 1999 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 83f72b5..1556051 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Intel Corporation
+ * Copyright © 2006 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/hw/xfree86/modes/xf86Modes.h b/hw/xfree86/modes/xf86Modes.h
index 38927b1..c72a935 100644
--- a/hw/xfree86/modes/xf86Modes.h
+++ b/hw/xfree86/modes/xf86Modes.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Intel Corporation
+ * Copyright © 2006 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
diff --git a/hw/xfree86/modes/xf86cvt.c b/hw/xfree86/modes/xf86cvt.c
index 244f3b9..d5feccc 100644
--- a/hw/xfree86/modes/xf86cvt.c
+++ b/hw/xfree86/modes/xf86cvt.c
@@ -152,7 +152,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
 
     if (!Reduced) { /* simplified GTF calculation */
 
-        /* 4) Minimum time of vertical sync + back porch interval (µs) 
+        /* 4) Minimum time of vertical sync + back porch interval (µs) 
          * default 550.0 */
 #define CVT_MIN_VSYNC_BP 550.0
 
@@ -223,7 +223,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
         Mode->VSyncEnd = Mode->VSyncStart + VSync;
 
     } else { /* Reduced blanking */
-        /* Minimum vertical blanking interval time (µs) - default 460 */
+        /* Minimum vertical blanking interval time (µs) - default 460 */
 #define CVT_RB_MIN_VBLANK 460.0
 
         /* Fixed number of clocks for horizontal sync */
diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c
index a4517d6..0331ac1 100644
--- a/hw/xfree86/os-support/solaris/sun_agp.c
+++ b/hw/xfree86/os-support/solaris/sun_agp.c
@@ -3,8 +3,8 @@
  *
  * This version is for Solaris.
  *
- * Copyright © 2000 VA Linux Systems, Inc.
- * Copyright © 2001 The XFree86 Project, Inc.
+ * Copyright © 2000 VA Linux Systems, Inc.
+ * Copyright © 2001 The XFree86 Project, Inc.
  */
 /* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
  *
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index cb1b299..95f11cd 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2000 Keith Packard
+ * Copyright © 2000 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
commit 2ee85d954c8f3a6affbd9b1b745594ff12e8b670
Author: Scott James Remnant <scott at netsplit.com>
Date:   Tue Jun 14 16:36:07 2011 -0700

    dix: avoid calling deleted block and wakeup handlers
    
    BlockHandler and WakeupHandlers may be removed within a different
    BlockHandler or WakeupHandler, especially since config/udev uses
    these and removes devices.
    
    Calling the deleted handlers and passing potentially freed data
    can result in the X server segfaulting after device removal, or
    events that result in device removal such as undocking or suspend/
    resume.
    
    Signed-off-by: Scott James Remnant <scott at netsplit.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 104363b..1e31346 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -386,8 +386,9 @@ BlockHandler(pointer pTimeout, pointer pReadmask)
 				screenInfo.screens[i]->blockData,
 				pTimeout, pReadmask);
     for (i = 0; i < numHandlers; i++)
-	(*handlers[i].BlockHandler) (handlers[i].blockData,
-				     pTimeout, pReadmask);
+	if (!handlers[i].deleted)
+		(*handlers[i].BlockHandler) (handlers[i].blockData,
+					     pTimeout, pReadmask);
     if (handlerDeleted)
     {
 	for (i = 0; i < numHandlers;)
@@ -416,8 +417,9 @@ WakeupHandler(int result, pointer pReadmask)
 
     ++inHandler;
     for (i = numHandlers - 1; i >= 0; i--)
-	(*handlers[i].WakeupHandler) (handlers[i].blockData,
-				      result, pReadmask);
+	if (!handlers[i].deleted)
+		(*handlers[i].WakeupHandler) (handlers[i].blockData,
+					      result, pReadmask);
     for (i = 0; i < screenInfo.numScreens; i++)
 	(* screenInfo.screens[i]->WakeupHandler)(i, 
 				screenInfo.screens[i]->wakeupData,
commit b573cdd40ee49fae299fe2e7cbd02159ae8ae617
Author: Marcin Slusarz <marcin.slusarz at gmail.com>
Date:   Tue Jun 7 21:22:15 2011 +0200

    dri2: restore Screen->ConfigNotify on close
    
    ConfigNotify is set by DRI2ScreenInit, but not restored to
    previous state on close. Fix it.
    (I'm preparing a patch for xf86-video-nouveau which detects GPU lockup
    after dri2 init and it needs to reinitialize dri2)
    
    Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index bf7ebb9..af3bcae 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1185,6 +1185,7 @@ void
 DRI2CloseScreen(ScreenPtr pScreen)
 {
     DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+    pScreen->ConfigNotify = ds->ConfigNotify;
 
     free(ds->driverNames);
     free(ds);
commit 61f87a75f2bcda939a1778d39be8cfa5c886e6d8
Merge: 0d2153a... 72d9143...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Jun 29 20:14:51 2011 -0700

    Merge remote-tracking branch 'jturney/master'

commit 0d2153a46cc72d5f2e6a9081a3cf153aa3eb7787
Merge: b631c39... 932513e...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Jun 29 20:08:32 2011 -0700

    Merge remote-tracking branch 'jbarnes/master'

commit b631c39a21c8d74fd00b8932df342d6921cce8f4
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Jun 23 13:37:45 2011 -0400

    Remove unused check for PERL program
    
    Unable to find any use of the PERL Automake variable.
    It was used in hw/xfree86/scanpci around 2005.
    Should it ever be needed, use XORG_WITH_PERL macro.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 91070e6..f4e670b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1735,14 +1735,6 @@ if test "x$XORG" = xyes; then
 	AC_SUBST([XORG_INCS])
 	AC_SUBST([XORG_OS])
 	AC_SUBST([XORG_OS_SUBDIR])
-
-	AC_PATH_PROG(PERL, perl, no)
-	dnl unlikely as this may be ...
-	if test "x$PERL" = xno; then
-		AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.])
-	fi
-	AC_SUBST(PERL)
-
 	AC_SUBST([XORG_CFLAGS])
 
 	dnl these only go in xorg-config.h
commit d5ca33ca2dd08e8436439da926d2dedaabc268fa
Merge: 38d55f0... 4edf49d...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Jun 29 18:54:33 2011 -0700

    Merge remote-tracking branch 'kibi/master'

commit 72d914335c9ad0e0f4a34b9f7e2901b830c499bf
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Mar 23 04:34:22 2010 -0500

    Cygwin/X: Left-justify website link in About box
    
    Left-justify website link in About box.  This is a cosmetic fix to make
    the About box display correctly when Windows is configured with a
    non-default DPI value
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
index 539bd0e..a142f30 100644
--- a/hw/xwin/XWin.rc
+++ b/hw/xwin/XWin.rc
@@ -50,7 +50,7 @@ BEGIN
   LTEXT			BUILDERSTRING, IDC_STATIC, 36, 28, 220, 8
   LTEXT			"This software is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 48, 220, 20
   CONTROL               __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button",
-                        BS_OWNERDRAW | WS_TABSTOP, 36, 68, 68, 8
+                        BS_OWNERDRAW | WS_TABSTOP, 36, 68, 220, 8
   DEFPUSHBUTTON		"&OK", IDOK, 105, 85, 50, 15
 END
 
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index c3a1497..bb4f447 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -115,7 +115,7 @@ winDrawURLWindow (LPARAM lParam)
   /* Draw it */
   SetBkMode (draw->hDC, OPAQUE);
   SelectObject (draw->hDC, font);
-  DrawText (draw->hDC, str, strlen (str),&rect,DT_CENTER | DT_VCENTER);
+  DrawText (draw->hDC, str, strlen (str),&rect,DT_LEFT | DT_VCENTER);
   /* Delete the created font, replace it with stock font */
   DeleteObject (SelectObject (draw->hDC, GetStockObject (ANSI_VAR_FONT)));
 }
commit e78628406f0428454983db1c51a8c828bf5684e5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Aug 12 15:00:01 2010 +0100

    Cygwin/X: Preserve client area size and position on Windows window style change
    
    When the style changes, adjust the window size so the client area remains the same.
    
    Otherwise the window size may change when sizing is reflected from Windows to X, and
    some windows are drawn expecting them to be exactly the requested size (e.g. the
    gmplayer control window)
    
    Use DeferWindowPos to delay the resize to preserve client area on WM_STYLECHANGING
    until after the style change has actually happened in WM_STYLECHANGED
    
    As a consquence of this, we need to be more careful to create windows with exactly
    the requested placement and client area initially, so the client area matches what
    the X client requested
    
    Also synchronize the X windows idea of the placement of a window which Windows is
    allowed to place
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Tested-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 21b818b..2d9a46e 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -493,6 +493,8 @@ winCreateWindowsWindow (WindowPtr pWin)
   winPrivScreenPtr	pScreenPriv = pWinPriv->pScreenPriv;
   WinXSizeHints         hints;
   WindowPtr		pDaddy;
+  DWORD dwStyle, dwExStyle;
+  RECT rc;
 
   winInitMultiWindowClass();
 
@@ -517,6 +519,8 @@ winCreateWindowsWindow (WindowPtr pWin)
         iY = CW_USEDEFAULT;
     }
 
+  winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
+
   if (winMultiWindowGetTransientFor (pWin, &pDaddy))
     {
       if (pDaddy)
@@ -538,16 +542,35 @@ winCreateWindowsWindow (WindowPtr pWin)
       }
     }
 
-  /* Create the window */
-  /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
+  /* Make it WS_OVERLAPPED in create call since WS_POPUP doesn't support */
   /* CW_USEDEFAULT, change back to popup after creation */
-  hWnd = CreateWindowExA (WS_EX_TOOLWINDOW,	/* Extended styles */
+  dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+  dwExStyle = WS_EX_TOOLWINDOW;
+
+  /*
+     Calculate the window coordinates containing the requested client area,
+     being careful to preseve CW_USEDEFAULT
+  */
+  rc.top = (iY != CW_USEDEFAULT) ? iY : 0;
+  rc.left = (iX != CW_USEDEFAULT) ? iX : 0;
+  rc.bottom = rc.top + iHeight;
+  rc.right = rc.left + iWidth;
+  AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+  if (iY != CW_USEDEFAULT) iY = rc.top;
+  if (iX != CW_USEDEFAULT) iX = rc.left;
+  iHeight = rc.bottom - rc.top;
+  iWidth = rc.right - rc.left;
+
+  winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
+
+  /* Create the window */
+  hWnd = CreateWindowExA (dwExStyle,		/* Extended styles */
 			  WINDOW_CLASS_X,	/* Class name */
 			  WINDOW_TITLE_X,	/* Window name */
-			  WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+			  dwStyle,		/* Styles */
 			  iX,			/* Horizontal position */
 			  iY,			/* Vertical position */
-			  iWidth,		/* Right edge */ 
+			  iWidth,		/* Right edge */
 			  iHeight,		/* Bottom edge */
 			  hFore,		/* Null or Parent window if transient*/
 			  (HMENU) NULL,		/* No menu */
@@ -569,6 +592,10 @@ winCreateWindowsWindow (WindowPtr pWin)
   SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
   SetWindowPos (hWnd, 0, 0, 0, 0, 0,
 		SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
+  /* Adjust the X window to match the window placement we actually got... */
+  winAdjustXWindow (pWin, hWnd);
+
   /* Make sure it gets the proper system menu for a WS_POPUP, too */
   GetSystemMenu (hWnd, TRUE);
 
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index b559cd8..1a3be78 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -1008,6 +1008,64 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
       winAdjustXWindow (pWin, hwnd);
       return 0; /* end of WM_SIZE handler */
 
+    case WM_STYLECHANGING:
+      /*
+        When the style changes, adjust the Windows window size so the client area remains the same size,
+        and adjust the Windows window position so that the client area remains in the same place.
+      */
+      {
+        RECT newWinRect;
+        DWORD dwExStyle;
+        DWORD dwStyle;
+        DWORD newStyle = ((STYLESTRUCT *)lParam)->styleNew;
+        WINDOWINFO wi;
+
+        dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
+        dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
+
+        winDebug("winTopLevelWindowProc - WM_STYLECHANGING from %08x %08x\n", dwStyle, dwExStyle);
+
+        if (wParam == GWL_EXSTYLE)
+          dwExStyle = newStyle;
+
+        if (wParam == GWL_STYLE)
+          dwStyle = newStyle;
+
+        winDebug("winTopLevelWindowProc - WM_STYLECHANGING to %08x %08x\n", dwStyle, dwExStyle);
+
+        /* Get client rect in screen coordinates */
+        wi.cbSize = sizeof(WINDOWINFO);
+        GetWindowInfo(hwnd, &wi);
+
+        winDebug("winTopLevelWindowProc - WM_STYLECHANGING client area {%d, %d, %d, %d}, {%d x %d}\n", wi.rcClient.left, wi.rcClient.top, wi.rcClient.right, wi.rcClient.bottom, wi.rcClient.right - wi.rcClient.left, wi.rcClient.bottom - wi.rcClient.top);
+
+        newWinRect = wi.rcClient;
+        if (!AdjustWindowRectEx(&newWinRect, dwStyle, FALSE, dwExStyle))
+          winDebug("winTopLevelWindowProc - WM_STYLECHANGING AdjustWindowRectEx failed\n");
+
+        winDebug("winTopLevelWindowProc - WM_STYLECHANGING window area should be {%d, %d, %d, %d}, {%d x %d}\n", newWinRect.left, newWinRect.top, newWinRect.right, newWinRect.bottom, newWinRect.right - newWinRect.left, newWinRect.bottom - newWinRect.top);
+
+        /*
+          Style change hasn't happened yet, so we can't adjust the window size yet, as the winAdjustXWindow()
+          which WM_SIZE does will use the current (unchanged) style.  Instead make a note to change it when
+          WM_STYLECHANGED is received...
+        */
+        pWinPriv->hDwp = BeginDeferWindowPos(1);
+        pWinPriv->hDwp = DeferWindowPos(pWinPriv->hDwp, hwnd, NULL, newWinRect.left, newWinRect.top, newWinRect.right - newWinRect.left, newWinRect.bottom - newWinRect.top, SWP_NOACTIVATE | SWP_NOZORDER);
+      }
+      return 0;
+
+    case WM_STYLECHANGED:
+      {
+        if (pWinPriv->hDwp)
+          {
+            EndDeferWindowPos(pWinPriv->hDwp);
+            pWinPriv->hDwp = NULL;
+          }
+        winDebug("winTopLevelWindowProc - WM_STYLECHANGED done\n");
+      }
+      return 0;
+
     case WM_MOUSEACTIVATE:
 
       /* Check if this window needs to be made active when clicked */
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index cf2f93f..ebe4309 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -79,6 +79,7 @@ typedef struct
   HWND			hWnd;
   winPrivScreenPtr	pScreenPriv;
   Bool			fXKilled;
+  HDWP                  hDwp;
 
   /* Privates used by primary fb DirectDraw server */
   LPDDSURFACEDESC	pddsdPrimary;
commit 1d7f3a0031b4ae7d8aa984799ffa578788061ce4
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Nov 7 19:34:12 2009 +0000

    glx: Move GLX extension string utility functions
    
    Move GLX extension string utility functions from the DRI1 convenience library
    into the GLX extension convenience library, so other DDX which don't have DRI
    can use them.
    
    This is probably also needed if anyone actually tries to build an Xorg DDX
    with only DRI2 support...
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/glx/Makefile.am b/glx/Makefile.am
index 7cc2521..34be4ae 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -48,9 +48,7 @@ glapi_sources =					\
 	glthread.c				\
 	glthread.h
 
-libglxdri_la_SOURCES = \
-        extension_string.c \
-        extension_string.h
+libglxdri_la_SOURCES =
 
 if DRI
 libglxdri_la_SOURCES += glxdri.c
@@ -65,6 +63,8 @@ libglxdri_la_LIBADD = $(DLOPEN_LIBS)
 libglx_la_SOURCES = \
 	$(indirect_sources) \
 	$(glapi_sources) \
+	extension_string.c \
+	extension_string.h \
 	indirect_util.c \
 	indirect_util.h \
 	indirect_program.c \
commit 932513e23b5fe1793cc38eabe02df82e1cc6e4d9
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Thu May 5 13:11:46 2011 -0700

    DRI2/GLX: use new swap event types
    
    Use the new event types so we can pass a valid SBC value to clients.
    Fix up the completion calls to use CARD32 instead of CARD64 to match
    the new field size.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

diff --git a/configure.ac b/configure.ac
index 67a7f13..623a930 100644
--- a/configure.ac
+++ b/configure.ac
@@ -774,11 +774,11 @@ RECORDPROTO="recordproto >= 1.13.99.1"
 SCRNSAVERPROTO="scrnsaverproto >= 1.1"
 RESOURCEPROTO="resourceproto"
 DRIPROTO="xf86driproto >= 2.1.0"
-DRI2PROTO="dri2proto >= 2.3"
+DRI2PROTO="dri2proto >= 2.6"
 XINERAMAPROTO="xineramaproto"
 BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
 DGAPROTO="xf86dgaproto >= 2.0.99.1"
-GLPROTO="glproto >= 1.4.10"
+GLPROTO="glproto >= 1.4.14"
 DMXPROTO="dmxproto >= 2.2.99.1"
 VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
 WINDOWSWMPROTO="windowswmproto"
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 93c5e5b..e872258 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -163,10 +163,10 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable)
 
 static void
 __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
-		  CARD64 msc, CARD64 sbc)
+		  CARD64 msc, CARD32 sbc)
 {
     __GLXdrawable *drawable = data;
-    xGLXBufferSwapComplete wire;
+    xGLXBufferSwapComplete2 wire;
 
     if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
 	return;
@@ -192,8 +192,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
     wire.ust_lo = ust & 0xffffffff;
     wire.msc_hi = msc >> 32;
     wire.msc_lo = msc & 0xffffffff;
-    wire.sbc_hi = sbc >> 32;
-    wire.sbc_lo = sbc & 0xffffffff;
+    wire.sbc = sbc;
 
     WriteEventsToClient(client, 1, (xEvent *) &wire);
 }
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index fe0bf6c..2a41ead 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -51,7 +51,7 @@ extern CARD8 dri2_minor;
 
 typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
 typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
-				 CARD64 ust, CARD64 msc, CARD64 sbc);
+				 CARD64 ust, CARD64 msc, CARD32 sbc);
 
 
 typedef DRI2BufferPtr	(*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw,
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 4e48e65..552b26b 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -357,9 +357,9 @@ vals_to_card64(CARD32 lo, CARD32 hi)
 
 static void
 DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
-	      CARD64 sbc)
+	      CARD32 sbc)
 {
-    xDRI2BufferSwapComplete event;
+    xDRI2BufferSwapComplete2 event;
     DrawablePtr pDrawable = data;
 
     event.type = DRI2EventBase + DRI2_BufferSwapComplete;
@@ -369,8 +369,7 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
     event.ust_lo = ust & 0xffffffff;
     event.msc_hi = (CARD64)msc >> 32;
     event.msc_lo = msc & 0xffffffff;
-    event.sbc_hi = (CARD64)sbc >> 32;
-    event.sbc_lo = sbc & 0xffffffff;
+    event.sbc = sbc;
 
     WriteEventsToClient(client, 1, (xEvent *)&event);
 }
commit a3cb7d097a281252cebbc3c65c67149e106482ac
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Tue May 3 10:36:44 2011 -0700

    GLX/DRI2: pass drawable correctly for indirect swap events
    
    Pass the right drawable pointer as data to the swap complete function.
    
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index d979717..93c5e5b 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -222,7 +222,7 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
 #endif
 
     if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
-			__glXdriSwapEvent, drawable->pDraw) != Success)
+			__glXdriSwapEvent, drawable) != Success)
 	return FALSE;
 
     return TRUE;
commit 3e8270b869ebf788778d5d56107f6d47c7c050d0
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Apr 12 15:30:25 2011 -0400

    glx: Fix fbconfigs with no corresponding visual
    
    There are, in general, more fbconfig depths than visual depths.
    fbconfigs need not support Window rendering, however any that do must
    have an associated visual ID (which we got right), and any that do not
    must not claim GLX_WINDOW_BIT in GLX_DRAWABLE_TYPE (which we got
    wrong).
    
    Fixes piglit/glx-fbconfig-sanity, assuming you have a sufficiently
    recent piglit, as that test formerly wrongly required pixmap-capable
    fbconfigs to have a visual.
    
    v2: Additional check for fbconfigs that didn't have GLX_WINDOW_BIT in
        the first place, from previous patch by Jon TURNEY; also, also clear
        ->visualID.
    
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 496cf9e..c4ad426 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -395,8 +395,15 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
 	    if (depth == pScreen->visuals[i].nplanes)
 		break;
 	}
+	/* if it can't, fix up the fbconfig to not advertise window support */
 	if (i == pScreen->numVisuals)
+	    config->drawableType &= ~(GLX_WINDOW_BIT);
+
+       /* fbconfig must support window drawables */
+	if (!(config->drawableType & GLX_WINDOW_BIT)) {
+	    config->visualID = 0;
 	    continue;
+	}
 
 	/* Create a new X visual for our FBconfig. */
 	visual = AddScreenVisuals(pScreen, 1, depth);
commit 4edf49d032028aa4b9887d02b926b0c372c4451d
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:18 2011 +0200

    dmx/examples: Fix missing key_click_percent assignment.
    
    Thanks to gcc's -Wunused-but-set-variable, stop ignoring the percent
    parameter, and add it to the XKeyboardControl structure before the
    XChangeKeyboardControl call.
    
    This warning goes away accordingly:
    |   CC     xbell-xbell.o
    | xbell.c: In function ‘main’:
    | xbell.c:74:22: warning: variable ‘percent’ set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/hw/dmx/examples/xbell.c b/hw/dmx/examples/xbell.c
index f3e3be1..79419d3 100644
--- a/hw/dmx/examples/xbell.c
+++ b/hw/dmx/examples/xbell.c
@@ -71,7 +71,6 @@ int main(int argc, char **argv)
     XKeyboardControl kc;
     XKeyboardState   ks;
     unsigned long    vm;
-    int              percent;
 
     if (argc != 5) {
         printf("Usage: xbell percent baseVolume pitch duration\n");
@@ -81,7 +80,7 @@ int main(int argc, char **argv)
     vm               = (KBBellPercent
                         | KBBellPitch
                         | KBBellDuration);
-    percent          = atoi(argv[1]);
+    kc.key_click_percent = atoi(argv[1]);
     kc.bell_percent  = atoi(argv[2]);
     kc.bell_pitch    = atoi(argv[3]);
     kc.bell_duration = atoi(argv[4]);
commit 33dad2b74e3489c8a6b5fa574172d6cd2b6de037
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    hw/dmx: Stop using variables for text widgets.
    
    They are unused in the sense they're not getting any callback set up, so
    there's no point in storing them into variables. Keep the initial
    alignment of the parameters to try and reduce the diff noise.
    
    Those warnings go away accordingly:
    |   CC     xdmxconfig-xdmxconfig.o
    | xdmxconfig.c: In function ‘main’:
    | xdmxconfig.c:881:29: warning: variable ‘quittext’ set but not used [-Wunused-but-set-variable]
    | xdmxconfig.c:880:53: warning: variable ‘abouttext’ set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index c67077a..2de7f2b 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -877,8 +877,8 @@ int main(int argc, char **argv)
     Widget         parent, menubox, bottombox, databox, canvasbox;
     Widget         filebutton, helpbutton;
     Widget         filemenu, openbutton, savebutton, quitbutton;
-    Widget         helpmenu, aboutbutton, aboutbox, abouttext, aboutok;
-    Widget         quitbox, quittext, quitok, quitcan;
+    Widget         helpmenu, aboutbutton, aboutbox, aboutok;
+    Widget         quitbox, quitok, quitcan;
     Widget         ncbutton;
     Widget         canbutton;
     Widget         ecbox, ecokbutton, eccanbutton;
@@ -1096,7 +1096,7 @@ int main(int argc, char **argv)
                                         toplevel, NULL);
     aboutbox     = XtVaCreateManagedWidget("aboutbox", boxWidgetClass,
                                            aboutpopup, NULL);
-    abouttext    = XtVaCreateManagedWidget("abouttext", labelWidgetClass,
+                   XtVaCreateManagedWidget("abouttext", labelWidgetClass,
                                            aboutbox,
                                            XtNlabel, DMX_INFO,
                                            NULL);
@@ -1108,7 +1108,7 @@ int main(int argc, char **argv)
                                         toplevel, NULL);
     quitbox      = XtVaCreateManagedWidget("quitbox", boxWidgetClass,
                                            quitpopup, NULL);
-    quittext     = XtVaCreateManagedWidget("quittext", labelWidgetClass,
+                   XtVaCreateManagedWidget("quittext", labelWidgetClass,
                                            quitbox,
                                            XtNlabel,
                                            "Changes to the configuration\n"
commit 34a9f2a90d34a2ab7ecf56d329e75e8da569f939
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    xfixes: Remove unused variable.
    
    The last use of pScreen in ProcXFixesSetPictureClipRegion was removed in
    aa7096ca6f108e399d9916639cf20c57f9776305 so remove it entirely.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/xfixes/region.c b/xfixes/region.c
index f493496..be2d391 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -756,12 +756,10 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
 {
     PicturePtr		pPicture;
     RegionPtr		pRegion;
-    ScreenPtr		pScreen;
     REQUEST(xXFixesSetPictureClipRegionReq);
     
     REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
     VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
-    pScreen = pPicture->pDrawable->pScreen;
     VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
     
     return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin,
commit ad0d0833d45ea24d7af1f724b9905133fe3b065f
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    xfixes: Mark some variables as unused.
    
    Calling Unwrap() is just a way of performing an assignment while keeping a
    backup of the original value. In the CursorCloseScreen function, the backup
    value doesn't seem to be useful, but Unwrap() is used anyway (probably to stay
    in line with other functions). As a consequence, mark those variables as unused.
    
    The following warnings go away accordingly:
    |   CC     cursor.lo
    | cursor.c: In function 'CursorCloseScreen':
    | cursor.c:186:26: warning: variable 'display_proc' set but not used [-Wunused-but-set-variable]
    | cursor.c:185:24: warning: variable 'close_proc' set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 01eb70d..ecbed40 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -196,8 +196,8 @@ CursorCloseScreen (int index, ScreenPtr pScreen)
 {
     CursorScreenPtr	cs = GetCursorScreen (pScreen);
     Bool		ret;
-    CloseScreenProcPtr	close_proc;
-    DisplayCursorProcPtr display_proc;
+    _X_UNUSED CloseScreenProcPtr	close_proc;
+    _X_UNUSED DisplayCursorProcPtr	display_proc;
     ConstrainCursorHarderProcPtr constrain_proc;
 
     Unwrap (cs, pScreen, CloseScreen, close_proc);
commit f41ac25d932ef34ab912201ab5ce65f85f2ff171
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    miext: Mark some variables as unused.
    
    There's no use for the values set through the various macro calls
    (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused.
    
    The following warnings go away accordingly:
    |   CC     shpacked.lo
    | shpacked.c: In function 'shadowUpdatePacked':
    | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shplanar8.lo
    | shplanar8.c: In function 'shadowUpdatePlanar4x8':
    | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shplanar.lo
    | shplanar.c: In function 'shadowUpdatePlanar4':
    | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_180.lo
    | In file included from shrot16pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_270.lo
    | In file included from shrot16pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_270YX.lo
    | In file included from shrot16pack_270YX.c:31:0:
    | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX':
    | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_90.lo
    | In file included from shrot16pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_90YX.lo
    | In file included from shrot16pack_90YX.c:31:0:
    | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX':
    | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack.lo
    | In file included from shrot16pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate16':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_180.lo
    | In file included from shrot32pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_270.lo
    | In file included from shrot32pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_90.lo
    | In file included from shrot32pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack.lo
    | In file included from shrot32pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate32':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_180.lo
    | In file included from shrot8pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_270.lo
    | In file included from shrot8pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_90.lo
    | In file included from shrot8pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack.lo
    | In file included from shrot8pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate8':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrotate.lo
    | shrotate.c: In function 'shadowUpdateRotatePacked':
    | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shpacked.lo
    | shpacked.c: In function 'shadowUpdatePacked':
    | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shplanar8.lo
    | shplanar8.c: In function 'shadowUpdatePlanar4x8':
    | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shplanar.lo
    | shplanar.c: In function 'shadowUpdatePlanar4':
    | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_180.lo
    | In file included from shrot16pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_270.lo
    | In file included from shrot16pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_270YX.lo
    | In file included from shrot16pack_270YX.c:31:0:
    | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX':
    | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_90.lo
    | In file included from shrot16pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate16_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack_90YX.lo
    | In file included from shrot16pack_90YX.c:31:0:
    | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX':
    | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot16pack.lo
    | In file included from shrot16pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate16':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_180.lo
    | In file included from shrot32pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_270.lo
    | In file included from shrot32pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack_90.lo
    | In file included from shrot32pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate32_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot32pack.lo
    | In file included from shrot32pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate32':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_180.lo
    | In file included from shrot8pack_180.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_180':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_270.lo
    | In file included from shrot8pack_270.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_270':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack_90.lo
    | In file included from shrot8pack_90.c:31:0:
    | shrotpack.h: In function 'shadowUpdateRotate8_90':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrot8pack.lo
    | In file included from shrot8pack.c:30:0:
    | shrotpack.h: In function 'shadowUpdateRotate8':
    | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    |   CC     shrotate.lo
    | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable]
    | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
index 06606bc..c37dca1 100644
--- a/miext/shadow/shpacked.c
+++ b/miext/shadow/shpacked.c
@@ -52,7 +52,7 @@ shadowUpdatePacked (ScreenPtr	    pScreen,
     FbStride	shaStride;
     int		scrBase, scrLine, scr;
     int		shaBpp;
-    int		shaXoff, shaYoff; /* XXX assumed to be zero */
+    _X_UNUSED int	shaXoff, shaYoff;
     int		x, y, w, h, width;
     int         i;
     FbBits	*winBase = NULL, *win;
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
index 9ca3f3f..3504051 100644
--- a/miext/shadow/shplanar.c
+++ b/miext/shadow/shplanar.c
@@ -98,7 +98,7 @@ shadowUpdatePlanar4 (ScreenPtr	    pScreen,
     FbStride	shaStride;
     int		scrBase, scrLine, scr;
     int		shaBpp;
-    int		shaXoff, shaYoff;   /* XXX assumed to be zero */
+    _X_UNUSED int	shaXoff, shaYoff;
     int		x, y, w, h, width;
     int         i;
     CARD32	*winBase = NULL, *win;
diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c
index f8b255d..d064814 100644
--- a/miext/shadow/shplanar8.c
+++ b/miext/shadow/shplanar8.c
@@ -102,7 +102,7 @@ shadowUpdatePlanar4x8 (ScreenPtr	pScreen,
     FbStride	shaStride;
     int		scrBase, scrLine, scr;
     int		shaBpp;
-    int		shaXoff, shaYoff;   /* XXX assumed to be zero */
+    _X_UNUSED int	shaXoff, shaYoff;
     int		x, y, w, h, width;
     int         i;
     CARD32	*winBase = NULL, *win;
diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c
index c389826..0901203 100644
--- a/miext/shadow/shrotate.c
+++ b/miext/shadow/shrotate.c
@@ -59,7 +59,7 @@ shadowUpdateRotatePacked (ScreenPtr	pScreen,
     FbBits	*shaBits;
     FbStride	shaStride;
     int		shaBpp;
-    int		shaXoff, shaYoff;
+    _X_UNUSED int	shaXoff, shaYoff;
     int		box_x1, box_x2, box_y1, box_y2;
     int		sha_x1 = 0, sha_y1 = 0;
     int		scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h;
diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h
index 2d1a87c..16afff1 100644
--- a/miext/shadow/shrotpack.h
+++ b/miext/shadow/shrotpack.h
@@ -106,7 +106,7 @@ FUNC (ScreenPtr	    pScreen,
     FbStride	shaStride;
     int		scrBase, scrLine, scr;
     int		shaBpp;
-    int		shaXoff, shaYoff;   /* XXX assumed to be zero */
+    _X_UNUSED int	shaXoff, shaYoff;
     int		x, y, w, h, width;
     int         i;
     Data	*winBase = NULL, *win;
diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h
index 7d36bd1..d7b01ec 100644
--- a/miext/shadow/shrotpackYX.h
+++ b/miext/shadow/shrotpackYX.h
@@ -69,7 +69,7 @@ FUNC (ScreenPtr	    pScreen,
     Data	*shaBase, *shaLine, *sha;
     FbStride	shaStride, winStride;
     int		shaBpp;
-    int		shaXoff, shaYoff;   /* XXX assumed to be zero */
+    _X_UNUSED int	shaXoff, shaYoff;
     int		x, y, w, h;
     Data	*winBase, *win, *winLine;
     CARD32	winSize;
commit fe6f489d21d77aacf0a073883625619018d764b3
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    fb: Mark some variables as unused.
    
    There's no use for the values set through the various macro calls
    (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused.
    
    The following warnings go away accordingly:
    |   CC     libfb_la-fb24_32.lo
    | fb24_32.c: In function 'fb24_32ReformatTile':
    | fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable]
    | fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable]
    | fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable]
    | fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable]
    |   CC     libfb_la-fbfill.lo
    | fbfill.c: In function 'fbFill':
    | fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
    | fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
    | fbfill.c:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
    | fbfill.c:100:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
    | fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable]
    | fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable]
    |   CC     libfb_la-fbgc.lo
    | fbgc.c: In function 'fbPadPixmap':
    | fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable]
    | fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable]
    | fbgc.c: In function 'fbCanEvenStipple':
    | fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
    | fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
    |   CC     libfb_la-fbpush.lo
    | fbpush.c: In function 'fbPushPixels':
    | fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
    | fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index 2e600ed..033fa46 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -540,8 +540,8 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
     FbStride	oldStride, newStride;
     int		oldBpp, newBpp;
     fb24_32BltFunc  blt;
-    int		oldXoff, oldYoff;
-    int		newXoff, newYoff;
+    _X_UNUSED int   oldXoff, oldYoff;
+    _X_UNUSED int   newXoff, newYoff;
 
     pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
 				     pOldTile->drawable.height,
diff --git a/fb/fbfill.c b/fb/fbfill.c
index 801a0d0..e62a48a 100644
--- a/fb/fbfill.c
+++ b/fb/fbfill.c
@@ -69,7 +69,7 @@ fbFill (DrawablePtr pDrawable,
 	    FbBits	*stip;
 	    FbStride    stipStride;
 	    int		stipBpp;
-	    int		stipXoff, stipYoff; /* XXX assumed to be zero */
+	    _X_UNUSED int	stipXoff, stipYoff;
 
 	    if (pGC->fillStyle == FillStippled)
 		alu = FbStipple1Rop(pGC->alu,pGC->fgPixel);
@@ -97,7 +97,7 @@ fbFill (DrawablePtr pDrawable,
 	    FbStip	*stip;
 	    FbStride    stipStride;
 	    int		stipBpp;
-	    int		stipXoff, stipYoff; /* XXX assumed to be zero */
+	    _X_UNUSED int	stipXoff, stipYoff;
 	    FbBits	fgand, fgxor, bgand, bgxor;
 
 	    fgand = pPriv->and;
@@ -139,7 +139,7 @@ fbFill (DrawablePtr pDrawable,
 	int	    tileBpp;
 	int	    tileWidth;
 	int	    tileHeight;
-	int	    tileXoff, tileYoff; /* XXX assumed to be zero */
+	_X_UNUSED int	tileXoff, tileYoff;
 	
 	fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
 	tileWidth = pTile->drawable.width;
diff --git a/fb/fbgc.c b/fb/fbgc.c
index cc504c1..8108c3a 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -89,7 +89,7 @@ fbPadPixmap (PixmapPtr pPixmap)
     int	    w;
     int     stride;
     int     bpp;
-    int     xOff, yOff;
+    _X_UNUSED int xOff, yOff;
 
     fbGetDrawable (&pPixmap->drawable, bits, stride, bpp, xOff, yOff);
 
@@ -163,7 +163,7 @@ fbCanEvenStipple (PixmapPtr pStipple, int bpp)
     FbBits  *bits;
     int	    stride;
     int	    stip_bpp;
-    int	    stipXoff, stipYoff;
+    _X_UNUSED int stipXoff, stipYoff;
     int	    h;
 
     /* can't even stipple 24bpp drawables */
diff --git a/fb/fbpush.c b/fb/fbpush.c
index 9d82718..8dd7c2b 100644
--- a/fb/fbpush.c
+++ b/fb/fbpush.c
@@ -235,7 +235,7 @@ fbPushPixels (GCPtr	    pGC,
     FbStip	*stip;
     FbStride	stipStride;
     int		stipBpp;
-    int		stipXoff, stipYoff; /* Assumed to be zero */
+    _X_UNUSED int	stipXoff, stipYoff;
 
     fbGetStipDrawable (&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
 
commit 8da16898d9de5da1f80b789f0b371070968285f8
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:17 2011 +0200

    fb: Simplify logic, get rid of set but unused variable.
    
    wrapped is only useful is FB_ACCESS_WRAPPER is set; simplify the logic
    accordingly, and only set it when that's defined.
    
    The following warning goes away accordingly:
    |   CC     libfb_la-fbarc.lo
    | fbarc.c: In function 'fbPolyArc':
    | fbarc.c:71:11: warning: variable 'wrapped' set but not used [-Wunused-but-set-variable]
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/fb/fbarc.c b/fb/fbarc.c
index a0c5343..e54c804 100644
--- a/fb/fbarc.c
+++ b/fb/fbarc.c
@@ -68,15 +68,12 @@ fbPolyArc (DrawablePtr	pDrawable,
 	    BoxRec	box;
 	    int		x2, y2;
 	    RegionPtr	cclip;
-	    int		wrapped = 0;
+#ifdef FB_ACCESS_WRAPPER
+	    int		wrapped = 1;
+#endif
 	    
 	    cclip = fbGetCompositeClip (pGC);
 	    fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-#ifdef FB_ACCESS_WRAPPER
-	    wrapped = 1;
-#else
-	    wrapped = 0;
-#endif
 	    while (narcs--)
 	    {
 		if (miCanZeroArc (parcs))
commit 9a8bfc2c06f0a9206b64ae01a783cf5513f021a6
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:16 2011 +0200

    configure: Bump dependency on xproto.
    
    Bumping this dependency means some additional macros can be used, like
    _X_UNUSED.
    
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/configure.ac b/configure.ac
index 22566c9..9b831b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -785,7 +785,7 @@ WINDOWSWMPROTO="windowswmproto"
 APPLEWMPROTO="applewmproto >= 1.4"
 
 dnl Core modules for most extensions, et al.
-SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
+SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
 # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
 AC_SUBST(SDK_REQUIRED_MODULES)
 
commit 9da5aa09d70e26dd4d2ef878a21317dae7bf24de
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:11 2011 +0200

    Xext: Fix buggy checks.
    
    XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be
    NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston
    instead.
    
    Those warnings go away accordingly:
    |   CC     xvmc.lo
    | xvmc.c: In function 'ProcXvMCListSubpictureTypes':
    | xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    | xvmc.c: In function 'XvMCExtensionInit':
    | xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    | xvmc.c: In function 'XvMCFindXvImage':
    | xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>

diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 4d29941..bc78b55 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
 
     pScreen = pPort->pAdaptor->pScreen;
 
-    if(XvMCScreenKey == NULL) /* No XvMC adaptors */
-        return BadMatch;
+    if (!dixPrivateKeyRegistered(XvMCScreenKey))
+        return BadMatch;   /* No XvMC adaptors */
 
     if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
         return BadMatch;   /* None this screen */
@@ -668,8 +668,8 @@ XvMCExtensionInit(void)
 {
    ExtensionEntry *extEntry;
 
-   if(XvMCScreenKey == NULL) /* nobody supports it */
-	return; 
+   if (!dixPrivateKeyRegistered(XvMCScreenKey))
+	return;
 
    if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
 					      "XvMCRTContext")))
@@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
     XvMCAdaptorPtr adaptor = NULL;
     int i;
 
-    if(XvMCScreenKey == NULL) return NULL;
+    if (!dixPrivateKeyRegistered(XvMCScreenKey))
+        return NULL;
 
     if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) 
         return NULL;


More information about the Xquartz-changes mailing list