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

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Mar 21 21:57:05 PDT 2010


Rebased ref, commits from common ancestor:
commit ed31d50b5f7f25e4db986711699704e615b8afcb
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:24:27 2010 -0700

    XQuartz: Constrain the pointer to the updated display bounds on display reconfigure.
    
    http://xquartz.macosforge.org/trac/ticket/346

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 3c04205..59107be 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -241,6 +241,7 @@ void QuartzUpdateScreens(void) {
     WindowPtr pRoot;
     int x, y, width, height, sx, sy;
     xEvent e;
+    BoxRec bounds;
     
     if (noPseudoramiXExtension || screenInfo.numScreens != 1)
     {
@@ -277,8 +278,16 @@ void QuartzUpdateScreens(void) {
     //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
 
-//  TODO: This is a noop in 1.6 and nuked in master... we may need to do something else now to handle it
-//    DefineInitialRootWindow(pRoot);
+    /* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration
+     * http://xquartz.macosforge.org/trac/ticket/346
+     */
+    bounds.x1 = 0;
+    bounds.x2 = width;
+    bounds.y1 = 0;
+    bounds.y2 = height;
+    pScreen->ConstrainCursor(inputInfo.pointer, pScreen, &bounds);
+    inputInfo.pointer->spriteInfo->sprite->physLimits = bounds;
+    inputInfo.pointer->spriteInfo->sprite->hotLimits = bounds;
 
     DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
 
commit 927480be12ff61deb4e8120d2f90ddef3a1a6beb
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 11:03:28 2010 -0700

    XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 02da6b2..1886642 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,5 +1,7 @@
-AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-AM_CFLAGS=$(XPBPROXY_CFLAGS)
+AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
+	-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
+
+AM_CFLAGS=$(XPBPROXY_CFLAGS) 
 
 noinst_LTLIBRARIES = libxpbproxy.la
 libxpbproxy_la_SOURCES = \
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index b30dfb8..b00e90a 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -34,7 +34,7 @@
 #include <unistd.h> /*for getpid*/
 #include <Cocoa/Cocoa.h>
 
-static const char *app_prefs_domain = "org.x.X11";
+static const char *app_prefs_domain = 	LAUNCHD_ID_PREFIX".xpbproxy";
 CFStringRef app_prefs_domain_cfstr;
 
 /* Stubs */
@@ -73,7 +73,7 @@ int main (int argc, const char *argv[]) {
             printf("usage: xpbproxy OPTIONS\n"
                    "Pasteboard proxying for X11.\n\n"
                    "--prefs-domain <domain>   Change the domain used for reading preferences\n"
-                   "                          (default: org.x.X11)\n");
+                   "                          (default: %s)\n", app_prefs_domain);
             return 0;
         } else {
             fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
commit d16bc8a3cdbe0e8b9cba836c7aa2ff7c0458049e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 03:28:57 2010 -0700

    XQuartz: xpbproxy: Cleanup xpbproxy threading
    
    Confine xpbproxy to a single thread
    Runs inside its own CFRunLoop
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3faa1cb..5406640 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -52,7 +52,7 @@
 #include <Xplugin.h>
 
 // pbproxy/pbproxy.h
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 #define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist"
 
@@ -908,6 +908,26 @@ environment the next time you start X11?", @"Startup xinitrc dialog");
     [X11App prefs_synchronize];
 }
 
+static inline pthread_t create_thread(void *func, void *arg) {
+    pthread_attr_t attr;
+    pthread_t tid;
+    
+    pthread_attr_init(&attr);
+    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+    pthread_create(&tid, &attr, func, arg);
+    pthread_attr_destroy(&attr);
+    
+    return tid;
+}
+
+static void *xpbproxy_x_thread(void *args) {
+    xpbproxy_run();
+
+    fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n");
+    return NULL;
+}
+
 void X11ApplicationMain (int argc, char **argv, char **envp) {
     NSAutoreleasePool *pool;
 
@@ -962,8 +982,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
      */
     check_xinitrc();
     
-    if(!xpbproxy_init())
-        fprintf(stderr, "Error initializing xpbproxy\n");
+    create_thread(xpbproxy_x_thread, NULL);
 
 #if XQUARTZ_SPARKLE
     [[X11App controller] setup_sparkle];
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index f3f683a..b30dfb8 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -84,16 +84,10 @@ int main (int argc, const char *argv[]) {
     
     app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
     
-    if(!xpbproxy_init())
-        return EXIT_FAILURE;
-    
     signal (SIGINT, signal_handler);
     signal (SIGTERM, signal_handler);
     signal (SIGHUP, signal_handler);
     signal (SIGPIPE, SIG_IGN);
 
-    [NSApplication sharedApplication];
-    [NSApp run];
-    
-    return EXIT_SUCCESS;
+    return xpbproxy_run();
 }
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index d26b1b1..560cf01 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -82,25 +82,12 @@ static int x_error_handler (Display *dpy, XErrorEvent *errevent) {
     return 0;
 }
 
-static inline pthread_t create_thread(void *func, void *arg) {
-    pthread_attr_t attr;
-    pthread_t tid;
-    
-    pthread_attr_init(&attr);
-    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    pthread_create(&tid, &attr, func, arg);
-    pthread_attr_destroy(&attr);
-    
-    return tid;
-}
-
-static void *xpbproxy_x_thread(void *args) {
+int xpbproxy_run (void) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     size_t i;
-
+    
     wait_for_server_init();
-
+    
     for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
         xpbproxy_dpy = XOpenDisplay(NULL);
         
@@ -108,7 +95,7 @@ static void *xpbproxy_x_thread(void *args) {
             char _display[32];
             snprintf(_display, sizeof(_display), ":%s", display);
             setenv("DISPLAY", _display, TRUE);
-
+            
             xpbproxy_dpy=XOpenDisplay(_display);
         }
         if(!xpbproxy_dpy)
@@ -118,7 +105,7 @@ static void *xpbproxy_x_thread(void *args) {
     if (xpbproxy_dpy == NULL) {
         fprintf (stderr, "xpbproxy: can't open default display\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
     
     XSetIOErrorHandler (x_io_error_handler);
@@ -128,11 +115,11 @@ static void *xpbproxy_x_thread(void *args) {
                                  &xpbproxy_apple_wm_error_base)) {
         fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-    
+
     xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base);
-    
+
     XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask |
                          AppleWMPasteboardNotifyMask);
     
@@ -140,18 +127,14 @@ static void *xpbproxy_x_thread(void *args) {
     
     if(!xpbproxy_input_register()) {
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-
+    
     [pool release];
- 
-    xpbproxy_input_loop();
-    return NULL;
-}
+    
+    CFRunLoopRun();
 
-BOOL xpbproxy_init (void) {
-    create_thread(xpbproxy_x_thread, NULL);
-    return TRUE;
+    return EXIT_SUCCESS;
 }
 
 id xpbproxy_selection_object (void) {
diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h
index a6798ef..013f981 100644
--- a/hw/xquartz/pbproxy/pbproxy.h
+++ b/hw/xquartz/pbproxy/pbproxy.h
@@ -67,7 +67,7 @@ extern void xpbproxy_set_is_active (BOOL state);
 extern BOOL xpbproxy_get_is_active (void);
 extern id xpbproxy_selection_object (void);
 extern Time xpbproxy_current_timestamp (void);
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 extern Display *xpbproxy_dpy;
 extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
@@ -76,7 +76,6 @@ extern BOOL xpbproxy_have_xfixes;
 
 /* from x-input.m */
 extern BOOL xpbproxy_input_register (void);
-extern void xpbproxy_input_loop();
 
 #ifdef DEBUG
 /* BEWARE: this can cause a string memory leak, according to the leaks program. */
diff --git a/hw/xquartz/pbproxy/x-input.m b/hw/xquartz/pbproxy/x-input.m
index 6ba30c6..405ba3c 100644
--- a/hw/xquartz/pbproxy/x-input.m
+++ b/hw/xquartz/pbproxy/x-input.m
@@ -39,17 +39,12 @@
 
 #include <unistd.h>
 
-#include <pthread.h>
-
 static CFRunLoopSourceRef xpbproxy_dpy_source;
 
 #ifdef STANDALONE_XPBPROXY
 BOOL xpbproxy_prefs_reload = NO;
 #endif
 
-static pthread_mutex_t xpbproxy_dpy_rdy_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t xpbproxy_dpy_rdy_cond = PTHREAD_COND_INITIALIZER;
-
 /* Timestamp when the X server last told us it's active */
 static Time last_activation_time;
 
@@ -88,58 +83,51 @@ static void x_event_apple_wm_notify(XAppleWMNotifyEvent *e) {
     }
 }
 
-void xpbproxy_input_loop() {
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    while(true) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+static void xpbproxy_process_xevents(void) {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    
+    if(pool == nil) {
+        fprintf(stderr, "unable to allocate/init auto release pool!\n");
+        return;
+    }
+    
+    while (XPending(xpbproxy_dpy) != 0) {
+        XEvent e;
         
-        if(pool == nil) {
-            fprintf(stderr, "unable to allocate/init auto release pool!\n");
-            break;
-        }
+        XNextEvent (xpbproxy_dpy, &e);
         
-        while (XPending(xpbproxy_dpy) != 0) {
-            XEvent e;
-            
-            pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
-            XNextEvent (xpbproxy_dpy, &e);
-            
-            switch (e.type) {                
-                case SelectionClear:
-                    if([xpbproxy_selection_object() is_active])
-                        [xpbproxy_selection_object () clear_event:&e.xselectionclear];
-                    break;
-                    
-                case SelectionRequest:
-                    [xpbproxy_selection_object () request_event:&e.xselectionrequest];
-                    break;
-                    
-                case SelectionNotify:
-                    [xpbproxy_selection_object () notify_event:&e.xselection];
-                    break;
-                    
-                case PropertyNotify:
-                    [xpbproxy_selection_object () property_event:&e.xproperty];
-                    break;
-                    
-                default:
-                    if(e.type >= xpbproxy_apple_wm_event_base &&
-                       e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
-                        x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
-                    } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
-                        [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
-                    }
-                    break;
-            }
-            
-            XFlush(xpbproxy_dpy);
-            pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
+        switch (e.type) {                
+            case SelectionClear:
+                if([xpbproxy_selection_object() is_active])
+                    [xpbproxy_selection_object () clear_event:&e.xselectionclear];
+                break;
+                
+            case SelectionRequest:
+                [xpbproxy_selection_object () request_event:&e.xselectionrequest];
+                break;
+                
+            case SelectionNotify:
+                [xpbproxy_selection_object () notify_event:&e.xselection];
+                break;
+                
+            case PropertyNotify:
+                [xpbproxy_selection_object () property_event:&e.xproperty];
+                break;
+                
+            default:
+                if(e.type >= xpbproxy_apple_wm_event_base &&
+                   e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
+                    x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
+                } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
+                    [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
+                }
+                break;
         }
         
-        [pool release];
-        
-        pthread_cond_wait(&xpbproxy_dpy_rdy_cond, &xpbproxy_dpy_rdy_lock);
+        XFlush(xpbproxy_dpy);
     }
+    
+    [pool release];
 }
 
 static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
@@ -161,7 +149,7 @@ static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
     if (*cf_source == NULL)
         return FALSE;
     
-    CFRunLoopAddSource (CFRunLoopGetMain (),
+    CFRunLoopAddSource (CFRunLoopGetCurrent (),
                         *cf_source, kCFRunLoopDefaultMode);
     return TRUE;
 }
@@ -175,10 +163,8 @@ static void x_input_callback (CFSocketRef sock, CFSocketCallBackType type,
         xpbproxy_prefs_reload = NO;
     }
 #endif
-
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    pthread_cond_broadcast(&xpbproxy_dpy_rdy_cond);
-    pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
+    
+    xpbproxy_process_xevents();
 }
 
 BOOL xpbproxy_input_register(void) {
commit 9c9c3a85b094a3c7b2763a572715d710325091aa
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:23:12 2010 -0700

    XQuartz: Minor cleanup
    
    Move RandRInit to where it will need to be (not yet implemented)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index c4142a8..3c04205 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -166,6 +166,11 @@ void QuartzInitOutput(
         FatalError("Could not register block and wakeup handlers.");
     }
 
+#if defined(RANDR) && !defined(FAKE_RANDR)
+    if(!QuartzRandRInit(pScreen))
+        FatalError("Failed to init RandR extension.\n");
+#endif
+
     // Do display mode specific initialization
     quartzProcs->DisplayInit();
 }
@@ -259,16 +264,11 @@ void QuartzUpdateScreens(void) {
     pScreen->width = width;
     pScreen->height = height;
     
-#ifndef FAKE_RANDR
-    if(!QuartzRandRInit(pScreen))
-        FatalError("Failed to init RandR extension.\n");
-#endif
-    
     DarwinAdjustScreenOrigins(&screenInfo);
     quartzProcs->UpdateScreen(pScreen);
     
-    sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
-    sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+    sx = x + darwinMainScreenX;
+    sy = y + darwinMainScreenY;
     
     /* Adjust the root window. */
     pRoot = WindowTable[pScreen->myNum];
commit bb75d0df8b5238bfe8b011bb5737fae2a3584290
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Mar 19 15:26:50 2010 -0700

    XQuartz: GLX: Fix Availability for Tiger ppc workaround
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index c092c1d..f2af3ff 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -120,7 +120,7 @@
 /* Tiger PPC doesn't have the associated symbols, but glext.h says it does.  Liars!
  * http://trac.macports.org/ticket/20638
  */
-#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED == 1040
+#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
 #undef GL_EXT_gpu_program_parameters
 #define GL_EXT_gpu_program_parameters 0
 #endif
commit eac7cdabecafb7c505795207182ab2578d672c06
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Mar 16 11:29:08 2010 -0700

    Revert "XQuartz: Explicitly pass a bellProc to make XBell() work again."
    
    I'm not quite sure why this was necessary, but DDXRingBell is being called
    from CoreKeyboardBell, so we don't need a separate bellProc which would
    result in multiple rings.
    
    This reverts commit 9071b0d69748cfa7ecca17b4cb0e431bbb0ef2a4.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 7e36a9a..c9ef7cc 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -184,12 +184,6 @@ static void DarwinChangeKeyboardControl(DeviceIntPtr device, KeybdCtrl *ctrl) {
     // keyclick, bell volume / pitch, autorepead, LED's
 }
 
-static void DarwinKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something) {
-    KeybdCtrl *ctrl = arg;
-
-    DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration);
-}
-
 //-----------------------------------------------------------------------------
 // Utility functions to help parse Darwin keymap
 //-----------------------------------------------------------------------------
@@ -301,7 +295,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     // for a kIOHIDParamConnectType connection.
     assert(darwinParamConnect = NXOpenEventStatus());
 
-    InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
+    InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
 
     DarwinKeyboardReloadHandler();
 
commit 235fa5030428084368e5be57fca695647b7b79c4
Merge: 1c612ac... fa5103a...
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 15:38:40 2010 -0700

    Merge commit 'fa5103a02bd509e4a102afdad2ab26cb22210367'

commit 1c612acca8568fcdf9761d23f112adaf4d496f1b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 17 14:32:38 2010 +1000

    dix: if owner-events is true for passive grabs, add the window mask (#25400)
    
    A client requesting a GrabModeSync button grab, owner-events true, with only
    the ButtonRelease mask set would never receive the press event even if the
    grab window had the ButtonPress mask set.
    
    The protocol requires that if owner-events is true, then the delivery mask
    is the combination of the grab mask + the window event mask.
    
    X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Jim Ramsay <i.am at jimramsay.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 0e9bc31..6541652 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3552,6 +3552,8 @@ CheckPassiveGrabsOnWindow(
                 xE = &core;
                 count = 1;
                 mask = grab->eventMask;
+                if (grab->ownerEvents)
+                    mask |= pWin->eventMask;
             } else if (match & XI2_MATCH)
             {
                 rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3573,6 +3575,24 @@ CheckPassiveGrabsOnWindow(
                     mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
                 else if (event->type == XI_Enter || event->type == XI_FocusIn)
                     mask = grab->xi2mask[device->id][event->type/8];
+
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
+                            mask |= icp->xi2mask[device->id][evtype/8];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             } else
             {
                 rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3584,6 +3604,22 @@ CheckPassiveGrabsOnWindow(
                     continue;
                 }
                 mask = grab->eventMask;
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            mask |= icp->mask[device->id];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             }
 
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
commit 95ca39b981624df5338a16b506289014c431ae82
Merge: e7ff956... bf18191...
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Mar 21 15:24:06 2010 -0700

    Merge remote branch 'jturney/master'

commit e7ff956638780dc1c6f160a1fd041b92cebff9ac
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:36 2010 +0200

    common: xf86Configure: alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
    
    buffer_alloc: Called allocating function "realloc" which allocated memory dictated by parameter "len + strlen(displaySize_string)"
    alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
    var_assign: Assigned "ptr->mon_comment" to storage allocated by "realloc(ptr->mon_comment, len + strlen(displaySize_string))"
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index d74d90b..67bf08b 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -612,7 +612,7 @@ configureDDCMonitorSection (int screennum)
 	  len = 0;
 	}
 	if ((ptr->mon_comment =
-	     realloc(ptr->mon_comment, len+strlen(displaySize_string)))) {
+	     realloc(ptr->mon_comment, len + strlen(displaySize_string) + 1))) {
 	  strcpy(ptr->mon_comment + len, displaySize_string);
 	}
       }
commit aeae6637b52b042cf8b07c6943abcd5d31968d49
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:34 2010 +0200

    fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 24eadde..53e2ada 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -228,7 +228,11 @@ fbFinishScreenInit(ScreenPtr	pScreen,
     rootdepth = 0;
     if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
 			&defaultVisual,((unsigned long)1<<(imagebpp-1)), 8))
+    {
+	xfree (visuals);
+	xfree (depths);
 	return FALSE;
+    }
     if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
 			rootdepth, ndepths, depths,
 			defaultVisual, nvisuals, visuals))
commit d9ee31ab05efbd2d598cc93a41a8834f84d30803
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Mon Mar 15 23:46:33 2010 +0200

    exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at position 6 with index variable "i"
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa.c b/exa/exa.c
index c5ac7de..590d9a5 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -417,8 +417,8 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
 
     /* Catch unbalanced Prepare/FinishAccess calls. */
     if (i == EXA_NUM_PREPARE_INDICES)
-	EXA_FatalErrorDebug(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
-			     pPixmap));
+      EXA_FatalErrorDebugWithRet(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
+				  pPixmap),);
 
     pExaScr->access[i].pixmap = NULL;
 
commit bf181915e103b0659c5a0bc3b2f6bccb18c9ec36
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Feb 1 17:11:51 2010 +0000

    Cygwin/X: Allow the default log location to be configurable
    
    Allow the default log location to be configurable (e.g. /var/log),
    and use separate logs for each display instance (e.g. XWin.0.log).
    
    Make the type of g_pszLogFile const char*, per os/log.c:LogInit().
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/configure.ac b/configure.ac
index 3e8ea10..065016f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1829,6 +1829,7 @@ AC_MSG_RESULT([$XWIN])
 if test "x$XWIN" = xyes; then
 	PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
 	AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc])
+	AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
 	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
 	AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
 	AC_CHECK_TOOL(WINDRES, windres)
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index d8fd59f..175cd9d 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -69,7 +69,7 @@ extern int			g_iLastScreen;
 extern char *			g_pszCommandLine;
 extern Bool			g_fSilentFatalError;
 
-extern char *			g_pszLogFile;
+extern const char *		g_pszLogFile;
 extern Bool			g_fLogFileChanged;
 extern int			g_iLogVerbose;
 Bool				g_fLogInited;
@@ -244,7 +244,7 @@ ddxGiveUp (void)
 #endif
 
   if (!g_fLogInited) {
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
     g_fLogInited = TRUE;
   }  
   LogClose ();
