[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 290a9639db3e420ec4caf0e6aee9f7386724c765
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Sep 28 21:05:11 2009 +1000

    xserver 1.6.99.903 (xserver 1.7 RC3)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index a7f5510..9517595 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.6.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-9-22"
+AC_INIT([xorg-server], 1.6.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2009-9-28"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE

commit 6af44db315121ea24cec390d144514bf56908b2c
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date:   Thu Sep 24 12:57:02 2009 +0200

    configure: make XNEST default to auto.
    
    When we're checking whether to build Xnest, we're comparing the
    variable to auto but before it never was assigned that.
    
    Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
    
    [Xnest was enabled to yes to increase build exposure and catch compiler
    errors early. The requirements to Xnest are quite low and I expect most
    developers have them, so Xnext will be enabled on most boxes. Anyone
    missing those requires probably doesn't want to build Xnest anyway.]
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 3db28f92b0c810b452506abbed299a204c90ba0b)

diff --git a/configure.ac b/configure.ac
index 422ef0b..91d87af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -604,7 +604,7 @@ dnl DDXes.
 AC_ARG_ENABLE(xorg,    	      AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
 AC_ARG_ENABLE(dmx,    	      AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
 AC_ARG_ENABLE(xvfb,    	      AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
-AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: yes)]), [XNEST=$enableval], [XNEST=yes])
+AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
 AC_ARG_ENABLE(xquartz,        AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
 AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
 AC_ARG_ENABLE(xwin,    	      AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])

commit b49dba33f94b51ba9a14803f0d81ccde2cb778f8
Author: Ben Byer <bbyer@freedesktop.org>
Date:   Sun Sep 27 10:35:53 2009 -0700

    Add (ok, fix) support for DTrace under OS X
    (cherry picked from commit 8428a57184f542941d2c8c90e97d18e111a69dd2)

diff --git a/.gitignore b/.gitignore
index 3fb73f0..3a8fe50 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,6 +45,7 @@ xorg-server.pc
 xorg-server-*.tar.bz2
 xorg-server-*.tar.gz
 stamp-h?
+dix/Xserver-dtrace.h
 do-not-use-config.h
 do-not-use-config.h.in
 dix/dix.c
diff --git a/configure.ac b/configure.ac
index 422ef0b..7d0abca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,12 +85,6 @@ dnl ISDN trace program named dtrace
 AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
 	     [Enable dtrace probes (default: enabled if dtrace found)]),
 	     [WDTRACE=$withval], [WDTRACE=auto])
-dnl Darwin 9 has dtrace, but it doesn't support compilation into ELF...
-if test "x$WDTRACE" = xauto; then
-	case $host_os in
-		darwin*) WDTRACE="no" ;;
-	esac
-fi
 if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
 	AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
 	if test "x$DTRACE" = "xnot_found" ; then
@@ -1250,7 +1244,7 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
 AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
 AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
 
-if test "x$WDTRACE" != "xno" ; then
+if test "x$WDTRACE" != "xno" && test "x$XQUARTZ" = "xno"; then
   DIX_LIB='$(top_builddir)/dix/dix.O'
   OS_LIB='$(top_builddir)/os/os.O'
 else
diff --git a/dix/Makefile.am b/dix/Makefile.am
index 13e5ded..23fe460 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -54,6 +54,7 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
 	$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \
 		|| cp Xserver-dtrace.h.in $@
 
+if !XQUARTZ	
 # Generate dtrace object code for probes in libdix
 dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
 	$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o
@@ -63,6 +64,7 @@ noinst_PROGRAMS = dix.O
 dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
 	ld -r -o $@ .libs/*.o
 endif
+endif
 
 dix.c:
 	touch $@
diff --git a/dix/Xserver.d b/dix/Xserver.d
index e4c9b83..cea97e9 100644
--- a/dix/Xserver.d
+++ b/dix/Xserver.d
@@ -29,8 +29,13 @@
 /*
  * Xserver dtrace provider definition
  */
