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

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Jul 23 22:52:20 PDT 2012


 Xext/panoramiX.c                   |    5 -
 Xext/xvmc.c                        |    8 +-
 configure.ac                       |    4 -
 glx/glxdri2.c                      |   23 +++---
 glx/glxext.c                       |    3 
 glx/glxserver.h                    |    2 
 hw/xfree86/common/xf86AutoConfig.c |    1 
 hw/xfree86/common/xf86Extensions.h |    8 +-
 hw/xfree86/dri2/dri2.c             |   15 +++
 hw/xfree86/dri2/dri2.h             |    7 +
 hw/xfree86/dri2/dri2ext.c          |    9 +-
 hw/xfree86/sdksyms.sh              |    2 
 hw/xwin/InitOutput.c               |   23 +++++-
 hw/xwin/Makefile.am                |    1 
 hw/xwin/README                     |  141 -------------------------------------
 hw/xwin/man/XWin.man               |   26 +++---
 hw/xwin/win.h                      |    2 
 hw/xwin/winblock.c                 |    2 
 hw/xwin/winclipboard.h             |    7 -
 hw/xwin/winclipboardinit.c         |    2 
 hw/xwin/winclipboardthread.c       |    8 --
 hw/xwin/winclipboardunicode.c      |   65 -----------------
 hw/xwin/winclipboardwndproc.c      |    7 -
 hw/xwin/winclipboardwrappers.c     |   10 --
 hw/xwin/winclipboardxevents.c      |   14 ---
 hw/xwin/wincreatewnd.c             |   93 +++++++++++++++---------
 hw/xwin/windialogs.c               |    8 +-
 hw/xwin/winerror.c                 |    4 -
 hw/xwin/winkeyhook.c               |   18 ----
 hw/xwin/winmonitors.c              |    5 +
 hw/xwin/winmonitors.h              |   29 +++++++
 hw/xwin/winmultiwindowwm.c         |   79 ++++++++++----------
 hw/xwin/winprocarg.c               |   18 ++--
 hw/xwin/winscrinit.c               |    4 -
 hw/xwin/winwndproc.c               |    7 +
 include/extinit.h                  |   32 ++++----
 include/os.h                       |   10 +-
 os/utils.c                         |   73 +++++++++++++++++++
 randr/rrprovider.c                 |   47 ++++++------
 randr/rrproviderproperty.c         |   78 +++++++++++---------
 randr/rrscreen.c                   |   21 ++---
 test/xtest.c                       |    1 
 xkb/ddxList.c                      |    6 -
 xkb/ddxLoad.c                      |   75 -------------------
 44 files changed, 440 insertions(+), 563 deletions(-)

New commits:
commit 77de2994774e7be24a0bad521180628feb1027c6
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 17 15:47:39 2012 -0700

    Bump to version 1.12.99.902
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 6456192..bf6868e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-07-10"
+AC_INIT([xorg-server], 1.12.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-07-17"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit beeea70495a8d5c4afc1b1eb2cc06a24ab1a986d
Merge: 6e438a0 6910280
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 17 12:17:39 2012 -0700

    Merge remote-tracking branch 'alanc/master'

commit 6e438a0e183f5a6c22070746c038af53d5b935ca
Merge: 5884e7d 75966a4
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 17 12:12:53 2012 -0700

    Merge remote-tracking branch 'jturney/master'

commit 75966a4186955f3a4625e93796145036c5986d2e
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Jul 13 14:36:25 2012 -0700

    xwin: Clean up os wrappers for System, Popen and Pclose on Windows
    
    Popen and Pclose are never used on Windows, so don't bother to even
    try to define them.
    
    System(s) was defined as system(s), but the two users of that
    function are in xkb, which carefully redefines that as
    Win32System. Move Win32System and Win32TempDir to os/utils.c, renaming
    Win32System to be just System, which simplifies the xkb code
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/include/os.h b/include/os.h
index 7701c39..9e323f3 100644
--- a/include/os.h
+++ b/include/os.h
@@ -359,9 +359,13 @@ Fopen(const char *, const char *);
 extern _X_EXPORT int
 Fclose(pointer);
 #else
-#define System(a) system(a)
-#define Popen(a,b) popen(a,b)
-#define Pclose(a) pclose(a)
+
+extern const char *
+Win32TempDir(void);
+
+extern int
+System(const char *cmdline);
+
 #define Fopen(a,b) fopen(a,b)
 #define Fclose(a) fclose(a)
 #endif
diff --git a/os/utils.c b/os/utils.c
index a6f6ef5..d902523 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1561,6 +1561,79 @@ Fclose(pointer iop)
 
 #endif                          /* !WIN32 */
 
+#ifdef WIN32
+
+#include <X11/Xwindows.h>
+
+const char *
+Win32TempDir()
+{
+    static char buffer[PATH_MAX];
+
+    if (GetTempPath(sizeof(buffer), buffer)) {
+        int len;
+
+        buffer[sizeof(buffer) - 1] = 0;
+        len = strlen(buffer);
+        if (len > 0)
+            if (buffer[len - 1] == '\\')
+                buffer[len - 1] = 0;
+        return buffer;
+    }
+    if (getenv("TEMP") != NULL)
+        return getenv("TEMP");
+    else if (getenv("TMP") != NULL)
+        return getenv("TEMP");
+    else
+        return "/tmp";
+}
+
+int
+System(const char *cmdline)
+{
+    STARTUPINFO si;
+    PROCESS_INFORMATION pi;
+    DWORD dwExitCode;
+    char *cmd = strdup(cmdline);
+
+    ZeroMemory(&si, sizeof(si));
+    si.cb = sizeof(si);
+    ZeroMemory(&pi, sizeof(pi));
+
+    if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+        LPVOID buffer;
+
+        if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                           FORMAT_MESSAGE_FROM_SYSTEM |
+                           FORMAT_MESSAGE_IGNORE_INSERTS,
+                           NULL,
+                           GetLastError(),
+                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                           (LPTSTR) & buffer, 0, NULL)) {
+            ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
+        }
+        else {
+            ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer);
+            LocalFree(buffer);
+        }
+
+        free(cmd);
+        return -1;
+    }
+    /* Wait until child process exits. */
+    WaitForSingleObject(pi.hProcess, INFINITE);
+
+    GetExitCodeProcess(pi.hProcess, &dwExitCode);
+
+    /* Close process and thread handles. */
+    CloseHandle(pi.hProcess);
+    CloseHandle(pi.hThread);
+    free(cmd);
+
+    return dwExitCode;
+}
+#endif
+
 /*
  * CheckUserParameters: check for long command line arguments and long
  * environment variables.  By default, these checks are only done when
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 9b69b2b..79f4637 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -44,12 +44,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #ifdef WIN32
 /* from ddxLoad.c */
-extern const char *Win32TempDir(void);
-extern int Win32System(const char *cmdline);
-
-#undef System
-#define System Win32System
-
 #define W32_tmparg " '%s'"
 #define W32_tmpfile ,tmpname
 #define W32_tmplen strlen(tmpname)+3
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index cb2dfc3..d462957 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -68,81 +68,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define PATHSEPARATOR "/"
 #endif
 