@@ -689,9 +689,6 @@ OsVendorInit (void)
   /* Re-initialize global variables on server reset */
   winInitializeGlobals ();
 
-  LogInit (NULL, NULL);
-  LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
-
   winFixupPaths();
 
 #ifdef DDXOSVERRORF
@@ -706,7 +703,7 @@ OsVendorInit (void)
      * avoid the second call 
      */  
     g_fLogInited = TRUE;
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
   } 
   LogSetParameter (XLOG_FLUSH, 1);
   LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
@@ -927,7 +924,7 @@ ddxUseMsg(void)
 
   /* Log file will not be opened for UseMsg unless we open it now */
   if (!g_fLogInited) {
-    LogInit (g_pszLogFile, NULL);
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
     g_fLogInited = TRUE;
   }  
   LogClose ();
@@ -935,9 +932,9 @@ ddxUseMsg(void)
   /* Notify user where UseMsg text can be found.*/
   if (!g_fNoHelpMessageBox)
     winMessageBoxF ("The " PROJECT_NAME " help text has been printed to "
-		  "/tmp/XWin.log.\n"
-		  "Please open /tmp/XWin.log to read the help text.\n",
-		  MB_ICONINFORMATION);
+		  "%s.\n"
+		  "Please open %s to read the help text.\n",
+		  MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile);
 }
 
 /* See Porting Layer Definition - p. 20 */
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index 9ed27c3..191b9a9 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -41,8 +41,9 @@
 
 /* References to external symbols */
 extern char *		g_pszCommandLine;
-extern char *		g_pszLogFile;
+extern const char *	g_pszLogFile;
 extern Bool		g_fSilentFatalError;
+extern Bool		g_fLogInited;
 
 
 #ifdef DDXOSVERRORF
@@ -87,6 +88,12 @@ OsVendorFatalError (void)
   if (g_fSilentFatalError)
     return;
 
+  if (!g_fLogInited) {
+    g_fLogInited = TRUE;
+    g_pszLogFile = LogInit (g_pszLogFile, NULL);
+  }
+  LogClose ();
+
   winMessageBoxF (
           "A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \
 		  "Please open %s for more information.\n",
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 7bb4a60..926ce69 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -69,9 +69,9 @@ Bool           g_fAuthEnabled = FALSE;
 HICON		g_hIconX = NULL;
 HICON		g_hSmallIconX = NULL;
 #ifndef RELOCATE_PROJECTROOT
-char *		g_pszLogFile = "/tmp/XWin.log";
+const char *	g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log";
 #else
-char *		g_pszLogFile = "XWin.log";
+const char *	g_pszLogFile = "XWin.log";
 Bool		g_fLogFileChanged = FALSE;
 #endif
 int		g_iLogVerbose = 2;
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 159e533..66da76f 100755
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -53,7 +53,7 @@ extern Bool			g_fUnicodeClipboard;
 extern Bool			g_fClipboard;
 #endif
 extern int			g_iLogVerbose;
-extern char *			g_pszLogFile;
+extern const char *		g_pszLogFile;
 #ifdef RELOCATE_PROJECTROOT
 extern Bool			g_fLogFileChanged;
 #endif
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 4f3e895..85dc10f 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -42,7 +42,7 @@
  */
 
 extern HWND			g_hDlgExit;
-extern char *g_pszLogFile;
+extern const char *g_pszLogFile;
 
 /*
  * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in
index 21ceb29..13b51ca 100644
--- a/include/xwin-config.h.in
+++ b/include/xwin-config.h.in
@@ -32,3 +32,5 @@
 /* Location of system.XWinrc */
 #undef SYSCONFDIR
 
+/* Default log location */
+#undef DEFAULT_LOGDIR
commit cca4952d750779a4c58a11fe08a53336042930bb
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 26 14:40:30 2010 +0000

    Xming: Warning fixes
    
    Fix warnings due to prototypes not specifying function arguments
    Fix warning with RegQueryValueEx()
    Tidy up an include
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 9ab8ed9..5cda970 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -196,7 +196,7 @@
  * Windows headers
  */
 #include "winms.h"
-#include "./winresource.h"
+#include "winresource.h"
 
 
 /*
diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index fcd1872..f4c4005 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -122,7 +122,7 @@ GenerateAuthorization(
  */
 
 Bool
-winGenerateAuthorization ()
+winGenerateAuthorization (void)
 {
   Bool				fFreeAuth = FALSE;
   SecurityAuthorizationPtr	pAuth = NULL;
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index 259b3d2..b05867b 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -330,7 +330,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
         const char          regtempl[] = 
           "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
         char                *regpath;
-        char                lname[256];
+        unsigned char       lname[256];
         DWORD               namesize = sizeof(lname);
 
         regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1);
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 00572a1..7dce7e3 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -81,7 +81,7 @@ make_box (int x, int y, int w, int h)
 }
 
 void
-winWindowsWMExtensionInit ()
+winWindowsWMExtensionInit (void)
 {
   ExtensionEntry* extEntry;
 
diff --git a/os/osdep.h b/os/osdep.h
index 3d75bba..7b1c699 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -200,7 +200,7 @@ extern int *ConnectionTranslation;
 #else
 extern int GetConnectionTranslation(int conn);
 extern void SetConnectionTranslation(int conn, int client);
-extern void ClearConnectionTranslation();
+extern void ClearConnectionTranslation(void);
 #endif
  
 extern Bool NewOutputPending;
commit b8cf4153f84404b2a1b62a247d5d36d24bf481da
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 26 14:41:00 2010 +0000

    Xming: Dead code removal
    
    Remove some dead code, mostly code made obsolete by mandatory XKB
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 8b18972..fbaf092 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -109,7 +109,6 @@ SRCS =	InitInput.c \
 	winconfig.h \
 	win.h \
 	winkeybd.h \
-	winkeymap.h \
 	winkeynames.h \
 	winlayouts.h \
 	winmessages.h \
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index a423b49..ad9e66a 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -49,9 +49,6 @@ static Bool g_winKeyState[NUM_KEYCODES];
  */
 
 static void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap);
-
-static void
 winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
 	      pointer pCtrl, int iClass);
 
@@ -119,89 +116,6 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
 }
 
 
-/*
- * We call this function from winKeybdProc when we are
- * initializing the keyboard.
- */
-
-static void
-winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
-  int			i;
-  KeySym		*pMap = map;
-  KeySym		*pKeySym;
-
-  /*
-   * Initialize all key states to up... which may not be true
-   * but it is close enough.
-   */
-  ZeroMemory (g_winKeyState, sizeof (g_winKeyState[0]) * NUM_KEYCODES);
-
-  /* MAP_LENGTH is defined in Xserver/include/input.h to be 256 */
-  for (i = 0; i < MAP_LENGTH; i++)
-    pModMap[i] = NoSymbol;  /* make sure it is restored */
-
-  /* Loop through all valid entries in the key symbol table */
-  for (pKeySym = pMap, i = MIN_KEYCODE;
-       i < (MIN_KEYCODE + NUM_KEYCODES);
-       i++, pKeySym += GLYPHS_PER_KEY)
-    {
-      switch (*pKeySym)
-	{
-	case XK_Shift_L:
-	case XK_Shift_R:
-	  pModMap[i] = ShiftMask;
-	  break;
-
-	case XK_Control_L:
-	case XK_Control_R:
-	  pModMap[i] = ControlMask;
-	  break;
-
-	case XK_Caps_Lock:
-	  pModMap[i] = LockMask;
-	  break;
-
-	case XK_Alt_L:
-	case XK_Alt_R:
-	  pModMap[i] = AltMask;
-	  break;
-
-	case XK_Num_Lock:
-	  pModMap[i] = NumLockMask;
-	  break;
-
-	case XK_Scroll_Lock:
-	  pModMap[i] = ScrollLockMask;
-	  break;
-
-#if 0
-	case XK_Super_L:
-	case XK_Super_R:
-	  pModMap[i] = Mod4Mask;
-	  break;
-#else
-	/* Hirigana/Katakana toggle */
-	case XK_Kana_Lock:
-	case XK_Kana_Shift:
-	  pModMap[i] = KanaMask;
-	  break;
-#endif
-
-	/* alternate toggle for multinational support */
-	case XK_Mode_switch:
-	  pModMap[i] = AltLangMask;
-	  break;
-	}
-    }
-
-  pKeySyms->map        = (KeySym *) pMap;
-  pKeySyms->mapWidth   = GLYPHS_PER_KEY;
-  pKeySyms->minKeyCode = MIN_KEYCODE;
-  pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-
 /* Ring the keyboard bell (system speaker on PCs) */
 static void
 winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index d0d6b9c..5b2a589 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -35,14 +35,6 @@
  */
 #include "winkeynames.h"
 
-
-/*
- * Include the standard ASCII keymap.
- *
- * This header declares a static KeySym array called 'map'.
- */
-#include "winkeymap.h"
-
 #define		WIN_KEYMAP_COLS		3
 
 /* Rows 160 through 165 correspond to software-generated codes, which
diff --git a/hw/xwin/winkeymap.h b/hw/xwin/winkeymap.h
deleted file mode 100644
index 3862f03..0000000
--- a/hw/xwin/winkeymap.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * For Scancodes see notes in winkeynames.h  !!!!
- *
- */
-
-static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
-    /* 0x00 */  NoSymbol,       NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x01 */  XK_Escape,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x02 */  XK_1,           XK_exclam,	NoSymbol,	NoSymbol,
-    /* 0x03 */  XK_2,           XK_at,		NoSymbol,	NoSymbol,
-    /* 0x04 */  XK_3,           XK_numbersign,	NoSymbol,	NoSymbol,
-    /* 0x05 */  XK_4,           XK_dollar,	NoSymbol,	NoSymbol,
-    /* 0x06 */  XK_5,           XK_percent,	NoSymbol,	NoSymbol,
-    /* 0x07 */  XK_6,           XK_asciicircum,	NoSymbol,	NoSymbol,
-    /* 0x08 */  XK_7,           XK_ampersand,	NoSymbol,	NoSymbol,
-    /* 0x09 */  XK_8,           XK_asterisk,	NoSymbol,	NoSymbol,
-    /* 0x0a */  XK_9,           XK_parenleft,	NoSymbol,	NoSymbol,
-    /* 0x0b */  XK_0,           XK_parenright,	NoSymbol,	NoSymbol,
-    /* 0x0c */  XK_minus,       XK_underscore,	NoSymbol,	NoSymbol,
-    /* 0x0d */  XK_equal,       XK_plus,	NoSymbol,	NoSymbol,
-    /* 0x0e */  XK_BackSpace,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x0f */  XK_Tab,         XK_ISO_Left_Tab,NoSymbol,	NoSymbol,
-    /* 0x10 */  XK_Q,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x11 */  XK_W,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x12 */  XK_E,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x13 */  XK_R,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x14 */  XK_T,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x15 */  XK_Y,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x16 */  XK_U,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x17 */  XK_I,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x18 */  XK_O,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x19 */  XK_P,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1a */  XK_bracketleft, XK_braceleft,	NoSymbol,	NoSymbol,
-    /* 0x1b */  XK_bracketright,XK_braceright,	NoSymbol,	NoSymbol,
-    /* 0x1c */  XK_Return,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1d */  XK_Control_L,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1e */  XK_A,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x1f */  XK_S,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x20 */  XK_D,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x21 */  XK_F,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x22 */  XK_G,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x23 */  XK_H,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x24 */  XK_J,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x25 */  XK_K,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x26 */  XK_L,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x27 */  XK_semicolon,   XK_colon,	NoSymbol,	NoSymbol,
-    /* 0x28 */  XK_quoteright,  XK_quotedbl,	NoSymbol,	NoSymbol,
-    /* 0x29 */  XK_quoteleft,	XK_asciitilde,	NoSymbol,	NoSymbol,
-    /* 0x2a */  XK_Shift_L,     NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2b */  XK_backslash,   XK_bar,		NoSymbol,	NoSymbol,
-    /* 0x2c */  XK_Z,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2d */  XK_X,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2e */  XK_C,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x2f */  XK_V,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x30 */  XK_B,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x31 */  XK_N,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x32 */  XK_M,           NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x33 */  XK_comma,       XK_less,	NoSymbol,	NoSymbol,
-    /* 0x34 */  XK_period,      XK_greater,	NoSymbol,	NoSymbol,
-    /* 0x35 */  XK_slash,       XK_question,	NoSymbol,	NoSymbol,
-    /* 0x36 */  XK_Shift_R,     NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x37 */  XK_KP_Multiply, NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x38 */  XK_Alt_L,	XK_Meta_L,	NoSymbol,	NoSymbol,
-    /* 0x39 */  XK_space,       NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3a */  XK_Caps_Lock,   NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3b */  XK_F1,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3c */  XK_F2,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3d */  XK_F3,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3e */  XK_F4,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x3f */  XK_F5,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x40 */  XK_F6,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x41 */  XK_F7,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x42 */  XK_F8,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x43 */  XK_F9,          NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x44 */  XK_F10,         NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x45 */  XK_Num_Lock,    NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x46 */  XK_Scroll_Lock,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x47 */  XK_KP_Home,	XK_KP_7,	NoSymbol,	NoSymbol,
-    /* 0x48 */  XK_KP_Up,	XK_KP_8,	NoSymbol,	NoSymbol,
-    /* 0x49 */  XK_KP_Prior,	XK_KP_9,	NoSymbol,	NoSymbol,
-    /* 0x4a */  XK_KP_Subtract, NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x4b */  XK_KP_Left,	XK_KP_4,	NoSymbol,	NoSymbol,
-    /* 0x4c */  XK_KP_Begin,	XK_KP_5,	NoSymbol,	NoSymbol,
-    /* 0x4d */  XK_KP_Right,	XK_KP_6,	NoSymbol,	NoSymbol,
-    /* 0x4e */  XK_KP_Add,      NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x4f */  XK_KP_End,	XK_KP_1,	NoSymbol,	NoSymbol,
-    /* 0x50 */  XK_KP_Down,	XK_KP_2,	NoSymbol,	NoSymbol,
-    /* 0x51 */  XK_KP_Next,	XK_KP_3,	NoSymbol,	NoSymbol,
-    /* 0x52 */  XK_KP_Insert,	XK_KP_0,	NoSymbol,	NoSymbol,
-    /* 0x53 */  XK_KP_Delete,	XK_KP_Decimal,	NoSymbol,	NoSymbol,
-    /* 0x54 */  XK_Sys_Req,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x55 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x56 */  XK_less,	XK_greater,	NoSymbol,	NoSymbol,
-    /* 0x57 */  XK_F11,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x58 */  XK_F12,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x59 */  XK_Home,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5a */  XK_Up,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5b */  XK_Prior,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5c */  XK_Left,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5d */  XK_Begin,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5e */  XK_Right,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x5f */  XK_End,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x60 */  XK_Down,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x61 */  XK_Next,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x62 */  XK_Insert,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x63 */  XK_Delete,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x64 */  XK_KP_Enter,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x65 */  XK_Control_R,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x66 */  XK_Pause,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x67 */  XK_Print,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x68 */  XK_KP_Divide,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x69 */  XK_Alt_R,	XK_Meta_R,	NoSymbol,	NoSymbol,
-    /* 0x6a */  XK_Break,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6b */  XK_Meta_L,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6c */  XK_Meta_R,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6d */  XK_Menu,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6e */  XK_F13,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x6f */  XK_F14,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x70 */  XK_F15,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x71 */  XK_F16,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x72 */  XK_F17,		NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x73 */  XK_backslash,	XK_underscore,	NoSymbol,	NoSymbol,
-    /* 0x74 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x75 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x76 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x77 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x78 */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x79 */  XK_Henkan,	XK_Mode_switch,	NoSymbol,	NoSymbol,
-    /* 0x7a */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7b */  XK_Muhenkan,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7c */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7d */  XK_backslash,	XK_bar,		NoSymbol,	NoSymbol,
-    /* 0x7e */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-    /* 0x7f */  NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
-};
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 3436824..00572a1 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -326,14 +326,6 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
     }
 }
 
-/* Safe to call from any thread. */
-unsigned int
-WindowsWMSelectedEvents (void)
-{
-  return eventMask;
-}
-
-
 /* general utility functions */
 
 static int