-
+#ifdef __APPLE__
+#define string char *
+#define pid_t uint32_t
+#define zoneid_t uint32_t
+#else
 #include <sys/types.h>
+#endif
 
 provider Xserver {
 	/* reqType, data, length, client id, request buffer */
diff --git a/os/Makefile.am b/os/Makefile.am
index f89da6b..9ce8ff2 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -41,6 +41,7 @@ endif
 EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \
      $(XDMCP_SRCS) $(STRLCAT_SRCS)
 
+if !XQUARTZ
 if XSERVER_DTRACE
 # Generate dtrace object code for probes in libos & libdix
 dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS)
@@ -51,6 +52,7 @@ noinst_PROGRAMS = os.O
 os.O: dtrace.o $(am_libos_la_OBJECTS)
 	ld -r -o $@ dtrace.o .libs/*.o
 endif
+endif
 
 os.c:
 	touch $@

commit cf2e3312cff3f341e9edba8c321a4ca7ffd8748e
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 23:09:51 2009 -0700

    Rootless: Correct border rendering on parent-relative windows
    
    Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 6ce56ee..1c9c3a4 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -518,6 +518,14 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
 	REGION_DESTROY( pWin->drawable.pScreen, exposures);
 }
 
+#ifdef ROOTLESS
+/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */
+void RootlessSetPixmapOfAncestors(WindowPtr pWin);
+void RootlessStartDrawing(WindowPtr pWin);
+void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
+Bool IsFramedWindow(WindowPtr pWin);
+#endif 
+
 void
 miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 {
@@ -543,6 +551,19 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef ROOTLESS
+    if(IsFramedWindow(pWin)) {
+        RootlessStartDrawing(pWin);
+        RootlessDamageRegion(pWin, prgn);
+    
+        if(pWin->backgroundState == ParentRelative) {
+            if((what == PW_BACKGROUND) || 
+               (what == PW_BORDER && !pWin->borderIsPixel))
+                RootlessSetPixmapOfAncestors(pWin);
+        }
+    }
+#endif
+    
     if (what == PW_BACKGROUND)
     {
 	while (pWin->backgroundState == ParentRelative)
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 31c0284..c233393 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -1,3 +1,4 @@
+
 /***********************************************************
 
 Copyright 1987, 1998  The Open Group
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index e273d0e..d43301f 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1684,3 +1684,29 @@ RootlessShowAllWindows (void)
         RootlessScreenExpose (pScreen);
     }
 }
+
+/*
+ * SetPixmapOfAncestors
+ *  Set the Pixmaps on all ParentRelative windows up the ancestor chain.
+ */
+void
+RootlessSetPixmapOfAncestors(WindowPtr pWin)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    WindowPtr topWin = TopLevelParent(pWin);
+    RootlessWindowRec *topWinRec = WINREC(topWin);
+    
+    while (pWin->backgroundState == ParentRelative) {
+        if (pWin == topWin) {
+            // disallow ParentRelative background state on top level
+            XID pixel = 0;
+            ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
+            RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
+            break;
+        }
+        
+        pWin = pWin->parent;
+        pScreen->SetWindowPixmap(pWin, topWinRec->pixmap);
+    }
+}
+

commit dadab5a2279a19dcf709402d7f22f0cd48670db0
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 23:00:59 2009 -0700

    XQuartz: Fix QuartzSetCursor to match the expected prototype.

diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index 84291a9..b577fc0 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -212,7 +212,7 @@ QuartzUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
  *  Set the cursor sprite and position.
  */
 static void
-QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
+QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 {
     QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
 
@@ -407,5 +407,5 @@ QuartzResumeXCursor(ScreenPtr pScreen)
     if (pCursor == NULL)
         return;
 
-    QuartzSetCursor(darwinPointer, pScreen, pCursor);
+    QuartzSetCursor(darwinPointer, pScreen, pCursor, /* x */ 0, /* y */ 0);
 }

commit 54000bdcbca52a2de31f7c1a1147de6d8e9dbbb8
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 22:57:25 2009 -0700

    XQuartz: Fix a bunch of compilation warnings about style

diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index fee665d..f926778 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -277,7 +277,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
     (c-1)->next = NULL;
 
     if (c - visualConfigs != numConfigs) {
-        FatalError("numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n", numConfigs, c - visualConfigs);
+        FatalError("numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n", numConfigs, (int)(c - visualConfigs));
     }
     
     freeGlCapabilities(&caps);
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index ad022c9..749a893 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -243,23 +243,26 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
             if(!for_appkit) {
                 NSPoint NSlocation = [e locationInWindow];
                 NSWindow *window = [e window];
-                
+                NSRect NSframe, NSvisibleFrame;
+                CGRect CGframe, CGvisibleFrame;
+                CGPoint CGlocation;
+
                 if (window != nil)	{
                     NSRect frame = [window frame];
                     NSlocation.x += frame.origin.x;
                     NSlocation.y += frame.origin.y;
                 }
 
-                NSRect NSframe = [[NSScreen mainScreen] frame];
-                NSRect NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
+                NSframe = [[NSScreen mainScreen] frame];
+                NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
                 
-                CGRect CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
+                CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
                                             NSframe.size.width, NSframe.size.height);
-                CGRect CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
+                CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
                                                    NSvisibleFrame.origin.y,
                                                    NSvisibleFrame.size.width,
                                                    NSvisibleFrame.size.height);