-#ifdef WIN32
-
-#include <X11/Xwindows.h>
-const char *
-Win32TempDir()
-{
-    static char buffer[PATH_MAX];
-
-    if (GetTempPath(sizeof(buffer), buffer)) {
-        int len;
-
-        buffer[sizeof(buffer) - 1] = 0;
-        len = strlen(buffer);
-        if (len > 0)
-            if (buffer[len - 1] == '\\')
-                buffer[len - 1] = 0;
-        return buffer;
-    }
-    if (getenv("TEMP") != NULL)
-        return getenv("TEMP");
-    else if (getenv("TMP") != NULL)
-        return getenv("TEMP");
-    else
-        return "/tmp";
-}
-
-int
-Win32System(const char *cmdline)
-{
-    STARTUPINFO si;
-    PROCESS_INFORMATION pi;
-    DWORD dwExitCode;
-    char *cmd = strdup(cmdline);
-
-    ZeroMemory(&si, sizeof(si));
-    si.cb = sizeof(si);
-    ZeroMemory(&pi, sizeof(pi));
-
-    if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
-        LPVOID buffer;
-
-        if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                           FORMAT_MESSAGE_FROM_SYSTEM |
-                           FORMAT_MESSAGE_IGNORE_INSERTS,
-                           NULL,
-                           GetLastError(),
-                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                           (LPTSTR) & buffer, 0, NULL)) {
-            ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
-        }
-        else {
-            ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer);
-            LocalFree(buffer);
-        }
-
-        free(cmd);
-        return -1;
-    }
-    /* Wait until child process exits. */
-    WaitForSingleObject(pi.hProcess, INFINITE);
-
-    GetExitCodeProcess(pi.hProcess, &dwExitCode);
-
-    /* Close process and thread handles. */
-    CloseHandle(pi.hProcess);
-    CloseHandle(pi.hThread);
-    free(cmd);
-
-    return dwExitCode;
-}
-
-#undef System
-#define System(x) Win32System(x)
-#endif
-
 static void
 OutputDirectory(char *outdir, size_t size)
 {
commit 6910280297ab610100dd8e7fbe5bb5cc08968f2f
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jul 14 10:54:36 2012 -0700

    Use C99 designated initializers in DRI2GetParam replies
    
    DRI2GetParam was going through review in parallel with main batch of
    C99 initialization changes - sync up now that both have landed.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index eb6fd44..ee610c0 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -550,15 +550,16 @@ static int
 ProcDRI2GetParam(ClientPtr client)
 {
     REQUEST(xDRI2GetParamReq);
-    xDRI2GetParamReply rep;
+    xDRI2GetParamReply rep = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0
+    };
     DrawablePtr pDrawable;
     CARD64 value;
     int status;
 
     REQUEST_SIZE_MATCH(xDRI2GetParamReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequenceNumber = client->sequence;
 
     if (!validDrawable(client, stuff->drawable, DixReadAccess,
                        &pDrawable, &status))
commit a6c5b8d3ee053cadf685b0e4de96407ad6df4dd4
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jul 14 10:50:41 2012 -0700

    Use C99 designated initializers in RandR 1.4 extension Events
    
    RandR 1.4 was going through review in parallel with main batch of
    C99 initialization changes - sync up now that both have landed.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c
index 785f42c..e0a814f 100644
--- a/randr/rrproviderproperty.c
+++ b/randr/rrproviderproperty.c
@@ -65,14 +65,14 @@ RRDestroyProviderProperty(RRPropertyPtr prop)
 static void
 RRDeleteProperty(RRProviderRec * provider, RRPropertyRec * prop)
 {
-    xRRProviderPropertyNotifyEvent event;
-
-    event.type = RREventBase + RRNotify;
-    event.subCode = RRNotify_ProviderProperty;
-    event.provider = provider->id;
-    event.state = PropertyDelete;
-    event.atom = prop->propertyName;
-    event.timestamp = currentTime.milliseconds;
+    xRRProviderPropertyNotifyEvent event = {
+        .type = RREventBase + RRNotify,
+        .subCode = RRNotify_ProviderProperty,
+        .provider = provider->id,
+        .state = PropertyDelete,
+        .atom = prop->propertyName,
+        .timestamp = currentTime.milliseconds
+    };
 
     RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
 
@@ -138,7 +138,6 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
                        pointer value, Bool sendevent, Bool pending)
 {
     RRPropertyPtr prop;
-    xRRProviderPropertyNotifyEvent event;
     rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen);
     int size_in_bytes;
     int total_size;
@@ -237,12 +236,14 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
         provider->pendingProperties = TRUE;
 
     if (sendevent) {
-        event.type = RREventBase + RRNotify;
-        event.subCode = RRNotify_ProviderProperty;
-        event.provider = provider->id;
-        event.state = PropertyNewValue;
-        event.atom = prop->propertyName;
-        event.timestamp = currentTime.milliseconds;
+        xRRProviderPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_ProviderProperty,
+            .provider = provider->id,
+            .state = PropertyNewValue,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
         RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
     }
     return Success;
@@ -677,14 +678,14 @@ ProcRRGetProviderProperty(ClientPtr client)
     reply.propertyType = prop_value->type;
 
     if (stuff->delete && (reply.bytesAfter == 0)) {
-        xRRProviderPropertyNotifyEvent event;
-
-        event.type = RREventBase + RRNotify;
-        event.subCode = RRNotify_ProviderProperty;
-        event.provider = provider->id;
-        event.state = PropertyDelete;
-        event.atom = prop->propertyName;
-        event.timestamp = currentTime.milliseconds;
+        xRRProviderPropertyNotifyEvent event = {
+            .type = RREventBase + RRNotify,
+            .subCode = RRNotify_ProviderProperty,
+            .provider = provider->id,
+            .state = PropertyDelete,
+            .atom = prop->propertyName,
+            .timestamp = currentTime.milliseconds
+        };
         RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event);
     }
 
commit ada04ef0ca8a1213e865ba2c000ccd6ed6d0e371
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jul 14 10:45:29 2012 -0700

    Use C99 designated initializers in RandR 1.4 extension Replies
    
    RandR 1.4 was going through review in parallel with main batch of
    C99 initialization changes - sync up now that both have landed.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index c4fe369..c4ed515 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -86,23 +86,26 @@ ProcRRGetProviders (ClientPtr client)
     }
 
     pScrPriv = rrGetScrPriv(pScreen);
-    rep.pad = 0;
 
     if (!pScrPriv)
     {
-        rep.type = X_Reply;
-        rep.sequenceNumber = client->sequence;
-        rep.length = 0;
-        rep.timestamp = currentTime.milliseconds;
-        rep.nProviders = 0;
+        rep = (xRRGetProvidersReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .length = 0,
+            .timestamp = currentTime.milliseconds,
+            .nProviders = 0
+        };
         extra = NULL;
         extraLen = 0;
     } else {
-        rep.type = X_Reply;
-        rep.sequenceNumber = client->sequence;
-        rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-        rep.nProviders = total_providers;
-        rep.length = total_providers;
+        rep = (xRRGetProvidersReply) {
+            .type = X_Reply,
+            .sequenceNumber = client->sequence,
+            .timestamp = pScrPriv->lastSetTime.milliseconds,
+            .nProviders = total_providers,
+            .length = total_providers
+        };
         extraLen = rep.length << 2;
         if (extraLen) {
             extra = malloc(extraLen);
@@ -163,18 +166,20 @@ ProcRRGetProviderInfo (ClientPtr client)
     pScreen = provider->pScreen;
     pScrPriv = rrGetScrPriv(pScreen);
 
-    rep.type = X_Reply;
-    rep.status = RRSetConfigSuccess;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.capabilities = provider->capabilities;
-    rep.nameLength = provider->nameLength;
-    rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-    rep.nCrtcs = pScrPriv->numCrtcs;
-    rep.nOutputs = pScrPriv->numOutputs;
+    rep = (xRRGetProviderInfoReply) {
+        .type = X_Reply,
+        .status = RRSetConfigSuccess,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .capabilities = provider->capabilities,
+        .nameLength = provider->nameLength,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .nCrtcs = pScrPriv->numCrtcs,
+        .nOutputs = pScrPriv->numOutputs,
+        .nAssociatedProviders = 0
+    };
 
     /* count associated providers */
-    rep.nAssociatedProviders = 0;
     if (provider->offload_sink)
         rep.nAssociatedProviders++;
     if (provider->output_source)
diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c
index 5e04fab..785f42c 100644
--- a/randr/rrproviderproperty.c
+++ b/randr/rrproviderproperty.c
@@ -394,10 +394,12 @@ ProcRRListProviderProperties(ClientPtr client)
         if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
             return BadAlloc;
 
-    rep.type = X_Reply;
-    rep.length = bytes_to_int32(numProps * sizeof(Atom));
-    rep.sequenceNumber = client->sequence;
-    rep.nAtoms = numProps;
+    rep = (xRRListProviderPropertiesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = bytes_to_int32(numProps * sizeof(Atom)),
+        .nAtoms = numProps
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -438,12 +440,14 @@ ProcRRQueryProviderProperty(ClientPtr client)
         if (!extra)
             return BadAlloc;
     }
-    rep.type = X_Reply;
-    rep.length = prop->num_valid;
-    rep.sequenceNumber = client->sequence;
-    rep.pending = prop->is_pending;
-    rep.range = prop->range;
-    rep.immutable = prop->immutable;
+    rep = (xRRQueryProviderPropertyReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = prop->num_valid,
+        .pending = prop->is_pending,
+        .range = prop->range,
+        .immutable = prop->immutable
+    };
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
@@ -568,7 +572,10 @@ ProcRRGetProviderProperty(ClientPtr client)
     RRPropertyValuePtr prop_value;
     unsigned long n, len, ind;
     RRProviderPtr provider;
-    xRRGetProviderPropertyReply reply;
+    xRRGetProviderPropertyReply reply = {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence
+    };
     char *extra = NULL;
 
     REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq);
@@ -594,8 +601,6 @@ ProcRRGetProviderProperty(ClientPtr client)
         if (prop->propertyName == stuff->property)
             break;
 
-    reply.type = X_Reply;
-    reply.sequenceNumber = client->sequence;
     if (!prop) {
         reply.nItems = 0;
         reply.length = 0;
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 6a7a089..39340cc 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -396,16 +396,17 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
     ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len);
 
     pScrPriv = rrGetScrPriv(pScreen);
-    rep.pad = 0;
-    rep.type = X_Reply;
-    rep.sequenceNumber = client->sequence;
-    rep.length = 0;
-    rep.timestamp = pScrPriv->lastSetTime.milliseconds;
-    rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
-    rep.nCrtcs = total_crtcs;
-    rep.nOutputs = total_outputs;
-    rep.nModes = total_modes;
-    rep.nbytesNames = total_name_len;
+    rep = (xRRGetScreenResourcesReply) {
+        .type = X_Reply,
+        .sequenceNumber = client->sequence,
+        .length = 0,
+        .timestamp = pScrPriv->lastSetTime.milliseconds,
+        .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
+        .nCrtcs = total_crtcs,
+        .nOutputs = total_outputs,
+        .nModes = total_modes,
+        .nbytesNames = total_name_len
+    };
 
     rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
                   bytes_to_int32(rep.nbytesNames));
commit fb73f7f40fa46458990038332017d4496caa0691
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jul 14 10:02:52 2012 -0700

    Fix two more C99 initialization mistakes using members of same struct
    
    Similar to 34cf559bcf99dad, use temporary variables instead of
    referencing members of the struct being initialized in the middle
    of the initialization.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 5653c08..1c7197d 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -1056,11 +1056,12 @@ int
 ProcXineramaQueryScreens(ClientPtr client)
 {
     /* REQUEST(xXineramaQueryScreensReq); */
+    CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
     xXineramaQueryScreensReply rep = {
         .type = X_Reply,
         .sequenceNumber = client->sequence,
-        .length = bytes_to_int32(rep.number * sz_XineramaScreenInfo),
-        .number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens
+        .length = bytes_to_int32(number * sz_XineramaScreenInfo),
+        .number = number
     };
 
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 8d93cc3..5f0123b 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -135,6 +135,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
     xvmcSurfaceInfo info;
     XvMCAdaptorPtr adaptor = NULL;
     XvMCSurfaceInfoPtr surface;
+    int num_surfaces;
 
     REQUEST(xvmcListSurfaceTypesReq);
     REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
@@ -154,16 +155,17 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
         }
     }
 
+    num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
     rep = (xvmcListSurfaceTypesReply) {
         .type = X_Reply,
         .sequenceNumber = client->sequence,
-        .num = (adaptor) ? adaptor->num_surfaces : 0,
-        .length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo)),
+        .num = num_surfaces,
+        .length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
     };
 
     WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
 
-    for (i = 0; i < rep.num; i++) {
+    for (i = 0; i < num_surfaces; i++) {
         surface = adaptor->surfaces[i];
         info.surface_type_id = surface->surface_type_id;
         info.chroma_format = surface->chroma_format;
commit 5884e7dedecdd82ddbb037360cf9c85143e094b5
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Mon Jul 16 17:40:31 2012 -0700

    xf86: Re-export extension disable flags
    
    These flags were unexported by commit a1d41e311c21eb6627caa0d168e070ceaf90806f,
    which moved the declarations around and lost the _X_EXPORT attributes in the
    process.  Since drivers need these and it's late in the release cycle, just
    re-export them for now.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Andy Ritger <aritger at nvidia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Extensions.h b/hw/xfree86/common/xf86Extensions.h
index 9b8448d..cad86c8 100644
--- a/hw/xfree86/common/xf86Extensions.h
+++ b/hw/xfree86/common/xf86Extensions.h
@@ -29,25 +29,25 @@
 #include "extnsionst.h"
 
 #ifdef XF86DRI
-extern Bool noXFree86DRIExtension;
+extern _X_EXPORT Bool noXFree86DRIExtension;
 extern void XFree86DRIExtensionInit(void);
 #endif
 
 #ifdef DRI2
 #include <X11/extensions/dri2proto.h>
-extern Bool noDRI2Extension;
+extern _X_EXPORT Bool noDRI2Extension;
 extern void DRI2ExtensionInit(void);
 #endif
 
 #ifdef XF86VIDMODE
 #include <X11/extensions/xf86vmproto.h>
-extern Bool noXFree86VidModeExtension;
+extern _X_EXPORT Bool noXFree86VidModeExtension;
 extern void XFree86VidModeExtensionInit(void);
 #endif
 
 #ifdef XFreeXDGA
 #include <X11/extensions/xf86dgaproto.h>
-extern Bool noXFree86DGAExtension;
+extern _X_EXPORT Bool noXFree86DGAExtension;
 extern void XFree86DGAExtensionInit(void);
 extern void XFree86DGARegister(void);
 #endif
diff --git a/include/extinit.h b/include/extinit.h
index 0a24db0..6c5337f 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -54,17 +54,17 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "extnsionst.h"
 
 #ifdef COMPOSITE
-extern Bool noCompositeExtension;
+extern _X_EXPORT Bool noCompositeExtension;
 extern void CompositeExtensionInit(void);
 #endif
 
 #ifdef DAMAGE
-extern Bool noDamageExtension;
+extern _X_EXPORT Bool noDamageExtension;
 extern void DamageExtensionInit(void);
 #endif
 
 #if defined(DBE)
-extern Bool noDbeExtension;
+extern _X_EXPORT Bool noDbeExtension;
 extern void DbeExtensionInit(void);
 #endif
 
@@ -74,7 +74,7 @@ extern void DMXExtensionInit(void);
 
 #if defined(DPMSExtension)
 #include <X11/extensions/dpmsconst.h>
-extern Bool noDPMSExtension;
+extern _X_EXPORT Bool noDPMSExtension;
 extern void DPMSExtensionInit(void);
 #endif
 
@@ -88,12 +88,12 @@ extern void GlxExtensionInit(void);
 
 #ifdef PANORAMIX
 #include <X11/extensions/panoramiXproto.h>
-extern Bool noPanoramiXExtension;
+extern _X_EXPORT Bool noPanoramiXExtension;
 extern void PanoramiXExtensionInit(void);
 #endif
 
 #ifdef RANDR
-extern Bool noRRExtension;
+extern _X_EXPORT Bool noRRExtension;
 extern void RRExtensionInit(void);
 #endif
 
@@ -101,18 +101,18 @@ extern void RRExtensionInit(void);
 extern void RecordExtensionInit(void);
 #endif
 
-extern Bool noRenderExtension;
+extern _X_EXPORT Bool noRenderExtension;
 extern void RenderExtensionInit(void);
 
 #if defined(RES)
 #include <X11/extensions/XResproto.h>
-extern Bool noResExtension;
+extern _X_EXPORT Bool noResExtension;
 extern void ResExtensionInit(void);
 #endif
 
 #if defined(SCREENSAVER)
 #include <X11/extensions/saver.h>
-extern Bool noScreenSaverExtension;
+extern _X_EXPORT Bool noScreenSaverExtension;
 extern void ScreenSaverExtensionInit(void);
 #endif
 
@@ -122,7 +122,7 @@ extern void ShapeExtensionInit(void);
 #ifdef MITSHM
 #include <X11/extensions/shm.h>
 #include <X11/extensions/shmproto.h>
-extern Bool noMITShmExtension;
+extern _X_EXPORT Bool noMITShmExtension;
 extern void ShmExtensionInit(void);
 #endif
 
@@ -133,20 +133,20 @@ extern void XCMiscExtensionInit(void);
 #ifdef XCSECURITY
 #include <X11/extensions/secur.h>
 #include "securitysrv.h"
-extern Bool noSecurityExtension;
+extern _X_EXPORT Bool noSecurityExtension;
 extern void SecurityExtensionInit(void);
 #endif
 
 #ifdef XF86BIGFONT
 #include <X11/extensions/xf86bigfproto.h>
-extern Bool noXFree86BigfontExtension;
+extern _X_EXPORT Bool noXFree86BigfontExtension;
 extern void XFree86BigfontExtensionInit(void);
 #endif
 
 extern void BigReqExtensionInit(void);
 
 #ifdef XFIXES
-extern Bool noXFixesExtension;
+extern _X_EXPORT Bool noXFixesExtension;
 extern void XFixesExtensionInit(void);
 #endif
 
@@ -160,7 +160,7 @@ extern void XkbExtensionInit(void);
 
 #if defined(XSELINUX)
 #include "xselinux.h"
-extern Bool noSELinuxExtension;
+extern _X_EXPORT Bool noSELinuxExtension;
 extern void SELinuxExtensionInit(void);
 #endif
 
@@ -171,14 +171,14 @@ extern void XTestExtensionInit(void);
 #endif
 
 #ifdef INXQUARTZ
-extern Bool noPseudoramiXExtension;
+extern _X_EXPORT Bool noPseudoramiXExtension;
 extern void PseudoramiXExtensionInit(void);
 #endif
 
 #if defined(XV)
 #include <X11/extensions/Xv.h>
 #include <X11/extensions/XvMC.h>
-extern Bool noXvExtension;
+extern _X_EXPORT Bool noXvExtension;
 extern void XvExtensionInit(void);
 extern void XvMCExtensionInit(void);
 #endif
commit 357ec54f46d31ff77c441c15c322152e04f89a11
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Mar 14 13:58:32 2012 +0000

    hw/xwin: Refer to xkeyboard-config man page for XKB configuration option values
    
    Also polish the keyboard configuration text a bit
    Include man section number in references to setxkbmap
    Consistently refer to 'manual page' rather using both that and 'man page'
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index d03a365..dbadad6 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -313,18 +313,22 @@ exit silently and don't display any error message.
 .B "\-xkbvariant \fIvariant\fp"
 These options configure the xkeyboard extension to load
 a particular keyboard map as the X server starts.  The behavior is similar
-to the \fIsetxkbmap\fP program.  The layout data is located at \fI
-__datadir__/X11/xkb/\fP.  Additional information is found in the
-README files therein and in the man page of \fIsetxkbmap\fP.  For example
-in order to load a German layout for a pc105 keyboard one uses
-the options:
+to the \fIsetxkbmap\fP(1) program.
+
+See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of
+keyboard configurations.
+
+The keyboard layout data is located at \fI__datadir__/X11/xkb/\fP.  Additional information
+can be found in the README files there and in the \fIsetxkbmap\fP(1) manual page.
+
+For example, in order to load a German layout for a pc105 keyboard, use the options:
 .br
 .I " \-xkblayout de \-xkbmodel pc105"
 
-Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
+Alternatively, you can use the \fIsetxkbmap\fP(1) program after \fIXWin\fP is
 running.
 
-The default is to select a configuration matching your current layout as
+The default is to select a keyboard configuration matching your current layout as
 reported by \fIWindows\fP, if known, or the default X server configuration
 if no matching keyboard configuration was found.
 
@@ -370,7 +374,7 @@ window, in both the generic case and for particular programs.
 * To change the style that is associated to the \fIWindows\fP window that
 \fXWin I-multiwindow\fP produces for each top-level X window.
 .PP
-The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+The format of the \fI.XWinrc\fP file is given in the XWinrc(5) manual page.
 
 .SH EXAMPLES
 Need some examples
@@ -378,15 +382,15 @@ Need some examples
 
 .SH "SEE ALSO"
 X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__),
-setxkbmap(1), xkeyboard-config (__miscmansuffix__).
+setxkbmap(1), xkeyboard-config(__miscmansuffix__).
 
 
 .SH BUGS
 .I XWin
-and this man page still have many limitations.
+and this manual page still have many limitations.
 
 The \fIXWin\fP software is continuously developing; it is therefore possible that
-this man page is not up to date.  It is always prudent to
+this manual page is not up to date.  It is always prudent to
 look also at the output of \fIXWin -help\fP in order to
 check the options that are operative.
 
commit 5940580f8c12145c1ef4c3eee898676b48d95879
Author: Jörg Mensmann <joerg_ml at bitplanet.de>
Date:   Tue Apr 17 10:48:19 2012 +0100

    hw/xwin: Fix command line arguments for multiple monitors.
    
    Moving Xwin to a certain monitor using "-screen 0 @2" would fail,
    printing "ddxProcessArgument - screen - Querying monitors failed".
    
    This happened since commit 3ead1d810b0e157078db39712e02ea6dc85216d8,
    because EnumDisplayMonitor() returns FALSE if its callback function
    returns FALSE (which is not clearly documented), and QueryMonitor()
    would then also return FALSE.
    
    Moving back to the old behaviour, where the return value of
    EnumDisplayMonitors() is ignored.
    
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c
index 4732410..07532f6 100644
--- a/hw/xwin/winmonitors.c
+++ b/hw/xwin/winmonitors.c
@@ -64,5 +64,7 @@ QueryMonitor(int index, struct GetMonitorInfoData *data)
     data->requestedMonitor = index;
 
     /* query information */
-    return EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
+    EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
+
+    return TRUE;
 }
commit 18801f5e5a98d80f4811ade8c98df65175b1935a
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 10 09:27:16 2012 +0000

    hw/xwin: Remove unused WindowExposuresProcPtr storage in screen private
    
    We don't wrap the WindowExposures screen function
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 9096df2..38d6bde 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -579,7 +579,6 @@ typedef struct _winPrivScreenRec {
     UnrealizeWindowProcPtr UnrealizeWindow;
     ValidateTreeProcPtr ValidateTree;
     PostValidateTreeProcPtr PostValidateTree;
-    WindowExposuresProcPtr WindowExposures;
     CopyWindowProcPtr CopyWindow;
     ClearToBackgroundProcPtr ClearToBackground;
     ClipNotifyProcPtr ClipNotify;
commit 8fd30859c293035fe505da76d8d7e64131bd5bc0
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 10 13:25:32 2012 +0000

    hw/xwin: Remove long obsolete README for hw/xwin
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/README b/hw/xwin/README
deleted file mode 100644
index 219fd13..0000000
--- a/hw/xwin/README
+++ /dev/null
@@ -1,141 +0,0 @@
-Cygwin/X Release Notes
-======================
-
-Release X11R6.7
-===============
-
-Cygwin/X has continued its rapid pace of development that it has sustained
-since Spring 2001 and this release shows it, we now have: a stable and fast
-multi-window mode, seamless clipboard integration, a configurable tray menu
-icon, popups on error messages pointing users to the log file and our mailing
-list, the beginnings of indirect 3D acceleration for OpenGL applications,
-improved non-US keyboard and clipboard support, and only a handful of bugs
-that continue to be reported.
-
-Between the XFree86 4.3.0 release and the X.Org X11R6.7 release the Cyg-
-win/XFree86 project broke away from The XFree86 Project, Inc. due to a lack
-of support from the XFree86 project.  As such, the Cygwin/XFree86 project was
-renamed to the Cygwin/X project and the upstream source code tree that Cyg-
-win/X pulls from and pushes to is now the tree managed by the X.Org Founda-
-tion.  The Cygwin/X project has seen a rush of development and interest in
-the project since the split; one metric showing this is that the number of
-CVS committers we have has gone from zero to six.
-
-The most outstanding features of this release are
-
-   o Major multi-window mode improvements. (Takuma Murakami, Earle F. 
-     Philhower III)
-
-   o Initial work of accelerated OpenGL using the windows OpenGL drivers. 
-     (Alexander Gottwald)
-
-   o Massive rework of clipboard integration with windows. (Harold L Hunt II,
-     Kensuke Matsuzaki)
-
-   o Improved Japanese clipboard and keyboard support. (Kensuke Matsuzaki,
-     Takuma Murakami, Alexander Gottwald)
-
-   o Customizable tray menu icon allowing shortcuts to start programs,
-     etc.(Earle F. Philhower III)
-
-   o New icons. (Jehan Bing, Michael Bax, Benjamin Rienfenstahl)
-
-   o Fix some multi-monitor problems.(Takuma Murakami)
-
-   o Fix repeated key strokes. (Ivan Pascal)
-
-   o Automatic keyboard layouts for the most frequently used keyboard lay-
-     outs. (Alexander Gottwald)
-
-   o Built in SHM support with detection of the SHM engine (cygserver).
-     (Ralf Habacker, Harold L Hunt II)
-
-   o Merged in work on the NativeGDI engine. (Alan Hourihane)
-
-OpenGL with Cygwin/X
-====================
-
-Cygwin/X has supported GLX only with software rendering provided by the Mesa
-library. Starting with X11R6.7 we add support for hardware accelerated OpenGL.
-
-This support is still under development and still has some bigger problems. 
-To provide both versions (the stable software rendering and the new hardware
-accelerated) we ship to binaries. XWin.exe contains the software rendering 
-and XWin_GL.exe uses the hardware acceleration provided by the windows drivers.
-
-The known problems with hardware accelerated OpenGL are:
-
-   o Only multiwindow mode is useful. In the other modes the OpenGL output 
-     does not align with the X11 windows.
-
-   o Using two programs which require different visuals will fail. For example
-     glxgears and glxinfo will not work without restarting XWin_GL.exe.
-
-   o OpenGL extensions and functions from OpenGL 1.2 and later should work 
-     but are not completely tested.
-
-   o The standard Windows OpenGL driver will produce no output. Use the one 
-     from your video adapter vendor.  
-
-If you notice problems with some programs please send a message with the 
-logfile /tmp/XWin.log and a short error description to <cygwin-xfree at cygwin.com>
-
-The hardware accelerated OpenGL was tested using: 
-
-   o glxgears
-   o glxinfo
-   o blender
-   o tuxkart
-   o GLUT demos (some did fail)
-   o tuxracer (currently not working)
-
-    
-Release X11R6.8
-===============
-
-Having reached a quite mature state in release X11R6.7 the development 
-has slowed down a little bit. Some of the former active developers have
-retired or cut their work for the Cygwin/X project due to conflicts with 
-job, study and family. 
-
-The X11R6.8 release now includes major improvements from the xserver project.
-This includes the XFixes, Damage, Composite and XEVIE extension which is a 
-major step towards allowing Cygwin/X to have real transparency. 
-
-But at the current state Composite is not working with Cygwin/X. Not all code
-in the Cygwin/X Server has been updated to support the Composite feature and
-using it will even crash the xserver. But as a second problem nearly all
-functions required for compositing are lacking acceleration in Cygwin/X so
-the feature would not be very useful if it would work. So it is disabled by
-default. 
-
-OpenGL with Cygwin/X
-====================
-
-The OpenGL support has lost some of it's limitations from the last release 
-and should be much more stable. But due to missing wide spread testing in 
-the community it is still available in a separate program. XWin still uses 
-the old software OpenGL which is known to be stable.
-
-The known problems with hardware accelerated OpenGL are:
-
-   o Only multiwindow mode is useful. In the other modes the OpenGL output 
-     does not align with the X11 windows.
-
-   o OpenGL extensions and functions from OpenGL 1.2 and later should work 
-     but are not completely tested.
-
-   o The standard Windows OpenGL driver will produce no output. Use the one 
-     from your video adapter vendor.  
-
-If you notice problems with some programs please send a message with the 
-logfile /tmp/XWin.log and a short error description to <cygwin-xfree at cygwin.com>
-
-The hardware accelerated OpenGL was tested using: 
-
-   o glxgears
-   o glxinfo
-   o blender
-   o tuxkart
-   o GLUT demos (some did fail)
-
commit 3568d4af4ff2490e79286d242916e81afed57b58
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Feb 23 22:32:09 2012 +0000

    hw/xwin: Remove a pointless OS version check in winInstallKeyboardHookLL()
    
    Checking for OS later than NT4 SP3 (which we didn't do correctly anyhow,
    just checking for NT) is pointless when other code in hw/xwin assumes at
    least NT 5.0
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index 1241508..fe77b21 100644
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -133,24 +133,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
 Bool
 winInstallKeyboardHookLL(void)
 {
-    OSVERSIONINFO osvi = { 0 };
-
-    /* Get operating system version information */
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-    GetVersionEx(&osvi);
-
-    /* Branch on platform ID */
-    switch (osvi.dwPlatformId) {
-    case VER_PLATFORM_WIN32_NT:
-        /* Low-level is supported on NT 4.0 SP3+ only */
-        /* TODO: Return FALSE on NT 4.0 with no SP, SP1, or SP2 */
-        break;
-
-    case VER_PLATFORM_WIN32_WINDOWS:
-        /* Low-level hook is not supported on non-NT */
-        return FALSE;
-    }
-
     /* Install the hook only once */
     if (!g_hhookKeyboardLL)
         g_hhookKeyboardLL = SetWindowsHookEx(WH_KEYBOARD_LL,
commit 0ed0d3979050c4ee7bef64441d50c494d58d93b0
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 5 22:08:38 2012 +0100

    hw/xwin: Remove winClipboardDetectUnicodeSupport()
    
    This code for detecting if the Windows clipboard can support unicode
    is long obsolete.
    
    All NT versions of Windows support unicode clipboard, so any version
    of Windows we can run on must support unicode clipboard.
    
    The -nounicodeclipboard flag to disable use of unicode on the clipboard
    is retained.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index c490163..4c2f04e 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -5,7 +5,6 @@ SRCS_CLIPBOARD = \
 	winclipboardinit.c \
 	winclipboardtextconv.c \
 	winclipboardthread.c \
-	winclipboardunicode.c \
 	winclipboardwndproc.c \
 	winclipboardwrappers.c \
 	winclipboardxevents.c
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index 203a963..27eb2f9 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -112,13 +112,6 @@ void
  winDeinitClipboard(void);
 
 /*
- * winclipboardunicode.c
- */
-
-Bool
- winClipboardDetectUnicodeSupport(void);
-
-/*
  * winclipboardwndproc.c
  */
 
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 47bd50f..f2e8e6d 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -64,7 +64,6 @@ static int clipboardRestarts = 0;
 static XIOErrorHandler g_winClipboardOldIOErrorHandler;
 static pthread_t g_winClipboardProcThread;
 
-Bool g_fUnicodeSupport = FALSE;
 Bool g_fUseUnicode = FALSE;
 
 /*
@@ -106,11 +105,8 @@ winClipboardProc(void *pvNotUsed)
     winDebug("winClipboardProc - Hello\n");
     ++clipboardRestarts;
 
-    /* Do we have Unicode support? */
-    g_fUnicodeSupport = winClipboardDetectUnicodeSupport();
-
     /* Do we use Unicode clipboard? */
-    fUseUnicode = g_fUnicodeClipboard && g_fUnicodeSupport;
+    fUseUnicode = g_fUnicodeClipboard;
 
     /* Save the Unicode support flag in a global */
     g_fUseUnicode = fUseUnicode;
diff --git a/hw/xwin/winclipboardunicode.c b/hw/xwin/winclipboardunicode.c
deleted file mode 100644
index 9c06f7b..0000000
--- a/hw/xwin/winclipboardunicode.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
- *
- * Authors:	Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "winclipboard.h"
-
-/*
- * Determine whether we suport Unicode or not.
- * NOTE: Currently, just check if we are on an NT-based platform or not.
- */
-
-Bool
-winClipboardDetectUnicodeSupport(void)
-{
-    Bool fReturn = FALSE;
-    OSVERSIONINFO osvi = { 0 };
-
-    /* Get operating system version information */
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-    GetVersionEx(&osvi);
-
-    /* Branch on platform ID */
-    switch (osvi.dwPlatformId) {
-    case VER_PLATFORM_WIN32_NT:
-        /* Unicode supported on NT only */
-        fReturn = TRUE;
-        break;
-
-    case VER_PLATFORM_WIN32_WINDOWS:
-        /* Unicode is not supported on non-NT */
-        fReturn = FALSE;
-        break;
-    }
-
-    return fReturn;
-}
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index 78b0615..cbe6599 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -49,7 +49,6 @@
  */
 
 extern Bool g_fUseUnicode;
-extern Bool g_fUnicodeSupport;
 extern void *g_pClipboardDisplay;
 extern Window g_iClipboardWindow;
 extern Atom g_atomLastOwnedSelection;
@@ -60,6 +59,7 @@ extern Atom g_atomLastOwnedSelection;
 
 static int
 
+
 winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay,
                          Bool fUseUnicode, int iTimeoutSec);
 
@@ -415,7 +415,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         if (message == WM_RENDERALLFORMATS)
             fConvertToUnicode = FALSE;
         else
-            fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam);
+            fConvertToUnicode = (CF_UNICODETEXT == wParam);
 
         /* Request the selection contents */
         iReturn = XConvertSelection(pDisplay,
@@ -470,8 +470,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
          */
         if (WIN_XEVENTS_NOTIFY != iReturn) {
             /* Paste no data, to satisfy required call to SetClipboardData */
-            if (g_fUnicodeSupport)
-                SetClipboardData(CF_UNICODETEXT, NULL);
+            SetClipboardData(CF_UNICODETEXT, NULL);
             SetClipboardData(CF_TEXT, NULL);
 
             ErrorF
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
index 882edc1..1118f4f 100644
--- a/hw/xwin/winclipboardwrappers.c
+++ b/hw/xwin/winclipboardwrappers.c
@@ -60,7 +60,6 @@ DISPATCH_PROC(winProcSetSelectionOwner);
  * References to external symbols
  */
 
-extern Bool g_fUnicodeSupport;
 extern int g_iNumScreens;
 extern unsigned int g_uiAuthDataLen;
 extern char *g_pAuthData;
@@ -362,11 +361,8 @@ winProcSetSelectionOwner(ClientPtr client)
         goto winProcSetSelectionOwner_Done;
     }
 
-    /* Advertise Unicode if we support it */
-    if (g_fUnicodeSupport)
-        SetClipboardData(CF_UNICODETEXT, NULL);
-
-    /* Always advertise regular text */
+    /* Advertise regular text and unicode */
+    SetClipboardData(CF_UNICODETEXT, NULL);
     SetClipboardData(CF_TEXT, NULL);
 
     /* Save handle to last owned selection */
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index 59b1f07..ce533c5 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -37,12 +37,6 @@
 #include "misc.h"
 
 /*
- * References to external symbols
- */
-
-extern Bool g_fUnicodeSupport;
-
-/*
  * Process any pending X events
  */
 
@@ -228,10 +222,6 @@ winClipboardFlushXEvents(HWND hwnd,
             else
                 xiccesStyle = XStringStyle;
 
-            /*
-             * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
-             */
-
             /* Get a pointer to the clipboard text, in desired format */
             if (fUseUnicode) {
                 /* Retrieve clipboard data */
@@ -687,10 +677,10 @@ winClipboardFlushXEvents(HWND hwnd,
             free(pwszUnicodeStr);
             if (hGlobal && pszGlobalData)
                 GlobalUnlock(hGlobal);
-            if (fSetClipboardData && g_fUnicodeSupport)
+            if (fSetClipboardData) {
                 SetClipboardData(CF_UNICODETEXT, NULL);
-            if (fSetClipboardData)
                 SetClipboardData(CF_TEXT, NULL);
+            }
             return WIN_XEVENTS_NOTIFY;
 
         case SelectionClear:
commit c98471fad7d85fc9d9959b1c48edd90415f7bf15
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 5 18:00:06 2012 +0100

    hw/xwin: Consolidate duplicated code as getHwnd() function
    
    Consolidate code to find the native HWND of an X window, stored in the _WINDOWSWM_NATIVE_HWND
    property, duplicated in UpdateName() and PreserveWin32Stack() as getHwnd()
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 66ced75..76b4683 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -477,23 +477,23 @@ SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData)
 }
 
 /*
- * Updates the name of a HWND according to its X WM_NAME property
+ * See if we can get the stored HWND for this window...
  */
-
-static void
-UpdateName(WMInfoPtr pWMInfo, Window iWindow)
+static HWND
+getHwnd(WMInfoPtr pWMInfo, Window iWindow)
 {
-    wchar_t *pszName;
     Atom atmType;
     int fmtRet;
     unsigned long items, remain;
-    HWND *retHwnd, hWnd;
-    XWindowAttributes attr;
-
-    hWnd = 0;
-
-    /* See if we can get the cached HWND for this window... */
-    if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER,    //pWMInfo->atmPrivMap,
+    HWND *retHwnd, hWnd = NULL;
+
+    if (XGetWindowProperty(pWMInfo->pDisplay,
+                           iWindow,
+                           pWMInfo->atmPrivMap,
+                           0,
+                           1,
+                           False,
+                           XA_INTEGER,
                            &atmType,
                            &fmtRet,
                            &items,
@@ -506,8 +506,26 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
 
     /* Some sanity checks */
     if (!hWnd)
-        return;
+        return NULL;
     if (!IsWindow(hWnd))
+        return NULL;
+
+    return hWnd;
+}
+
+/*
+ * Updates the name of a HWND according to its X WM_NAME property
+ */
+
+static void
+UpdateName(WMInfoPtr pWMInfo, Window iWindow)
+{
+    wchar_t *pszName;
+    HWND hWnd;
+    XWindowAttributes attr;
+
+    hWnd = getHwnd(pWMInfo, iWindow);
+    if (!hWnd)
         return;
 
     /* Set the Windows window name */
@@ -532,27 +550,12 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
 static void
 PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction)
 {
-    Atom atmType;
-    int fmtRet;
-    unsigned long items, remain;
-    HWND hWnd, *retHwnd;
+    HWND hWnd;
     DWORD myWinProcID, winProcID;
     Window xWindow;
     WINDOWPLACEMENT wndPlace;
 
-    hWnd = NULL;
-    /* See if we can get the cached HWND for this window... */
-    if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER,    //pWMInfo->atmPrivMap,
-                           &atmType,
-                           &fmtRet,
-                           &items,
-                           &remain, (unsigned char **) &retHwnd) == Success) {
-        if (retHwnd) {
-            hWnd = *retHwnd;
-            XFree(retHwnd);
-        }
-    }
-
+    hWnd = getHwnd(pWMInfo, iWindow);
     if (!hWnd)
         return;
 
commit df7636dddb4981e14ee7d128c43bb08bdf6a8727
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 5 14:20:52 2012 +0100

    hw/xwin: Correct function name in log message
    
    Correct function name in log message winInitializeDefaultScreens -> winInitializeScreenDefaults
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 72fbf14..a5b3c07 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -101,14 +101,15 @@ winInitializeScreenDefaults(void)
             int dpiY = GetDeviceCaps(hdc, LOGPIXELSY);
 
             winErrorFVerb(2,
-                          "winInitializeDefaultScreens - native DPI x %d y %d\n",
+                          "winInitializeScreenDefaults - native DPI x %d y %d\n",
                           dpiX, dpiY);
+
             monitorResolution = dpiY;
             ReleaseDC(NULL, hdc);
         }
         else {
             winErrorFVerb(1,
-                          "winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n",
+                          "winInitializeScreenDefaults - Failed to retrieve native DPI, falling back to default of %d DPI\n",
                           WIN_DEFAULT_DPI);
             monitorResolution = WIN_DEFAULT_DPI;
         }
commit 9cdd3ed07425b222e8197b9a2f57ec1525c6fd54
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Mar 16 12:56:45 2012 +0000

    hw/xwin: Tidy up some more pointless output which is always emitted
    
    It's not very useful to log lines like the below when the About.. dialog is used
    
    winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL
    winAboutDlgProc - WM_CLOSE
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index c62b5db..a02146e 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -492,7 +492,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
         switch (LOWORD(wParam)) {
         case IDOK:
         case IDCANCEL:
-            ErrorF("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+            winDebug("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
 
             /* 
              * User dismissed the dialog, hide it until the
@@ -504,7 +504,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message,
         break;
 
     case WM_CLOSE:
-        ErrorF("winChangeDepthDlgProc - WM_CLOSE\n");
+        winDebug("winChangeDepthDlgProc - WM_CLOSE\n");
 
         DestroyWindow(g_hDlgAbout);
         g_hDlgAbout = NULL;
@@ -609,7 +609,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         switch (LOWORD(wParam)) {
         case IDOK:
         case IDCANCEL:
-            ErrorF("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+            winDebug("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
 
             DestroyWindow(g_hDlgAbout);
             g_hDlgAbout = NULL;
@@ -699,7 +699,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         break;
 
     case WM_CLOSE:
-        ErrorF("winAboutDlgProc - WM_CLOSE\n");
+        winDebug("winAboutDlgProc - WM_CLOSE\n");
 
         DestroyWindow(g_hDlgAbout);
         g_hDlgAbout = NULL;
commit eb5b4d8d809712053701f057a35bbf5348ac9059
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Thu Jul 5 14:03:44 2012 +0100

    hw/xwin: RANDR resize didn't occur when screen window was maximized or restored
    
    In windowed mode, with option -resize, RANDR resize was missing when the screen
    window was maximized or restored.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 3f5d66b..fe662b9 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -428,6 +428,13 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     }
         return 0;
 
+    case WM_SYSCOMMAND:
+        if (s_pScreenInfo->iResizeMode == resizeWithRandr &&
+            ((wParam & 0xfff0) == SC_MAXIMIZE ||
+             (wParam & 0xfff0) == SC_RESTORE))
+            PostMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
+        break;
+
     case WM_ENTERSIZEMOVE:
         ErrorF("winWindowProc - WM_ENTERSIZEMOVE\n");
         break;
commit 7e07d61857c5d2ee6e3c36c81b51bb4fe378b5a0
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 5 14:01:03 2012 +0100

    hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor
    
    There is a bug that when the -screen option is used to specify a monitor for
    the screen window to be located on, but no explicit size is specified
    (and the -multiplemonitors option isn't specified), the screen
    window size is always constrained to fit the work area of the primary
    monitor (rather than the work area of the specified monitor)
    
    This gives incorrect results if you want a screen the same size as your
    non-primary monitor (e.g. by using -screen 0 @2) and your non-primary
    monitor is larger than your primary monitor.
    
    (This can be worked around by specifying -multiplemonitors and an explicit
    screen size the same size as the monitor (e.g. -multiplemonitors -screen 0
    1600x1200 at 2))
    
    Fix to use work area for the monitor specified for the screen, rather than the
    primary monitor work area (unless -multiplemonitors is used, in which case we
    continue to use the virtual desktop work area instead)
    
    Also fix the adjustment for an autohide taskbar, so that it is only done if the
    taskbar is on the same monitor as the screen (or -multiplemonitors is used)
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index b84ea9b..9096df2 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -388,6 +388,7 @@ typedef struct {
     DWORD dwScreen;
 
     int iMonitor;
+    HMONITOR hMonitor;
     DWORD dwUserWidth;
     DWORD dwUserHeight;
     DWORD dwWidth;
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 0a18a6a..6732dcb 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -34,10 +34,6 @@
 #include "win.h"
 #include "shellapi.h"
 
-#ifndef ABS_AUTOHIDE
-#define ABS_AUTOHIDE 1
-#endif
-
 /*
  * Local function prototypes
  */
@@ -46,7 +42,7 @@ static Bool
  winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
 
 static Bool
- winAdjustForAutoHide(RECT * prcWorkArea);
+ winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
 
 /*
  * Create a full screen window
@@ -218,7 +214,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
     winGetWorkArea(&rcWorkArea, pScreenInfo);
 
     /* Adjust for auto-hide taskbars */
-    winAdjustForAutoHide(&rcWorkArea);
+    winAdjustForAutoHide(&rcWorkArea, pScreenInfo);
 
     /* Did the user specify a position? */
     if (pScreenInfo->fUserGavePosition) {
@@ -501,14 +497,32 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
     int iLeft, iTop;
     int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
 
-    /* SPI_GETWORKAREA only gets the work area of the primary screen. */
-    SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0);
+    /* Use GetMonitorInfo to get work area for monitor */
+    if (!pScreenInfo->fMultipleMonitors) {
+        MONITORINFO mi;
+
+        mi.cbSize = sizeof(MONITORINFO);
+        if (GetMonitorInfo(pScreenInfo->hMonitor, &mi)) {
+            *prcWorkArea = mi.rcWork;
 
-    /* Bail out here if we aren't using multiple monitors */
-    if (!pScreenInfo->fMultipleMonitors)
+            winDebug("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n",
+                     pScreenInfo->iMonitor,
+                     (int) prcWorkArea->top, (int) prcWorkArea->left,
+                     (int) prcWorkArea->bottom, (int) prcWorkArea->right);
+        }
+        else {
+            ErrorF("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n",
+                   pScreenInfo->iMonitor);
+        }
+
+        /* Bail out here if we aren't using multiple monitors */
         return TRUE;
+    }
 
-    winDebug("winGetWorkArea - Original WorkArea: %d %d %d %d\n",
+    /* SPI_GETWORKAREA only gets the work area of the primary screen. */
+    SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0);
+
+    winDebug("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n",
              (int) prcWorkArea->top, (int) prcWorkArea->left,
              (int) prcWorkArea->bottom, (int) prcWorkArea->right);
 
@@ -556,16 +570,39 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
     return TRUE;
 }
 
+static Bool
+winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo * pScreenInfo)
+{
+    APPBARDATA abd;
+    HWND hwndAutoHide;
+
+    ZeroMemory(&abd, sizeof(abd));
+    abd.cbSize = sizeof(abd);
+    abd.uEdge = uEdge;
+
+    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
+    if (hwndAutoHide != NULL) {
+        /*
+           Found an autohide taskbar on that edge, but is it on the
+           same monitor as the screen window?
+         */
+        if (pScreenInfo->fMultipleMonitors ||
+            (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) ==
+             pScreenInfo->hMonitor))
+            return TRUE;
+    }
+    return FALSE;
+}
+
 /*
  * Adjust the client area so that any auto-hide toolbars
  * will work correctly.
  */
 
 static Bool
-winAdjustForAutoHide(RECT * prcWorkArea)
+winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
 {
     APPBARDATA abd;
-    HWND hwndAutoHide;
 
     winDebug("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n",
              (int) prcWorkArea->top, (int) prcWorkArea->left,
@@ -577,34 +614,31 @@ winAdjustForAutoHide(RECT * prcWorkArea)
     if (SHAppBarMessage(ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
         winDebug("winAdjustForAutoHide - Taskbar is auto hide\n");
 
+    /*
+       Despite the forgoing, we are checking for any AppBar
+       hiding along a monitor edge, not just the Windows TaskBar.
+     */
+
     /* Look for a TOP auto-hide taskbar */
-    abd.uEdge = ABE_TOP;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
         prcWorkArea->top += 1;
     }
 
     /* Look for a LEFT auto-hide taskbar */
-    abd.uEdge = ABE_LEFT;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
         prcWorkArea->left += 1;
     }
 
     /* Look for a BOTTOM auto-hide taskbar */
-    abd.uEdge = ABE_BOTTOM;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
         prcWorkArea->bottom -= 1;
     }
 
     /* Look for a RIGHT auto-hide taskbar */
-    abd.uEdge = ABE_RIGHT;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
-    if (hwndAutoHide != NULL) {
+    if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo)) {
         winDebug("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
         prcWorkArea->right -= 1;
     }
@@ -613,14 +647,5 @@ winAdjustForAutoHide(RECT * prcWorkArea)
              (int) prcWorkArea->top, (int) prcWorkArea->left,
              (int) prcWorkArea->bottom, (int) prcWorkArea->right);
 
-#if 0
-    /* Obtain the task bar window dimensions */
-    abd.hWnd = hwndAutoHide;
-    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETTASKBARPOS, &abd);
-    winDebug("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n",
-             hwndAutoHide, abd.hWnd,
-             abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right);
-#endif
-
     return TRUE;
 }
diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c
index 26e20b7..4732410 100644
--- a/hw/xwin/winmonitors.c
+++ b/hw/xwin/winmonitors.c
@@ -48,6 +48,7 @@ getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data)
         data->monitorOffsetY = rect->top;
         data->monitorHeight = rect->bottom - rect->top;
         data->monitorWidth = rect->right - rect->left;
+        data->monitorHandle = hMonitor;
         return FALSE;
     }
     return TRUE;
diff --git a/hw/xwin/winmonitors.h b/hw/xwin/winmonitors.h
index acef482..8201e47 100644
--- a/hw/xwin/winmonitors.h
+++ b/hw/xwin/winmonitors.h
@@ -1,3 +1,31 @@
+/*
+
+Copyright 1993, 1998  The Open Group
+Copyright (C) Colin Harrison 2005-2008
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
 
 /* data returned for monitor information */
 struct GetMonitorInfoData {
@@ -9,6 +37,7 @@ struct GetMonitorInfoData {
     int monitorOffsetY;
     int monitorHeight;
     int monitorWidth;
+    HMONITOR monitorHandle;
 };
 
 Bool QueryMonitor(int index, struct GetMonitorInfoData *data);
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index caa2708..72fbf14 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -115,6 +115,7 @@ winInitializeScreenDefaults(void)
     }
 
     defaultScreenInfo.iMonitor = 1;
+    defaultScreenInfo.hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
     defaultScreenInfo.dwWidth = dwWidth;
     defaultScreenInfo.dwHeight = dwHeight;
     defaultScreenInfo.dwUserWidth = dwWidth;
@@ -333,6 +334,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                 g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE;
                 g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
                 g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                 g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth;
                 g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight;
                 g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth;
@@ -383,6 +385,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                     }
                     else if (data.bMonitorSpecifiedExists == TRUE) {
                         g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                        g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                         g_ScreenInfo[nScreenNum].dwInitialX +=
                             data.monitorOffsetX;
                         g_ScreenInfo[nScreenNum].dwInitialY +=
@@ -415,6 +418,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
                                   iMonitor);
                     g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
                     g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+                    g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
                     g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX;
                     g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY;
                 }
commit 090856b55b5895ce07f36ddebe6d8f7cb86c1826
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 5 13:19:02 2012 +0100

    hw/xwin: Tidy up some pointless output which is always emitted
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
index c1a6e70..480e3bd 100644
--- a/hw/xwin/winblock.c
+++ b/hw/xwin/winblock.c
@@ -58,7 +58,7 @@ winBlockHandler(ScreenPtr pScreen,
     if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) {
         int iReturn;
 
-        winDebug("winBlockHandler - Releasing pmServerStarted\n");
+        ErrorF("winBlockHandler - pthread_mutex_unlock()\n");
 
         /* Flag that modules are to be started */
         pScreenPriv->fServerStarted = TRUE;
diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
index 696d9e2..304e6df 100644
--- a/hw/xwin/winclipboardinit.c
+++ b/hw/xwin/winclipboardinit.c
@@ -58,7 +58,7 @@ extern HWND g_hwndClipboard;
 Bool
 winInitClipboard(void)
 {
-    ErrorF("winInitClipboard ()\n");
+    winDebug("winInitClipboard ()\n");
 
     /* Wrap some internal server functions */
     if (ProcVector[X_SetSelectionOwner] != winProcSetSelectionOwner) {
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 181cb72..47bd50f 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -103,7 +103,7 @@ winClipboardProc(void *pvNotUsed)
     char szDisplay[512];
     int iSelectError;
 
-    ErrorF("winClipboardProc - Hello\n");
+    winDebug("winClipboardProc - Hello\n");
     ++clipboardRestarts;
 
     /* Do we have Unicode support? */
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
index 53b419e..882edc1 100644
--- a/hw/xwin/winclipboardwrappers.c
+++ b/hw/xwin/winclipboardwrappers.c
@@ -90,7 +90,7 @@ winProcEstablishConnection(ClientPtr client)
     static unsigned long s_ulServerGeneration = 0;
 
     if (s_iCallCount == 0)
-        ErrorF("winProcEstablishConnection - Hello\n");
+        winDebug("winProcEstablishConnection - Hello\n");
 
     /* Do nothing if clipboard is not enabled */
     if (!g_fClipboard) {
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index c355e89..66ced75 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -380,21 +380,21 @@ InitQueue(WMMsgQueuePtr pQueue)
     pQueue->nQueueSize = 0;
 
 #if CYGMULTIWINDOW_DEBUG
-    ErrorF("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
-           QueueSize(pQueue));
+    winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize,
+             QueueSize(pQueue));
 #endif
 
-    ErrorF("InitQueue - Calling pthread_mutex_init\n");
+    winDebug("InitQueue - Calling pthread_mutex_init\n");
 
     /* Create synchronization objects */
     pthread_mutex_init(&pQueue->pmMutex, NULL);
 
-    ErrorF("InitQueue - pthread_mutex_init returned\n");
-    ErrorF("InitQueue - Calling pthread_cond_init\n");
+    winDebug("InitQueue - pthread_mutex_init returned\n");
+    winDebug("InitQueue - Calling pthread_cond_init\n");
 
     pthread_cond_init(&pQueue->pcNotEmpty, NULL);
 
-    ErrorF("InitQueue - pthread_cond_init returned\n");
+    winDebug("InitQueue - pthread_cond_init returned\n");
 
     return TRUE;
 }
@@ -802,7 +802,7 @@ winMultiWindowXMsgProc(void *pArg)
     int iReturn;
     XIconSize *xis;
 
-    ErrorF("winMultiWindowXMsgProc - Hello\n");
+    winDebug("winMultiWindowXMsgProc - Hello\n");
 
     /* Check that argument pointer is not invalid */
     if (pProcArg == NULL) {
@@ -1172,7 +1172,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
     char pszDisplay[512];
     int iReturn;
 
-    ErrorF("winInitMultiWindowWM - Hello\n");
+    winDebug("winInitMultiWindowWM - Hello\n");
 
     /* Check that argument pointer is not invalid */
     if (pProcArg == NULL) {
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index b9114bf..caa2708 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -159,7 +159,7 @@ winInitializeScreenDefaults(void)
 static void
 winInitializeScreen(int i)
 {
-    winErrorFVerb(2, "winInitializeScreen - %d\n", i);
+    winErrorFVerb(3, "winInitializeScreen - %d\n", i);
 
     /* Initialize default screen values, if needed */
     winInitializeScreenDefaults();
@@ -176,7 +176,7 @@ winInitializeScreens(int maxscreens)
 {
     int i;
 
-    winErrorFVerb(2, "winInitializeScreens - %i\n", maxscreens);
+    winErrorFVerb(3, "winInitializeScreens - %i\n", maxscreens);
 
     if (maxscreens > g_iNumScreens) {
         /* Reallocate the memory for DDX-specific screen info */
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 5f112f9..be25f12 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -432,7 +432,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
     if (pScreen->a) { \
         pScreenPriv->a = pScreen->a; \
     } else { \
-        ErrorF("null screen fn " #a "\n"); \
+        winDebug("winScreenInit - null screen fn " #a "\n"); \
         pScreenPriv->a = NULL; \
     }
 
@@ -466,7 +466,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
     if (pScreen->a) { \
         pScreenPriv->a = pScreen->a; \
     } else { \
-        ErrorF("null screen fn " #a "\n"); \
+        winDebug("null screen fn " #a "\n"); \
         pScreenPriv->a = NULL; \
     }
 
commit 9fe9c5f868886abf671b3be3964af1965dd92472
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Feb 13 18:52:52 2011 +0000

    hw/xwin: Don't bother reporting XORG_VERSION_CURRENT
    
    Don't bother reporting XORG_VERSION_CURRENT, when we also
    report the version number broken down into it's components
    XORG_VERSION_MAJOR, XORG_VERSION_MINOR, etc. as well.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index a25307c..56c1e34 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -111,7 +111,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...)
 #define MESSAGEBOXF \
 	"%s\n" \
 	"Vendor: %s\n" \
-	"Release: %d.%d.%d.%d (%d)\n" \
+	"Release: %d.%d.%d.%d\n" \
 	"Contact: %s\n" \
 	"%s\n\n" \
 	"XWin was started with the following command-line:\n\n" \
@@ -120,7 +120,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...)
     size = asprintf(&pszMsgBox, MESSAGEBOXF,
                     pszErrorF, XVENDORNAME,
                     XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH,
-                    XORG_VERSION_SNAP, XORG_VERSION_CURRENT,
+                    XORG_VERSION_SNAP,
                     BUILDERADDR, BUILDERSTRING, g_pszCommandLine);
 
     if (size == -1) {
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 0f789f0..b9114bf 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -1158,9 +1158,8 @@ winLogVersionInfo(void)
 
     ErrorF("Welcome to the XWin X Server\n");
     ErrorF("Vendor: %s\n", XVENDORNAME);
-    ErrorF("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR,
-           XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP,
-           XORG_VERSION_CURRENT);
+    ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR,
+           XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP);
     ErrorF("%s\n\n", BUILDERSTRING);
     ErrorF("Contact: %s\n", BUILDERADDR);
 }
commit d5977e5bd2c8ee77db08d5f948f266c9661b9fb5
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Jul 13 00:28:19 2012 +1000

    xf86: include xf86platformBus.h in xf86AutoConfig.c
    
    This fixes an implicit declaration,
    xf86AutoConfig.c:202:5: error: implicit declaration of function 'xf86PlatformMatchDriver' [-Werror=implicit-function-declaration]
    xf86AutoConfig.c:202:5: warning: nested extern declaration of 'xf86PlatformMatchDriver' [-Wnested-externs]
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 271ce86..95d58fe 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -39,6 +39,7 @@
 #include "xf86Config.h"
 #include "xf86Priv.h"
 #include "xf86_OSlib.h"
+#include "xf86platformBus.h"
 #include "xf86pciBus.h"
 #ifdef __sparc__
 #include "xf86sbusBus.h"
commit afa3b9ccd27ff9c58f536cb3b727e85feb6a6f6a
Author: Bartosz Brachaczek <b.brachaczek at gmail.com>
Date:   Fri Jul 6 02:52:40 2012 +0200

    glx: Fix checking GL version
    
    Signed-off-by: Bartosz Brachaczek <b.brachaczek at gmail.com>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Signed-off-by: Dave Airlie <airlied at gmail.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 4e00673..bce1bfa 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -486,7 +486,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
      * don't support OpenGL 3.2 may fail the request for a core profile.
      */
     if (*api == __DRI_API_OPENGL_CORE
-        && (*major_ver < 3 || (*major_ver < 3 && *minor_ver < 2))) {
+        && (*major_ver < 3 || (*major_ver == 3 && *minor_ver < 2))) {
         *api = __DRI_API_OPENGL;
     }
 
commit 743ccf6fa0a9a4579d6de6d10e2e6040640772d9
Author: Dave Airlie <airlied at gmail.com>
Date:   Thu Jul 12 19:09:15 2012 +1000

    glx/dri2: don't return NULL in a function with no return.
    
    Reported by gcc.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 897eb59..4e00673 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -521,7 +521,7 @@ create_driver_context(__GLXDRIcontext * context,
                                           &major_ver, &minor_ver,
                                           &flags, &api, &reset,
                                           (unsigned *) error))
-                return NULL;
+                return;
 
             ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
             ctx_attribs[num_ctx_attribs++] = major_ver;
commit d1a00c26becdc2490ab4660abf108eca09c30d23
Author: Dave Airlie <airlied at gmail.com>
Date:   Thu Jul 12 19:05:41 2012 +1000

    glx/dri2: use correct define from dri attribs.
    
    Looks like idr renamed this and pushed the wrong one.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 599d0ef..897eb59 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -540,7 +540,7 @@ create_driver_context(__GLXDRIcontext * context,
 #ifdef __DRI2_ROBUSTNESS
             if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
                 ctx_attribs[num_ctx_attribs++] =
-                    __DRI_CTX_ATTRIB_RESET_NOTIFICATION;
+                    __DRI_CTX_ATTRIB_RESET_STRATEGY;
                 ctx_attribs[num_ctx_attribs++] = reset;
             }
 #endif
commit c62205adcd48d497450655d0136f8ca5bd5cbae7
Author: Dave Airlie <airlied at gmail.com>
Date:   Thu Jul 12 19:04:13 2012 +1000

    glx/dri2: fix incorrect == vs =
    
    glxdri2.c:486: warning: statement with no effect
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index f168d6f..599d0ef 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -487,7 +487,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
      */
     if (*api == __DRI_API_OPENGL_CORE
         && (*major_ver < 3 || (*major_ver < 3 && *minor_ver < 2))) {
-        *api == __DRI_API_OPENGL;
+        *api = __DRI_API_OPENGL;
     }
 
     *error = Success;
commit defca4c192bd7f4af2b273c7cb1fe8665888772a
Author: Dave Airlie <airlied at gmail.com>
Date:   Thu Jul 12 18:52:34 2012 +1000

    glx/dri2: fix typo in the notification reset for robustness.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index f3e26b7..f168d6f 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -538,7 +538,7 @@ create_driver_context(__GLXDRIcontext * context,
             }
 
 #ifdef __DRI2_ROBUSTNESS
-            if (reset != __DRI_CTX_NO_RESET_NOTIFICATION) {
+            if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
                 ctx_attribs[num_ctx_attribs++] =
                     __DRI_CTX_ATTRIB_RESET_NOTIFICATION;
                 ctx_attribs[num_ctx_attribs++] = reset;
commit d1cae6bb804f7dfc889fd3c5d5eb116f4baf5149
Author: Dave Airlie <airlied at gmail.com>
Date:   Thu Jul 12 18:51:52 2012 +1000

    glx: pass screen into the convert function
    
    when robustness is enabled, this is required.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index be5afbc..f3e26b7 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -393,7 +393,8 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
 }
 
 static Bool
-dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
+dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
+                         const uint32_t *attribs,
                          unsigned *major_ver, unsigned *minor_ver,
                          uint32_t *flags, int *api, int *reset, unsigned *error)
 {
@@ -516,7 +517,7 @@ create_driver_context(__GLXDRIcontext * context,
         int api;
 
         if (num_attribs != 0) {
-            if (!dri2_convert_glx_attribs(num_attribs, attribs,
+            if (!dri2_convert_glx_attribs(screen, num_attribs, attribs,
                                           &major_ver, &minor_ver,
                                           &flags, &api, &reset,
                                           (unsigned *) error))
commit ea74e381ae91f45ec195a5505262e2e5a3c0e1c9
Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Jul 13 00:47:24 2012 +1000

    xtest: add extinit.h for SyncExtensionInit
    
    This adds the decl for SyncExtenionInit.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Tested-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/xtest.c b/test/xtest.c
index 402d9ce..e5e5241 100644
--- a/test/xtest.c
+++ b/test/xtest.c
@@ -30,6 +30,7 @@
 #include "inputstr.h"
 #include "scrnintstr.h"
 #include "exevents.h"
+#include "extinit.h"
 #include "xkbsrv.h"
 #include "xserver-properties.h"
 #include "syncsrv.h"
commit 746193a7f10f11cccae05c98b933aadf58fc7375
Merge: a2d0829 2b74949
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jul 12 15:10:51 2012 -0700

    Merge remote-tracking branch 'jturney/xwin-extmod-removal-fixes'

commit a2d0829531249e24dbca25fc20ed30a2bb2d8ed8
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jul 12 13:16:37 2012 +0200

    glx: Free DRI2 drawable reference to destroyed GLX drawable.
    
    Otherwise the reference can lead to use after free in
    __glXDRIinvalidateBuffers().
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019
    
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 909de70..be5afbc 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -106,6 +106,7 @@ struct __GLXDRIdrawable {
     int height;
     __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
     int count;
+    XID dri2_id;
 };
 
 static void
@@ -114,6 +115,8 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable)
     __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
     const __DRIcoreExtension *core = private->screen->core;
 
+    FreeResource(private->dri2_id, FALSE);
+
     (*core->destroyDrawable) (private->driDrawable);
 
     __glXDrawableRelease(drawable);
@@ -670,8 +673,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
     private->base.waitGL = __glXDRIdrawableWaitGL;
     private->base.waitX = __glXDRIdrawableWaitX;
 
-    if (DRI2CreateDrawable(client, pDraw, drawId,
-                           __glXDRIinvalidateBuffers, private)) {
+    if (DRI2CreateDrawable2(client, pDraw, drawId,
+                            __glXDRIinvalidateBuffers, private,
+                            &private->dri2_id)) {
         free(private);
         return NULL;
     }
commit 8a87acc9e57be740e3bd252567622246051a0723
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jul 12 13:16:36 2012 +0200

    dri2: Add DRI2CreateDrawable2.
    
    Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the
    DRI2 drawable reference to the base drawable.
    
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 2ea0c33..63feed5 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -333,8 +333,9 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
 }
 
 int
-DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
-                   DRI2InvalidateProcPtr invalidate, void *priv)
+DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id,
+                    DRI2InvalidateProcPtr invalidate, void *priv,
+                    XID *dri2_id_out)
 {
     DRI2DrawablePtr pPriv;
     DRI2ClientPtr dri2_client = dri2ClientPrivate(client);
@@ -354,9 +355,19 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
     if (rc != Success)
         return rc;
 
+    if (dri2_id_out)
+        *dri2_id_out = dri2_id;
+
     return Success;
 }
 
+int
+DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
+                   DRI2InvalidateProcPtr invalidate, void *priv)
+{
+    return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL);
+}
+
 static int
 DRI2DrawableGone(pointer p, XID id)
 {
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index da7825e..1e7afdd 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -274,6 +274,13 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
                                         DRI2InvalidateProcPtr invalidate,
                                         void *priv);
 
+extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
+                                         DrawablePtr pDraw,
+                                         XID id,
+                                         DRI2InvalidateProcPtr invalidate,
+                                         void *priv,
+                                         XID *dri2_id_out);
+
 extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
                                                int *width,
                                                int *height,
commit 2b74949ad02bd916c3ac502db3f28057f12a8117
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 12 00:36:43 2012 +0100

    Restore GLX extension to XWin
    
    - Add an XwinExtensionInit(), similar in spirit to QuartzExtensionInit()
    and xf86ExtensionInit()
    - Load the GLX extension (I'm guessing XQuartz needs this adding somewhere
    as well)
    - Also, since we now have a proper place to install the native GL provider
    where it will take priority over the the swrast provider, do so
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 4d0df11..538b2e1 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -147,15 +147,30 @@ winClipboardShutdown(void)
 }
 #endif
 
-void
-ddxPushProviders(void)
+static const ExtensionModule xwinExtensions[] = {
+#ifdef GLXEXT
+  { GlxExtensionInit, "GLX", &noGlxExtension },
+#endif
+};
+
+/*
+ * XwinExtensionInit
+ * Initialises Xwin-specific extensions.
+ */
+static
+void XwinExtensionInit(void)
 {
+    int i;
+
 #ifdef XWIN_GLX_WINDOWS
-    if (g_fNativeGl) {
+    if ((g_fNativeGl) && (serverGeneration == 1)) {
         /* install the native GL provider */
         glxWinPushNativeProvider();
     }
 #endif
+
+    for (i = 0; i < ARRAY_SIZE(xwinExtensions); i++)
+        LoadExtension(&xwinExtensions[i], TRUE);
 }
 
 #if defined(DDXBEFORERESET)
@@ -885,6 +900,8 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
 {
     int i;
 
+    XwinExtensionInit();
+
     /* Log the command line */
     winLogCommandLine(argc, argv);
 
commit 656e5fea6c9ca15f932889edcc590dd01c881945
Merge: 8b820f2 1720cd9
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jul 12 08:26:35 2012 -0700

    Merge remote-tracking branch 'jeremyhu/master'

commit 8b820f221ad54eb96a16c7060048abc8824371b6
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 11 17:31:53 2012 +0100

    sdksyms: Fix build with --disable-xv
    
    I hate this [redacted] script.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Tested-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index c0398da..07372ad 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -46,8 +46,10 @@ cat > sdksyms.c << EOF
 #include "misyncstr.h"
 
 /* Xext/Makefile.am -- half is module, half is builtin */
+#ifdef XV
 #include "xvdix.h"
 #include "xvmcext.h"
+#endif
 #include "geext.h"
 #include "geint.h"
 #ifdef MITSHM
commit 06ac7937fc37cdf073b77386bed47e14cff23628
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 12 12:37:05 2012 +0100

    Restore extern to the declaration of __glXDRISWRastProvider
    
    b86aa74 dropped the 'extern' from the declaration of __glXDRISWRastProvider
    
    This turns out to be important to me, as without it, the final link only gets
    the tentative definition of __glXDRISWRastProvider implied by the declaration,
    and not the proper one from glxdriswrast.c, presumably because nothing else
    references anything in the object that file generates.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/glx/glxserver.h b/glx/glxserver.h
index d9b106b..1021aec 100644
--- a/glx/glxserver.h
+++ b/glx/glxserver.h
@@ -97,7 +97,7 @@ struct __GLXprovider {
     const char *name;
     __GLXprovider *next;
 };
-__GLXprovider __glXDRISWRastProvider;
+extern __GLXprovider __glXDRISWRastProvider;
 
 void GlxPushProvider(__GLXprovider * provider);
 
commit bcbf95b1bafa6ffe724768b9309295e2fdb4b860
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jul 12 00:36:10 2012 +0100

    Revert bogus GlxPushProvider() in commit a1d41e3
    
    a1d41e3 "Move extension initialisation prototypes into extinit.h"
    also includes a change to GlxExtensionInit to install the swrast GLX
    provider.
    
    Since b86aa74 "GLX: Insert swrast provider from GlxExtensionInit"
    already does this (correctly, by installing the swrast provider
    at the end of the chain, rather than at the beginning), and since this
    would seem to have the effect of making the swrast provider the most
    preferred provider, I'm guessing this wasn't intended.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/glx/glxext.c b/glx/glxext.c
index a1f9d42..70f0df8 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -339,9 +339,6 @@ GlxExtensionInit(void)
     if (!__glXContextRes || !__glXDrawableRes)
         return;
 
-    if (serverGeneration == 1)
-        GlxPushProvider(&__glXDRISWRastProvider);
-
     if (!dixRegisterPrivateKey
         (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
         return;


More information about the Xquartz-changes mailing list