commit 9b18f7ac0ba9aadb8c86bc2717cbdff75e951b69
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Feb 26 14:22:57 2010 +0000

    Cygwin/X: Tidy up some cosmetic issues in log strings
    
    Tidy up some cosmetic issues in log strings:
    - Add missing '\n'
    - Fix some strings starting with '\n'
    - Remove '\f' from some log strings
    
    These all just look daft in a log with timestamps.
    
    Also clarify log message about screen origin coordinates
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/dix/registry.c b/dix/registry.c
index ec853b3..1381a3d 100644
--- a/dix/registry.c
+++ b/dix/registry.c
@@ -313,7 +313,7 @@ dixResetRegistry(void)
 	fclose(fh);
     fh = fopen(FILENAME, "r");
     if (!fh)
-	LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME);
+	LogMessage(X_WARNING, "Failed to open protocol names file " FILENAME "\n");
 
     /* Add built-in resources */
     RegisterResourceName(RT_NONE, "NONE");
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index a380903..5d2b948 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -453,7 +453,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winClipboardIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinClipboardIOErrorHandler!\n\n");
+  ErrorF ("winClipboardIOErrorHandler!\n\n");
 
   /* Restart at the main entry point */
   longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 21d913e..2fcad32 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -944,7 +944,7 @@ winMultiWindowXMsgProc (void *pArg)
       if (pProcArg->pDisplay == NULL)
 	{
 	  ErrorF ("winMultiWindowXMsgProc - Could not open display, try: %d, "
-		  "sleeping: %d\n\f",
+		  "sleeping: %d\n",
 		  iRetries + 1, WIN_CONNECT_DELAY);
 	  ++iRetries;
 	  sleep (WIN_CONNECT_DELAY);
@@ -1327,7 +1327,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
       if (pWMInfo->pDisplay == NULL)
 	{
 	  ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, "
-		  "sleeping: %d\n\f",
+		  "sleeping: %d\n",
 		  iRetries + 1, WIN_CONNECT_DELAY);
 	  ++iRetries;
 	  sleep (WIN_CONNECT_DELAY);
@@ -1430,7 +1430,7 @@ winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winMultiWindowWMIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinMultiWindowWMIOErrorHandler!\n\n");
+  ErrorF ("winMultiWindowWMIOErrorHandler!\n\n");
 
   if (g_shutdown)
     pthread_exit(NULL);
@@ -1470,7 +1470,7 @@ winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr)
 static int
 winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay)
 {
-  ErrorF ("\nwinMultiWindowXMsgProcIOErrorHandler!\n\n");
+  ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n");
 
   /* Restart at the main entry point */
   longjmp (g_jmpXMsgProcEntry, WIN_JMP_ERROR_IO);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 37ec27e..c8cd646 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -246,7 +246,7 @@ winScreenInit (int index,
   dixScreenOrigins[index].x = pScreenInfo->dwInitialX - GetSystemMetrics(SM_XVIRTUALSCREEN);
   dixScreenOrigins[index].y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN);
 
-  ErrorF("Screen %d added at XINERAMA coordinate (%d,%d).\n",
+  ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n",
          index, dixScreenOrigins[index].x, dixScreenOrigins[index].y);
 
 #if CYGDEBUG || YES
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 8334441..4f3e895 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -651,7 +651,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
 	      "pixmap header to point to the new address.  If you get "
 	      "this message and "PROJECT_NAME" freezes or crashes "
 	      "after this message then send a problem report and your "
-	      "%s file to " BUILDERADDR, g_pszLogFile);
+	      "%s file to " BUILDERADDR "\n", g_pszLogFile);
 
       /* Location of shadow framebuffer has changed */
       pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index ef5c214..e78fbd9 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -554,7 +554,7 @@ winFinishCreateWindowsWindowDDNL (WindowPtr pWin)
   int			iWidth, iHeight;
   int			iX, iY;
 
-  winDebug ("\nwinFinishCreateWindowsWindowDDNL!\n\n");
+  winDebug ("winFinishCreateWindowsWindowDDNL!\n\n");
 
   iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
   iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
commit 178e830378c3514b9c53a5b1c6d2d5f930c3779b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Feb 22 19:13:30 2010 +0000

    Cygwin/X: Fix thinko in mount option checking
    
    Fix a thinko in mount option checking.
    Use symbolic names for values assigned to binary flag for clarity.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index acb7d4a..d8fd59f 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -1,3 +1,4 @@
+
 /*
 
 Copyright 1993, 1998  The Open Group
@@ -361,11 +362,11 @@ winCheckMount(void)
       continue;
     level = curlevel;
 
-    if ((winCheckMntOpt(ent, "binary") == NULL) ||
+    if ((winCheckMntOpt(ent, "binary") == NULL) &&
         (winCheckMntOpt(ent, "binmode") == NULL))
-      binary = 0;
+      binary = FALSE;
     else
-      binary = 1;
+      binary = TRUE;
   }
     
   if (endmntent(mnt) != 1)
commit fa5103a02bd509e4a102afdad2ab26cb22210367
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:18:01 2010 +0100

    dri2: No need to blit from front on DRI2GetBuffers if they're just being reused.
    
    It can be quite an expensive operation, so we're better off not doing
    it unless it's totally required.
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index cd69ca0..48618e1 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -202,27 +202,25 @@ find_attachment(DRI2DrawablePtr pPriv, unsigned attachment)
     return -1;
 }
 
-static DRI2BufferPtr
+static Bool
 allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
 			 DRI2DrawablePtr pPriv,
 			 unsigned int attachment, unsigned int format,
-			 int dimensions_match)
+			 int dimensions_match, DRI2BufferPtr *buffer)
 {
-    DRI2BufferPtr buffer;
-    int old_buf;
-
-    old_buf = find_attachment(pPriv, attachment);
+    int old_buf = find_attachment(pPriv, attachment);
 
     if ((old_buf < 0)
 	|| !dimensions_match
 	|| (pPriv->buffers[old_buf]->format != format)) {
-	buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+	*buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
+	return TRUE;
+
     } else {
-	buffer = pPriv->buffers[old_buf];
+	*buffer = pPriv->buffers[old_buf];
 	pPriv->buffers[old_buf] = NULL;
+	return FALSE;
     }
-
-    return buffer;
 }
 
 static DRI2BufferPtr *
@@ -238,6 +236,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     int have_fake_front = 0;
     int front_format = 0;
     int dimensions_match;
+    int buffers_changed = 0;
     int i;
 
     if (!pPriv) {
@@ -256,8 +255,10 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 	const unsigned attachment = *(attachments++);
 	const unsigned format = (has_format) ? *(attachments++) : 0;
 
-	buffers[i] = allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
-					      format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment,
+				     format, dimensions_match,
+				     &buffers[i]))
+		buffers_changed = 1;
 
 	/* If the drawable is a window and the front-buffer is requested,
 	 * silently add the fake front-buffer to the list of requested
@@ -287,15 +288,18 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     }
 
     if (need_real_front > 0) {
-	buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
-						DRI2BufferFrontLeft,
-						front_format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft,
+				     front_format, dimensions_match,
+				     &buffers[i++]))
+	    buffers_changed = 1;
     }
 
     if (need_fake_front > 0) {
-	buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv,
-						DRI2BufferFakeFrontLeft,
-						front_format, dimensions_match);
+	if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft,
+				     front_format, dimensions_match,
+				     &buffers[i++]))
+	    buffers_changed = 1;
+
 	have_fake_front = 1;
     }
 
@@ -324,7 +328,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
      * contents of the real front-buffer.  This ensures correct operation of
      * applications that call glXWaitX before calling glDrawBuffer.
      */
-    if (have_fake_front) {
+    if (have_fake_front && buffers_changed) {
 	BoxRec box;
 	RegionRec region;
 
commit e38e01081af42825bb7b44d18aa35845318f8556
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:18:00 2010 +0100

    Import linked list helpers from the intel DDX.
    
    Borrowed from i830.h, except for list_for_each_entry().
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/include/Makefile.am b/include/Makefile.am
index d684f9c..eddc86c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -27,6 +27,7 @@ sdk_HEADERS =		\
 	globals.h	\
 	input.h		\
 	inputstr.h	\
+	list.h		\
 	misc.h		\
 	miscstruct.h	\
 	opaque.h	\
diff --git a/include/list.h b/include/list.h
new file mode 100644
index 0000000..a126a65
--- /dev/null
+++ b/include/list.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ * Copyright © 2010 Francisco Jerez <currojerez at riseup.net>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _LIST_H_
+#define _LIST_H_
+
+/* classic doubly-link circular list */
+struct list {
+    struct list *next, *prev;
+};
+
+static void
+list_init(struct list *list)
+{
+    list->next = list->prev = list;
+}
+
+static inline void
+__list_add(struct list *entry,
+	    struct list *prev,
+	    struct list *next)
+{
+    next->prev = entry;
+    entry->next = next;
+    entry->prev = prev;
+    prev->next = entry;
+}
+
+static inline void
+list_add(struct list *entry, struct list *head)
+{
+    __list_add(entry, head, head->next);
+}
+
+static inline void
+__list_del(struct list *prev, struct list *next)
+{
+    next->prev = prev;
+    prev->next = next;
+}
+
+static inline void
+list_del(struct list *entry)
+{
+    __list_del(entry->prev, entry->next);
+    list_init(entry);
+}
+
+static inline Bool
+list_is_empty(struct list *head)
+{
+    return head->next == head;
+}
+
+#ifndef container_of
+#define container_of(ptr, type, member) \
+    (type *)((char *)(ptr) - (char *) &((type *)0)->member)
+#endif
+
+#define list_entry(ptr, type, member) \
+    container_of(ptr, type, member)
+
+#define list_first_entry(ptr, type, member) \
+    list_entry((ptr)->next, type, member)
+
+#define __container_of(ptr, sample, member)				\
+    (void *)((char *)(ptr)						\
+	     - ((char *)&(sample)->member - (char *)(sample)))
+
+#define list_for_each_entry(pos, head, member)				\
+    for (pos = __container_of((head)->next, pos, member);		\
+	 &pos->member != (head);					\
+	 pos = __container_of(pos->member.next, pos, member))
+
+#endif
commit b8a3be5f34016b745e38cd53825a4e398c6127bc
Author: Francisco Jerez <currojerez at riseup.net>
Date:   Wed Feb 24 23:17:59 2010 +0100

    Add a ConfigNotify hook.
    
    Executed from the ConfigureWindow request, right before sending
    ConfigureNotify to the clients.
    
    This commit breaks the ScreenRec ABI.
    
    Signed-off-by: Francisco Jerez <currojerez at riseup.net>
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

diff --git a/dix/window.c b/dix/window.c
index 2676a54..c7201df 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2303,6 +2303,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
     return(Success);
 
 ActuallyDoSomething:
+    if (pWin->drawable.pScreen->ConfigNotify)
+	(*pWin->drawable.pScreen->ConfigNotify)(pWin, x, y, w, h, bw, pSib);
+
     if (SubStrSend(pWin, pParent))
     {
 	memset(&event, 0, sizeof(xEvent));
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index ab50e7a..c42119d 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -399,6 +399,15 @@ typedef    void (* PostChangeSaveUnderProcPtr)(
 	WindowPtr /*pLayerWin*/,
 	WindowPtr /*firstChild*/);
 
+typedef    void (* ConfigNotifyProcPtr)(
+	WindowPtr /*pWin*/,
+	int /*x*/,
+	int /*y*/,
+	int /*w*/,
+	int /*h*/,
+	int /*bw*/,
+	WindowPtr /*pSib*/);
+
 typedef    void (* MoveWindowProcPtr)(
 	WindowPtr /*pWin*/,
 	int /*x*/,
@@ -581,6 +590,7 @@ typedef struct _Screen {
     MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
     ChangeSaveUnderProcPtr	ChangeSaveUnder;
     PostChangeSaveUnderProcPtr	PostChangeSaveUnder;
+    ConfigNotifyProcPtr		ConfigNotify;
     MoveWindowProcPtr		MoveWindow;
     ResizeWindowProcPtr		ResizeWindow;
     GetLayerWindowProcPtr	GetLayerWindow;


More information about the Xquartz-changes mailing list