-                CGPoint CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
+                CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
                 
                 if(CGRectContainsPoint(CGframe, CGlocation) &&
                    !CGRectContainsPoint(CGvisibleFrame, CGlocation))
@@ -334,6 +337,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                 case NSApplicationActivatedEventType:
                     for_x = NO;
                     if ([self modalWindow] == nil) {
+                        BOOL switch_on_activate, ok;
                         for_appkit = NO;
                         
                         /* FIXME: hack to avoid having to pass the event to appkit,
@@ -344,7 +348,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                         
                         /* Get the Spaces preference for SwitchOnActivate */
                         (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
-                        BOOL switch_on_activate, ok;
                         switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
                         if(!ok)
                             switch_on_activate = YES;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index f58747e..d8d23ec 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -632,6 +632,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
 
 - (IBAction)prefs_changed:sender
 {
+    BOOL pbproxy_active;
+
     darwinFakeButtons = [fake_buttons intValue];
     quartzUseSysBeep = [use_sysbeep intValue];
     X11EnableKeyEquivalents = [enable_keyequivs intValue];
@@ -653,7 +655,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
     [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]];
     [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]];
 
-    BOOL pbproxy_active = [sync_pasteboard intValue];
+    pbproxy_active = [sync_pasteboard intValue];
 
     [NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active];
     [NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[sync_pasteboard_to_clipboard intValue]];
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 14be180..d2cca13 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -210,10 +210,7 @@ updateEventMask (WMEventPtr *pHead)
 
 /*ARGSUSED*/
 static int
-WMFreeClient (data, id)
-    pointer     data;
-    XID         id;
-{
+WMFreeClient (pointer data, XID id) {
     WMEventPtr   pEvent;
     WMEventPtr   *pHead, pCur, pPrev;
 
@@ -237,10 +234,7 @@ WMFreeClient (data, id)
 
 /*ARGSUSED*/
 static int
-WMFreeEvents (data, id)
-    pointer     data;
-    XID         id;
-{
+WMFreeEvents (pointer data, XID id) {
     WMEventPtr   *pHead, pCur, pNext;
 
     pHead = (WMEventPtr *) data;
@@ -344,10 +338,7 @@ ProcAppleWMSelectInput (register ClientPtr client)
  */
 
 void
-AppleWMSendEvent (type, mask, which, arg)
-    int type, which, arg;
-    unsigned int mask;
-{
+AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
     WMEventPtr      *pHead, pEvent;
     ClientPtr       client;
     xAppleWMNotifyEvent se;
@@ -712,9 +703,7 @@ ProcAppleWMDispatch (
 }
 
 static void
-SNotifyEvent(from, to)
-    xAppleWMNotifyEvent *from, *to;
-{
+SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to) {
     to->type = from->type;
     to->kind = from->kind;
     cpswaps (from->sequenceNumber, to->sequenceNumber);
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index d300cce..421efce 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -513,13 +513,14 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
 void DarwinSendScrollEvents(float count_x, float count_y, 
 							float pointer_x, float pointer_y, 
 			    			float pressure, float tilt_x, float tilt_y) {
+	int sign_x, sign_y;
 	if(!darwinEvents) {
 		DEBUG_LOG("DarwinSendScrollEvents called before darwinEvents was initialized\n");
 		return;
 	}
 
-	int sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
-	int sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
+	sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
+	sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
 	count_x = fabs(count_x);
 	count_y = fabs(count_y);
 	
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index e887c46..917bbaf 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -149,15 +149,17 @@ static int accept_fd_handoff(int connected_fd) {
     char databuf[] = "display";
     struct iovec iov[1];
     
-    iov[0].iov_base = databuf;
-    iov[0].iov_len  = sizeof(databuf);
-    
     union {
         struct cmsghdr hdr;
         char bytes[CMSG_SPACE(sizeof(int))];
     } buf;
     
     struct msghdr msg;
+    struct cmsghdr *cmsg;
+
+    iov[0].iov_base = databuf;
+    iov[0].iov_len  = sizeof(databuf);
+    
     msg.msg_iov = iov;
     msg.msg_iovlen = 1;
     msg.msg_control = buf.bytes;
@@ -166,7 +168,7 @@ static int accept_fd_handoff(int connected_fd) {
     msg.msg_namelen = 0;
     msg.msg_flags = 0;
     
-    struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+    cmsg = CMSG_FIRSTHDR (&msg);
     cmsg->cmsg_level = SOL_SOCKET;
     cmsg->cmsg_type = SCM_RIGHTS;
     cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -197,6 +199,7 @@ static void socket_handoff_thread(void *arg) {
     socket_handoff_t *handoff_data = (socket_handoff_t *)arg;
     int launchd_fd = -1;
     int connected_fd;
+    unsigned remain;
 
     /* Now actually get the passed file descriptor from this connection
      * If we encounter an error, keep listening.
@@ -229,7 +232,7 @@ static void socket_handoff_thread(void *arg) {
      * into it.
      */
     
-    unsigned remain = 3000000;
+    remain = 3000000;
     fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
     while((remain = usleep(remain)) > 0);
     
@@ -626,11 +629,11 @@ static char *command_from_prefs(const char *key, const char *default_value) {
     
     if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
         CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
+        int len = strlen(default_value) + 1;
 
         CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
         CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
         
-        int len = strlen(default_value) + 1;
         command = (char *)malloc(len * sizeof(char));
         if(!command)
             return NULL;
diff --git a/hw/xquartz/mach-startup/launchd_fd.c b/hw/xquartz/mach-startup/launchd_fd.c
index fa623ea..6dace8e 100644
--- a/hw/xquartz/mach-startup/launchd_fd.c
+++ b/hw/xquartz/mach-startup/launchd_fd.c
@@ -36,7 +36,7 @@
 
 #include "launchd_fd.h"
 
-int launchd_display_fd() {
+int launchd_display_fd(void) {
     launch_data_t sockets_dict, checkin_request, checkin_response;
     launch_data_t listening_fd_array, listening_fd;
 
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index fd831a8..3d22db5 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -69,13 +69,12 @@ static char x11_path[PATH_MAX + 1];
 
 static pid_t x11app_pid = 0;
 
-static void set_x11_path() {
+static void set_x11_path(void) {
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 
     CFURLRef appURL = NULL;
     CFBundleRef bundle = NULL;
     OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
-    UInt32 ver;
 
     switch (osstatus) {
         case noErr:
@@ -148,15 +147,17 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
     char databuf[] = "display";
     struct iovec iov[1];
     
-    iov[0].iov_base = databuf;
-    iov[0].iov_len  = sizeof(databuf);
-
     union {
         struct cmsghdr hdr;
         char bytes[CMSG_SPACE(sizeof(int))];
     } buf;
     
     struct msghdr msg;
+    struct cmsghdr *cmsg;
+
+    iov[0].iov_base = databuf;
+    iov[0].iov_len  = sizeof(databuf);
+
     msg.msg_iov = iov;
     msg.msg_iovlen = 1;
     msg.msg_control = buf.bytes;
@@ -165,7 +166,7 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
     msg.msg_namelen = 0;
     msg.msg_flags = 0;
 
-    struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+    cmsg = CMSG_FIRSTHDR (&msg);
     cmsg->cmsg_level = SOL_SOCKET;
     cmsg->cmsg_type = SCM_RIGHTS;
     cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -231,10 +232,11 @@ int main(int argc, char **argv, char **envp) {
 
     kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
     if(kr != KERN_SUCCESS) {
+        pid_t child;
         set_x11_path();
 
         /* This forking is ugly and will be cleaned up later */
-        pid_t child = fork();
+        child = fork();
         if(child == -1) {
             fprintf(stderr, "Xquartz: Could not fork: %s\n", strerror(errno));
             return EXIT_FAILURE;
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 6493313..c4142a8 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -366,7 +366,7 @@ void QuartzSetRootless(Bool state) {
  *  Calls mode specific screen resume to restore the X clip regions
  *  (if needed) and the X server cursor state.
  */
-void QuartzShow() {
+void QuartzShow(void) {
     int i;
 
     if (quartzServerVisible)
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 64ef122..b1a3f31 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -130,4 +130,6 @@ void QuartzSpaceChanged(uint32_t space_id);
 
 void QuartzSetFullscreen(Bool state);
 void QuartzSetRootless(Bool state);
+
+int server_main(int argc, char **argv, char **envp);
 #endif
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 8cf2417..af63d18 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -311,8 +311,10 @@ void QuartzAudioInit(void)
 
     // Prepare for playback
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+    {
     AudioDeviceIOProcID sInputIOProcID = NULL;
     status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID );
+    }
 #else
     status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
 #endif
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 835ccab..74a4ec3 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -255,10 +255,10 @@ ProcAppleDRIDestroySurface(
     register ClientPtr client
 )
 {
+    int rc;
     REQUEST(xAppleDRIDestroySurfaceReq);
     DrawablePtr pDrawable;
     REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
-    int rc;
 
     rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
 			   DixReadAccess);
diff --git a/hw/xquartz/xpr/x-hash.h b/hw/xquartz/xpr/x-hash.h
index 78bc7b3..f876b6b 100644
--- a/hw/xquartz/xpr/x-hash.h
+++ b/hw/xquartz/xpr/x-hash.h
@@ -72,7 +72,7 @@ X_PFX (cvt_vptr_to_uint) (void * val) __attribute__((always_inline));
 static __inline__ void *
 X_PFX (cvt_uint_to_vptr) (unsigned int val)
 {
-	return (void*)((size_t)(val));
+	return (void*)((unsigned long)(val));
 }
 
 static __inline__ unsigned int
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 6635f08..a3e2076 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -215,10 +215,10 @@ xprDestroyFrame(RootlessFrameID wid)
 static void
 xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
 {
-    TA_SERVER();
-    
     xp_window_changes wc;
 
+    TA_SERVER();
+    
     wc.x = newX;
     wc.y = newY;
     //    ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
@@ -272,7 +272,7 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
     }
 
     if(window_hash) {
-        RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr((xp_window_id)wid), NULL);
+        RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, wid, NULL);
 
         if(winRec) {
             if(quartzEnableRootless)
@@ -566,8 +566,8 @@ xprHideWindows(Bool hide)
     TA_SERVER();
     
     for (screen = 0; screen < screenInfo.numScreens; screen++) {
-        pRoot = WindowTable[screenInfo.screens[screen]->myNum];
         RootlessFrameID prevWid = NULL;
+        pRoot = WindowTable[screenInfo.screens[screen]->myNum];
 
         for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
             RootlessWindowRec *winRec = WINREC(pWin);
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 3387ecf..22a727e 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -317,11 +317,11 @@ xprAddScreen(int index, ScreenPtr pScreen)
 
     if (noPseudoramiXExtension)
     {
-        ErrorF("Warning: noPseudoramiXExtension!\n");
-        
         CGDirectDisplayID dpy;
         CGRect frame;
 
+        ErrorF("Warning: noPseudoramiXExtension!\n");
+        
         dpy = displayAtIndex(index);
 
         frame = displayScreenBounds(dpy);

commit 29cb904e4de2411a9b6dbe68694954788f0525f7
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 22:29:49 2009 -0700

    XQuartz: Nuke TSM
    
    It's deprecated in SnowLeopard.  Ben and I both have no idea what it is for.  It says something about unicode input, but urxvt seems fine taking in unicode, so /shrug... bye.

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3cf7a77..ad022c9 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -184,9 +184,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
 }
 
 - (void) activateX:(OSX_BOOL)state {
-    /* Create a TSM document that supports full Unicode input, and
-     have it activated while X is active */
-    static TSMDocumentID x11_document;
     size_t i;
     DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
     if (state) {
@@ -195,16 +192,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
             bgMouseLocationUpdated = FALSE;
         }
         DarwinSendDDXEvent(kXquartzActivate, 0);
-
-        if (!_x_active) {
-            if (x11_document == 0) {
-                OSType types[1];
-                types[0] = kUnicodeDocument;
-                NewTSMDocument (1, types, &x11_document, 0);
-            }
-
-            if (x11_document != 0)	ActivateTSMDocument (x11_document);
-        }
     } else {
 
         if(darwin_all_modifier_flags)
@@ -217,9 +204,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
         }
         
         DarwinSendDDXEvent(kXquartzDeactivate, 0);
-
-        if (_x_active && x11_document != 0)
-            DeactivateTSMDocument (x11_document);
     }
 
     _x_active = state;

commit de6cee11e1c335a0e5f708e7641e81d3cfe52529
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 22:26:22 2009 -0700

    XQuartz: Fix inverse map from mode_switch to alt

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index b3a4ecc..d36d967 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -251,6 +251,10 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
                 break;
 
             case XK_Mode_switch:
+                info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
+#ifdef NX_MODIFIERKEY_RALTERNATE
+                info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
+#endif
                 info->modMap[MIN_KEYCODE + i] = Mod1Mask;
                 break;
 

commit 7e6640b55503b6ee797ab2589f7debcbfa531958
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Sep 28 12:20:03 2009 +1000

    Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus"
    
    The vesa driver still uses slowbcopy_frombus and slowbcopy_tobus.
    
    This reverts commit 5ef53a94ce4e48e11de26290cd677266308640c8.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index cdb493a..a450bd6 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1211,6 +1211,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
+extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
+extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
 
 /* Some macros to hide the system dependencies for MMIO accesses */
 /* Changed to kill noise generated by gcc's -Wcast-align */
@@ -1342,4 +1344,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
 #  define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
 
 # endif /* __alpha__ */
+
+/*
+ * With Intel, the version in os-support/misc/SlowBcopy.s is used.
+ * This avoids port I/O during the copy (which causes problems with
+ * some hardware).
+ */
+# ifdef __alpha__
+#  define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
+#  define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
+# else /* __alpha__ */
+#  define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
+#  define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
+# endif /* __alpha__ */
+
 #endif /* _COMPILER_H */
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index 8a5017e..182a3e6 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -1,8 +1,15 @@
+/*******************************************************************************
+  for Alpha Linux
+*******************************************************************************/
+ 
 /* 
  *   Create a dependency that should be immune from the effect of register
  *   renaming as is commonly seen in superscalar processors.  This should
  *   insert a minimum of 100-ns delays between reads/writes at clock rates
  *   up to 100 MHz---GGL
+ *   
+ *   Slowbcopy(char *src, char *dst, int count)   
+ *   
  */ 
 
 #ifdef HAVE_XORG_CONFIG_H
@@ -47,3 +54,48 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
     while(len--)
 	*dst++ = *src++;
 }
+
+#ifdef __alpha__
+
+#ifdef linux
+
+#define SPARSE (7)
+
+#else
+
+#define SPARSE 0
+
+#endif
+
+void
+xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
+{
+    unsigned long addr;
+    long result;
+
+    addr = (unsigned long) src;
+    while( count ){
+	result = *(volatile int *) addr;
+	result >>= ((addr>>SPARSE) & 3) * 8;
+	*dst++ = (unsigned char) (0xffUL & result);
+	addr += 1<<SPARSE;
+	count--;
+	outb(0x80, 0x00);
+    }
+}
+  
+void
+xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
+{
+    unsigned long addr;
+
+    addr = (unsigned long) dst;
+    while(count) {
+	*(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
+	src++;
+	addr += 1<<SPARSE;
+	count--;
+	outb(0x80, 0x00);
+    }
+}
+#endif
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index a615a1d..40afd5b 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
 		return(-1);
 	}
 
-	xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
+	xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
 
 	munmap((caddr_t)base, mlen);
 	close(fd);
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 025dde2..004376b 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->FontInfo1) {
 	hwp->writeSeq(hwp, 0x02, 0x04);	/* write to plane 2 */
 	hwp->writeGr(hwp, 0x04, 0x02);	/* read plane 2 */
-	xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
+	slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
     }
 #endif
 
@@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->FontInfo2) {
 	hwp->writeSeq(hwp, 0x02, 0x08);	/* write to plane 3 */
 	hwp->writeGr(hwp, 0x04, 0x03);	/* read plane 3 */
-	xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
+	slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
     }
 #endif
 
@@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->TextInfo) {
 	hwp->writeSeq(hwp, 0x02, 0x01);	/* write to plane 0 */
 	hwp->writeGr(hwp, 0x04, 0x00);	/* read plane 0 */
-	xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
+	slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
 	hwp->writeSeq(hwp, 0x02, 0x02);	/* write to plane 1 */
 	hwp->writeGr(hwp, 0x04, 0x01);	/* read plane 1 */
-	xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
+	slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
 			hwp->Base, TEXT_AMOUNT);
     }
 #endif
@@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
     if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x04);	/* write to plane 2 */
 	hwp->writeGr(hwp, 0x04, 0x02);	/* read plane 2 */
-	xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
     }
 #endif /* SAVE_FONT1 */
 #if SAVE_FONT2
     if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x08);	/* write to plane 3 */
 	hwp->writeGr(hwp, 0x04, 0x03);	/* read plane 3 */
-	xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
     }
 #endif /* SAVE_FONT2 */
 #if SAVE_TEXT
     if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x01);	/* write to plane 0 */
 	hwp->writeGr(hwp, 0x04, 0x00);	/* read plane 0 */
-	xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
 	hwp->writeSeq(hwp, 0x02, 0x02);	/* write to plane 1 */
 	hwp->writeGr(hwp, 0x04, 0x01);	/* read plane 1 */
-	xf86SlowBcopy(hwp->Base,
+	slowbcopy_frombus(hwp->Base,
 		(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
     }
 #endif /* SAVE_TEXT */

commit ceaa5c779ceed3de5ea53727649613be3133b24e
Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
Date:   Sun Sep 27 18:25:57 2009 -0700

    XQuartz: Force a keymap resync on the first keypress to workaround XKB mucking with our keymap.
    
    We need to find a better way to work with XKB on this.

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 9fb1926..3cf7a77 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1180,6 +1180,17 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
             break;
             
         case NSKeyDown: case NSKeyUp:
+            {
+                /* XKB clobbers our keymap at startup, so we need to force it on the first keypress.
+                 * TODO: Make this less of a kludge.
+                 */
+                static int force_resync_keymap = YES;
+                if(force_resync_keymap) {
+                    DarwinSendDDXEvent(kXquartzReloadKeymap, 0);
+                    force_resync_keymap = NO;
+                }
+            }
+
             if(darwinSyncKeymap) {
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050


Reply to: