[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit 251d0d8090322b2c9dc0c8b7bef001f338d19433
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Jan 12 13:03:30 2009 -0800

    Update version to 1.5.99.901 (1.6 RC1)

diff --git a/configure.ac b/configure.ac
index cd53288..da5f488 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.5.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.5.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE

commit 71628cabc9dddf5c9fe12d555ae0c47d5902b2f7
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Jan 12 11:51:28 2009 -0800

    Merge include/dix-config-post-verbatim.h into include/dix-config.h.in
    
    No sense having an extra include file here; it makes building stuff harder.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/include/dix-config-post-verbatim.h b/include/dix-config-post-verbatim.h
deleted file mode 100644
index 4bbb9b0..0000000
--- a/include/dix-config-post-verbatim.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Do not include this file directly.  It is included at the end of <dix-config.h> */
-
-/* Correctly set _XSERVER64 for OSX fat binaries */
-#ifdef __APPLE__
-#if defined(__LP64__) && !defined(_XSERVER64)
-#define _XSERVER64 1
-#elif !defined(__LP64__) && defined(_XSERVER64)
-#undef _XSERVER64
-#endif
-#endif
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 977bff3..8e047c4 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -429,6 +429,13 @@
 /* Define to 1 if you have the `ffs' function. */
 #undef HAVE_FFS
 
-#include <dix-config-post-verbatim.h>
+/* Correctly set _XSERVER64 for OSX fat binaries */
+#ifdef __APPLE__
+#if defined(__LP64__) && !defined(_XSERVER64)
+#define _XSERVER64 1
+#elif !defined(__LP64__) && defined(_XSERVER64)
+#undef _XSERVER64
+#endif
+#endif
 
 #endif /* _DIX_CONFIG_H_ */

commit cbd977cc15cf22a3e42b10942d5657cb8b9ac335
Author: Alban Browaeys <prahal@yahoo.com>
Date:   Mon Jan 12 10:57:11 2009 -0800

    Fix dmx compile on 1.6 branch.
    
    http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg166742.html
    contains a patch from "arekm" which I build upon to make up this one.
    
    Mostly fixes for Xcalloc which I previously tried to fix the same way but
    without finding the right spot.
    
    I cannot tell if dmx works though. Only that it at least compile.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c
index 4e7279a..ae6eb6f 100644
--- a/hw/dmx/dmxcb.c
+++ b/hw/dmx/dmxcb.c
@@ -43,6 +43,12 @@
 #include "dmxinput.h"
 #include "dmxlog.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 extern int     connBlockScreenStart;
 
 #ifdef PANORAMIX
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index d20c844..91479e7 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -64,6 +64,12 @@
 #include <X11/extensions/dmxproto.h>  /* For DMX_BAD_* */
 #include "cursorstr.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 /* The default font is declared in dix/globals.c, but is not included in
  * _any_ header files. */
 extern FontPtr  defaultFont;
diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c
index b70f7d2..c739159 100644
--- a/hw/dmx/dmxfont.c
+++ b/hw/dmx/dmxfont.c
@@ -49,6 +49,12 @@
 #include "dixfont.h"
 #include "dixstruct.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 static int (*dmxSaveProcVector[256])(ClientPtr);
 static int   dmxFontLastError;
 
diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c
index 37dfa10..8bce689 100644
--- a/hw/dmx/dmxpict.c
+++ b/hw/dmx/dmxpict.c
@@ -56,6 +56,12 @@
 #include "mipict.h"
 #include "fbpict.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 
 extern int RenderErrBase;
 extern int (*ProcRenderVector[RenderNumberRequests])(ClientPtr);
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index 7360750..28c8b01 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -61,6 +61,12 @@
 #include "mipointer.h"
 #include "micmap.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 extern Bool dmxCloseScreen(int idx, ScreenPtr pScreen);
 static Bool dmxSaveScreen(ScreenPtr pScreen, int what);
 
diff --git a/hw/dmx/glxProxy/glxutil.c b/hw/dmx/glxProxy/glxutil.c
index 080992e..e3056bb 100644
--- a/hw/dmx/glxProxy/glxutil.c
+++ b/hw/dmx/glxProxy/glxutil.c
@@ -36,6 +36,12 @@
 #include <windowstr.h>
 #include "glxutil.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 /************************************************************************/
 
 void __glXNop(void) {}
diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
index b961dfa..c8b1eea 100644
--- a/hw/dmx/glxProxy/glxvisuals.c
+++ b/hw/dmx/glxProxy/glxvisuals.c
@@ -38,6 +38,12 @@
 #include "glxutil.h"
 #include "dmx_glxvisuals.h"
 
+#undef Xmalloc
+#undef Xcalloc
+#undef Xrealloc
+#undef Xfree
+
+
 static int                 numConfigs     = 0;
 static __GLXvisualConfig  *visualConfigs  = NULL;
 static void              **visualPrivates = NULL;

commit 6be355b8e8cabeb5832ce9970a83782ea46fd4d1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 9 13:46:20 2009 +1000

    dix: drop x/y back into last.valuators before updating the history (#19285)
    
    positionSprite needs to scale to screen coordinates and in the process of
    doing so alters dev->last.valuators[0:1]. Drop the real coordinates back after
    finishing and before updating the motion history. This way, we don't push the
    screen coordinates into the motion history.
    
    X.Org Bug 19285 <http://bugs.freedesktop.org/show_bug.cgi?id=19285>
    (cherry picked from commit 56efbc0986e782da45addb05ece9f456d41d7a90)

diff --git a/dix/getevents.c b/dix/getevents.c
index 707d1da..16e23dc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -695,6 +695,9 @@ positionSprite(DeviceIntPtr dev, int *x, int *y,
                                  dev->valuator->axes + 1, scr->height);
     }
 
+    /* dropy x/y (device coordinates) back into valuators for next event */
+    dev->last.valuators[0] = *x;
+    dev->last.valuators[1] = *y;
 }
 
 /**
@@ -980,9 +983,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     positionSprite(pDev, &x, &y, scr, &cx, &cy);
     updateHistory(pDev, first_valuator, num_valuators, ms);
 
-    /* dropy x/y (device coordinates) back into valuators for next event */
-    pDev->last.valuators[0] = x;
-    pDev->last.valuators[1] = y;
 
     /* Update the valuators with the true value sent to the client*/
     if (num_valuators >= 1 && first_valuator == 0)

commit ca21fd7ddf50e6a363c6ad027d46388596872d3b
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Jan 11 01:52:42 2009 -0800

    XQuartz: Add locking to make mieq thread safe on OSX
    (cherry picked from commit 7a8d2266861e74176b5310b83652a9c10a170494)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 37f0bfb..1863eff 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -116,7 +116,8 @@ void darwinEvents_lock(void) {
     }
 }
 
-static inline void darwinEvents_unlock(void) {
+void darwinEvents_unlock(void);
+void darwinEvents_unlock(void) {
     int err;
     if((err = pthread_mutex_unlock(&mieq_lock))) {
         ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n",
diff --git a/mi/mieq.c b/mi/mieq.c
index b7392a1..15ba8e7 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -36,6 +36,11 @@ in this Software without prior written authorization from The Open Group.
 #include <dix-config.h>
 #endif
 
+#ifdef XQUARTZ
+#include  <pthread.h>
+static pthread_mutex_t miEventQueueMutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
 # define NEED_EVENTS
 # include   <X11/X.h>
 # include   <X11/Xmd.h>
@@ -139,6 +144,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
     int                    isMotion = 0;
     int                    evlen;
 
+#ifdef XQUARTZ
+    pthread_mutex_lock(&miEventQueueMutex);
+#endif
 
     /* avoid merging events from different devices */
     if (e->u.u.type == MotionNotify)
@@ -157,6 +165,10 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
         lastkbp = (deviceKeyButtonPointer *) laste->events->event;
 
         if (laste->nevents > 6) {
+#ifdef XQUARTZ
+            pthread_mutex_unlock(&miEventQueueMutex);
+#endif
+            
             ErrorF("[mi] mieqEnqueue: more than six valuator events; dropping.\n");
             return;
         }
@@ -168,11 +180,17 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
               lastkbp->type == ProximityOut) ||
             ((lastkbp->deviceid & DEVICE_BITS) !=
              (v->deviceid & DEVICE_BITS))) {
+#ifdef XQUARTZ
+            pthread_mutex_unlock(&miEventQueueMutex);
+#endif
             ErrorF("[mi] mieqEnequeue: out-of-order valuator event; dropping.\n");
             return;
         }
 
         memcpy((laste->events[laste->nevents++].event), e, sizeof(xEvent));
+#ifdef XQUARTZ
+        pthread_mutex_unlock(&miEventQueueMutex);
+#endif
         return;
     }
 
@@ -192,6 +210,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
 		xorg_backtrace();
 		stuck = 1;
 	    }
+#ifdef XQUARTZ
+	    pthread_mutex_unlock(&miEventQueueMutex);
+#endif
 	    return;
         }
 	stuck = 0;
@@ -209,6 +230,9 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
         if (!evt->event)
         {
             ErrorF("[mi] Running out of memory. Tossing event.\n");
+#ifdef XQUARTZ
+            pthread_mutex_unlock(&miEventQueueMutex);
+#endif
             return;
         }
     }
@@ -229,24 +253,39 @@ mieqEnqueue(DeviceIntPtr pDev, xEvent *e)
 
     miEventQueue.lastMotion = isMotion;
     miEventQueue.tail = (oldtail + 1) % QUEUE_SIZE;
+#ifdef XQUARTZ
+    pthread_mutex_unlock(&miEventQueueMutex);
+#endif
 }
 
 void
 mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX)
 {
+#ifdef XQUARTZ
+    pthread_mutex_lock(&miEventQueueMutex);
+#endif
     EnqueueScreen(pDev) = pScreen;
     if (fromDIX)
 	DequeueScreen(pDev) = pScreen;
+#ifdef XQUARTZ
+    pthread_mutex_unlock(&miEventQueueMutex);
+#endif
 }
 
 void
 mieqSetHandler(int event, mieqHandler handler)
 {
+#ifdef XQUARTZ
+    pthread_mutex_lock(&miEventQueueMutex);
+#endif
     if (handler && miEventQueue.handlers[event])
         ErrorF("[mi] mieq: warning: overriding existing handler %p with %p for "
                "event %d\n", miEventQueue.handlers[event], handler, event);
 
     miEventQueue.handlers[event] = handler;
+#ifdef XQUARTZ
+    pthread_mutex_unlock(&miEventQueueMutex);
+#endif
 }
 
 /**
@@ -315,6 +354,10 @@ mieqProcessInputEvents(void)
     DeviceIntPtr dev = NULL,
                  master = NULL;
 
+#ifdef XQUARTZ
+    pthread_mutex_lock(&miEventQueueMutex);
+#endif
+    
     while (miEventQueue.head != miEventQueue.tail) {
         e = &miEventQueue.events[miEventQueue.head];
 
@@ -338,6 +381,10 @@ mieqProcessInputEvents(void)
 
         miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
 
+#ifdef XQUARTZ
+        pthread_mutex_unlock(&miEventQueueMutex);
+#endif
+        
         type    = event->u.u.type;
         master  = (!dev->isMaster && dev->u.master) ? dev->u.master : NULL;
 
@@ -394,6 +441,13 @@ mieqProcessInputEvents(void)
         /* Update the sprite now. Next event may be from different device. */
         if (type == DeviceMotionNotify && dev->coreEvents)
             miPointerUpdateSprite(dev);
+
+#ifdef XQUARTZ
+        pthread_mutex_lock(&miEventQueueMutex);
+#endif
     }
+#ifdef XQUARTZ
+    pthread_mutex_unlock(&miEventQueueMutex);
+#endif
 }
 
diff --git a/mi/mipointer.c b/mi/mipointer.c
index b998cd4..9b2a1b2 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -547,6 +547,12 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
     *y = MIPOINTER(pDev)->y;
 }
 
+#ifdef XQUARTZ
+#include <pthread.h>
+void darwinEvents_lock(void);
+void darwinEvents_unlock(void);
+#endif
+
 void
 miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
@@ -573,7 +579,13 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
     nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators);
 
     OsBlockSignals();
+#ifdef XQUARTZ
+    darwinEvents_lock();
+#endif
     for (i = 0; i < nevents; i++)
         mieqEnqueue(pDev, events[i].event);
+#ifdef XQUARTZ
+    darwinEvents_unlock();
+#endif
     OsReleaseSignals();
 }

commit 671b71a6cba1c9da7797524f21ef1b27ff04adfd
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Jan 11 01:42:24 2009 -0800

    XQuartz: misc 1.6 updates (still --disable-glx)
      rlAccel is not longer compatable, and it's not worth fixing
      Don't override DeviceCursorInitialize with a noop
      Don't do a SwitchCoreKeyboard (which wasn't even needed in the first place)
    (cherry picked from commit c137f681680e1d04b1513a8be68aeda4d1c56fd5)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 07b243b..c104589 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -510,6 +510,17 @@ void InitInput( int argc, char **argv )
     darwinTabletEraser->name = strdup("eraser");
 
     darwinTabletCurrent = darwinTabletStylus;
+
+    ActivateDevice(darwinKeyboard);
+    ActivateDevice(darwinPointer);
+    ActivateDevice(darwinTabletStylus);
+    ActivateDevice(darwinTabletCursor);
+    ActivateDevice(darwinTabletEraser);
+    EnableDevice(darwinKeyboard);
+    EnableDevice(darwinPointer);
+    EnableDevice(darwinTabletStylus);
+    EnableDevice(darwinTabletCursor);
+    EnableDevice(darwinTabletEraser);
     
     DarwinEQInit();
 
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index bbad10a..40060d0 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -18,7 +18,6 @@ X11_bin_LDADD = \
 	$(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \
 	$(top_builddir)/dix/dixfonts.lo \
 	$(top_builddir)/miext/rootless/librootless.la \
-	$(top_builddir)/miext/rootless/accel/librlAccel.la \
 	$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
 	$(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
 
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 945f01e..72f94b4 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -362,8 +362,6 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
 
         XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
     }
-	// TODO: What do we do now in 1.6?
-    SwitchCoreKeyboard(pDev);   
 
     DarwinKeyboardSetDeviceKeyMap(&keySyms);
 }
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index bf1a6e8..4345bee 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -239,7 +239,6 @@ QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x,
     }
 }
 
-
 /*
  * QuartzMoveCursor
  *  Move the cursor. This is a noop for us.
@@ -249,25 +248,6 @@ QuartzMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
 }
 
-/* TODO: New for 1.6 ... probably noop */
-static Bool QuartzDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) {
-    return TRUE;
-}
-
-/* TODO: New for 1.6 ... probably noop */
-static void QuartzDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) {
-}
-
-static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
-    QuartzRealizeCursor,
-    QuartzUnrealizeCursor,
-    QuartzSetCursor,
-    QuartzMoveCursor,
-    QuartzDeviceCursorInitialize,
-    QuartzDeviceCursorCleanup
-};
-
-
 /*
 ===========================================================================
 
@@ -387,13 +367,16 @@ QuartzInitCursor(ScreenPtr pScreen)
     PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
 
     ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
-    PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
 
+    PointPriv->spriteFuncs->RealizeCursor = QuartzRealizeCursor;
+    PointPriv->spriteFuncs->UnrealizeCursor = QuartzUnrealizeCursor;
+    PointPriv->spriteFuncs->SetCursor = QuartzSetCursor;
+    PointPriv->spriteFuncs->MoveCursor = QuartzMoveCursor;
+    
     ScreenPriv->cursorVisible = TRUE;
     return TRUE;
 }
 
-
 /*
  * QuartzSuspendXCursor
  *  X server is hiding. Restore the Aqua cursor.
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 52fb9c9..da262f6 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -364,7 +364,9 @@ xprSetupScreen(int index, ScreenPtr pScreen)
 {
     // Initialize accelerated rootless drawing
     // Note that this must be done before DamageSetup().
-    RootlessAccelInit(pScreen);
+
+    // These are crashing ugly... better to be stable and not crash for now.
+    //RootlessAccelInit(pScreen);
 
 #ifdef DAMAGE
     // The Damage extension needs to wrap underneath the

commit 69ddac23281534a06c0acb3005a09e4448594925
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sat Jan 10 01:39:08 2009 -0800

    Apple: Don't use DRI2
    (cherry picked from commit a1d35cee5907a76977ee43c49cb55c8f411c9794)

diff --git a/configure.ac b/configure.ac
index c222c95..cd53288 100644
--- a/configure.ac
+++ b/configure.ac
@@ -631,6 +631,8 @@ AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
 dnl XQuartz DDX Detection... Yes, it's ugly to have it here... but we need to handle this early on
 case $host_os in
 	darwin*)
+		DRI2=no
+
 		if test x$XQUARTZ = xauto; then
 			AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
 		 		save_LDFLAGS=$LDFLAGS

commit 681cc0f38b0b96c5e41c93d6944e4fa58c950eda
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Tue Dec 23 12:39:38 2008 -0800

    XQuartz: Use depth=24 instead of FatalError if we can't figure out our depth
    (cherry picked from commit 80b65c5b78d125c4ad3620b87b121c9e666299c3)
    (cherry picked from commit 932ed6e949757926a17f7efe6b0255e38efa1152)

diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 78bca94..52fb9c9 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -278,18 +278,17 @@ xprAddScreen(int index, ScreenPtr pScreen)
     }
     
     switch(depth) {
-        case -8: // broken
-            FatalError("Unsupported color depth %d %d\n", darwinDesiredDepth, depth);
-            dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
-            dfb->preferredCVC = GrayScale;
-            dfb->depth = 8;
-            dfb->bitsPerRGB = 8;
-            dfb->bitsPerPixel = 8;
-            dfb->redMask = 0;
-            dfb->greenMask = 0;
-            dfb->blueMask = 0;
-            break;
-        case 8: // broken
+//        case -8: // broken
+//            dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
+//            dfb->preferredCVC = GrayScale;
+//            dfb->depth = 8;
+//            dfb->bitsPerRGB = 8;
+//            dfb->bitsPerPixel = 8;
+//            dfb->redMask = 0;
+//            dfb->greenMask = 0;
+//            dfb->blueMask = 0;
+//            break;
+        case 8: // pseudo-working
             dfb->visuals = PseudoColorMask;
             dfb->preferredCVC = PseudoColor;
             dfb->depth = 8;
@@ -309,7 +308,10 @@ xprAddScreen(int index, ScreenPtr pScreen)
             dfb->greenMask = 0x03e0;
             dfb->blueMask  = 0x001f;
             break;
-        case 24:
+//        case 24:
+        default:
+            if(depth != 24)
+                ErrorF("Unsupported color depth requested.  Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n",  darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay));
             dfb->visuals = LARGE_VISUALS;
             dfb->preferredCVC = TrueColor;
             dfb->depth = 24;
@@ -319,8 +321,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
             dfb->greenMask = 0x0000ff00;
             dfb->blueMask  = 0x000000ff;
             break;
-        default:
-            FatalError("Unsupported color depth %d %d\n", darwinDesiredDepth, depth);
     }
 
     if (noPseudoramiXExtension)

commit 7872669105d6d81ded5128eb4d4f1acce34c3b02
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Tue Dec 9 23:48:18 2008 -0800

    XQuartz: Make debugging output for invalid depths a bit more detailed
    (cherry picked from commit 609fb166b7062c76f0561df12ffe893811f6ac8f)
    (cherry picked from commit 1962af7ee3bdf54cfa674187dea67b9ad36cd5a1)

diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 7634469..78bca94 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -279,7 +279,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
     
     switch(depth) {
         case -8: // broken
-            FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
+            FatalError("Unsupported color depth %d %d\n", darwinDesiredDepth, depth);
             dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
             dfb->preferredCVC = GrayScale;
             dfb->depth = 8;
@@ -320,7 +320,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
             dfb->blueMask  = 0x000000ff;
             break;
         default:
-            FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
+            FatalError("Unsupported color depth %d %d\n", darwinDesiredDepth, depth);
     }
 
     if (noPseudoramiXExtension)

commit 82f42730fa268e85dc95c43a6450c35f9e57acdf
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Dec 15 10:46:07 2008 +1000

    mi: force CopyKeyClass for key events. (#19048)
    
    While we don't want to copy all other device classes into the VCK, we need to
    copy the key class to transfer the layout from the SDs into the VCK.
    This resembles the functionality of SwitchCoreKeyboard in server 1.5.
    
    Thanks to Colin Guthrie for providing the follow-up patch (#19222)
    
    X.Org Bug 19048 <http://bugs.freedesktop.org/show_bug.cgi?id=19048>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 6141f5e..083bb2f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -186,7 +186,7 @@ XIGetDevice(xEvent* xE)
  * This code is basically the old SwitchCoreKeyboard.
  */
 
-static void
+void
 CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
 {
     static DeviceIntPtr lastMapNotifyDevice = NULL;
diff --git a/mi/mieq.c b/mi/mieq.c
index db48f55..b7392a1 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -298,6 +298,8 @@ CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
     while (count--)
         ChangeDeviceID(mdev, &master->event[count]);
 }
+extern void
+CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 
 /* Call this from ProcessInputEvents(). */
 void
@@ -360,8 +362,15 @@ mieqProcessInputEvents(void)
             NewCurrentScreen (dev, DequeueScreen(dev), x, y);
         }
         else {
-            if (master)
+            if (master) {
+                /* Force a copy of the key class into the VCK so that the layout
+                   is transferred. */
+                if (event->u.u.type == DeviceKeyPress ||
+                    event->u.u.type == DeviceKeyRelease)
+		    CopyKeyClass(dev, master);
+
                 CopyGetMasterEvent(master, event, masterEvents, nevents);
+            }
 
             /* If someone's registered a custom event handler, let them
              * steal it. */

commit 8cfb353078d9b5d03a9633304038141a60adc970
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jan 12 11:07:08 2009 +1000

    dix: Fix handling of do_not_propagate_mask window attribute.
    
    This was broken in 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2.
    
    Signed-off-by: Kim Woelders <kim@woelders.dk>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 30d2cfcd3851870178d62e5067211aa36f87fbd2)
    
    Conflicts:
    
    	dix/events.c
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 5530c01..122ce6a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2351,13 +2351,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
                     if (deliveries > 0)
                         return deliveries;
                 }
-
-                if ((deliveries < 0) ||
-                        (pWin == stopAt) ||
-                        (inputMasks &&
-                         (filter & inputMasks->dontPropagateMask[mskidx])))
-                    return 0;
             }
+
+            if ((deliveries < 0) || (pWin == stopAt) ||
+                    (inputMasks && (filter & inputMasks->dontPropagateMask[mskidx])))
+                return 0;
         } else
         {
             core = *xE;
@@ -2373,12 +2371,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
                     if (deliveries > 0)
                         return deliveries;
                 }
-
-                if ((deliveries < 0) ||
-                        (pWin == stopAt) ||
-                        (filter & wDontPropagateMask(pWin)))
-                    return 0;
             }
+
+            if ((deliveries < 0) || (pWin == stopAt) ||
+                (filter & wDontPropagateMask(pWin)))
+                return 0;
         }
 
         child = pWin->drawable.id;

commit 10c0287232eab1b93d078774f52e65efa0c03607
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jan 12 11:07:08 2009 +1000

    dix: Fix handling of do_not_propagate_mask window attribute.
    
    This was broken in 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2.
    
    Signed-off-by: Kim Woelders <kim@woelders.dk>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 30d2cfcd3851870178d62e5067211aa36f87fbd2)
    
    Conflicts:
    
    	dix/events.c

diff --git a/dix/events.c b/dix/events.c
index 5530c01..122ce6a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2351,13 +2351,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
                     if (deliveries > 0)
                         return deliveries;
                 }
-
-                if ((deliveries < 0) ||
-                        (pWin == stopAt) ||
-                        (inputMasks &&
-                         (filter & inputMasks->dontPropagateMask[mskidx])))
-                    return 0;
             }
+
+            if ((deliveries < 0) || (pWin == stopAt) ||
+                    (inputMasks && (filter & inputMasks->dontPropagateMask[mskidx])))
+                return 0;
         } else
         {
             core = *xE;
@@ -2373,12 +2371,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
                     if (deliveries > 0)
                         return deliveries;
                 }
-
-                if ((deliveries < 0) ||
-                        (pWin == stopAt) ||
-                        (filter & wDontPropagateMask(pWin)))
-                    return 0;
             }
+
+            if ((deliveries < 0) || (pWin == stopAt) ||
+                (filter & wDontPropagateMask(pWin)))
+                return 0;
         }
 
         child = pWin->drawable.id;

commit 93e510d3abaee97f5b7812abc3a2693dabf94478
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date:   Thu Dec 4 10:30:02 2008 +1000

    xfree86: Only use the evdev ruleset on linux.
    
    As suggested by Julien Cristau
    
    This is an follow-up to
    commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a
    Author: Peter Hutterer <peter.hutterer@redhat.com>
    Date:   Wed Dec 3 14:24:25 2008 +1000
    
        Let the DDX decide on the XkbRulesDefaults.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
    Acked-by: Julien Cristau <jcristau@debian.org>
    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
    (cherry picked from commit 13de7511b17b57a28668e1a60b196ccfe61dbcbe)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index ad72b16..6c6fac3 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -855,6 +855,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     Bool value;
     MessageType from;
     const char *s;
+#ifdef XKB
+    char *rules = "base";
+#endif
 
     /*
      * Merge the ServerLayout and ServerFlags options.  The former have
@@ -1034,8 +1037,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
 
     /* AEI on? Then we're not using kbd, so use the evdev rules set. */
 #ifdef XKB
-    XkbSetRulesDflts(((xf86Info.allowEmptyInput) ? "evdev" : "base"),
-                     "pc105", "us", NULL, NULL);
+#if defined(linux)
+    if (xf86Info.allowEmptyInput)
+        rules = "evdev";
+#endif
+    XkbSetRulesDflts(rules, "pc105", "us", NULL, NULL);
 #endif
 
     xf86Info.useDefaultFontPath = TRUE;

commit cc78f04b22daabc06d9fb82f550e3f4dbbe76f28
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date:   Wed Dec 3 14:24:25 2008 +1000

    Let the DDX decide on the XkbRulesDefaults.
    
    Rather than assuming rules in the CoreKeyboardProc, init the default rules in
    InitCoreDevices, then re-use them later.
    
    In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether
    we'll load kbd or evdev.
    
    If we create a new MD, use pc105,us as default and re-use the rules file used
    previously.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/devices.c b/dix/devices.c
index 6b05050..bf79024 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -528,7 +528,6 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
 #ifdef XKB
         if (!noXkbExtension) {
             bzero(&names, sizeof(names));
-            XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
             XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap,
                                         CoreKeyboardBell, CoreKeyboardCtl);
         }
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index f530ec4..ad72b16 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1032,6 +1032,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
     xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
 
+    /* AEI on? Then we're not using kbd, so use the evdev rules set. */
+#ifdef XKB
+    XkbSetRulesDflts(((xf86Info.allowEmptyInput) ? "evdev" : "base"),
+                     "pc105", "us", NULL, NULL);
+#endif
+
     xf86Info.useDefaultFontPath = TRUE;
     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
     if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) {

commit 02c059ea99a791b9e3643b4fb131af01306b1c23
Author: Keith Packard <keithp@keithp.com>
Date:   Sun Jan 11 15:56:28 2009 -0800

    dix: move focus handling into enterleave.c.
    
    This commit moves the focus handling from events.c into enterleave.c and
    implements a model similar to the core enter/leave model.
    For a full description of the model, see:
    http://lists.freedesktop.org/archives/xorg/2008-December/041740.html
    
    This commit also gets rid of the focusinout array in the WindowRec, ditching
    it in favour of a local array that keeps the current focus window for each
    device.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit eb2d7b3d700952ba88c77deacf687b251300e660)
    
    Conflicts:
    
    	dix/events.c
    	include/input.h
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/dix/enterleave.c b/dix/enterleave.c
index 659ae05..8511dea 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -30,19 +30,24 @@
 
 #include <X11/X.h>
 #include "windowstr.h"
+#include "scrnintstr.h"
 #include "exglobals.h"


Reply to: