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

Jeremy Huddleston jeremyhu at freedesktop.org
Wed Nov 11 18:00:27 PST 2009


Rebased ref, commits from common ancestor:
commit 9071b0d69748cfa7ecca17b4cb0e431bbb0ef2a4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon Nov 9 13:09:55 2009 -0800

    XQuartz: Explicitly pass a bellProc to make XBell() work again.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index c504762..62b2ebb 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -184,6 +184,12 @@ 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
 //-----------------------------------------------------------------------------
@@ -297,7 +303,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     /* We need to really have rules... or something... */
     //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
 
-    InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
+    InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
 
     DarwinKeyboardReloadHandler();
 
commit e87a03fd531ce7974877688680d3bf9b85c2d835
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue Oct 27 17:16:57 2009 -0700

    XQuartz: pbproxy: Wait for the server to finish starting up, so display is valid.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index d4b43c6..f3f683a 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -37,7 +37,11 @@
 static const char *app_prefs_domain = "org.x.X11";
 CFStringRef app_prefs_domain_cfstr;
 
+/* Stubs */
 char *display = NULL;
+BOOL serverInitComplete = YES;
+pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER;
 
 static void signal_handler (int sig) {
     switch(sig) {
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index 5bc5182..d26b1b1 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -47,6 +47,20 @@ BOOL xpbproxy_is_standalone = NO;
 
 x_selection *_selection_object;
 
+extern BOOL serverInitComplete;
+extern pthread_mutex_t serverInitCompleteMutex;
+extern pthread_cond_t serverInitCompleteCond;
+
+static inline void wait_for_server_init(void) {
+    /* If the server hasn't finished initializing, wait for it... */
+    if(!serverInitComplete) {
+        pthread_mutex_lock(&serverInitCompleteMutex);
+        while(!serverInitComplete)
+            pthread_cond_wait(&serverInitCompleteCond, &serverInitCompleteMutex);
+        pthread_mutex_unlock(&serverInitCompleteMutex);
+    }
+}
+
 static int x_io_error_handler (Display *dpy) {
     /* We lost our connection to the server. */
     
@@ -85,6 +99,8 @@ static void *xpbproxy_x_thread(void *args) {
     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);
         
commit 15fc56addcc906592af7c0f4c0a5ac906fa5c389
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sun Nov 8 20:25:42 2009 -0800

    XQuartz: Buildfix for Leopard and older
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index bb28447..9e16f75 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -55,7 +55,11 @@ typedef unsigned int NSUInteger;
 #endif
 #endif
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
 @interface X11Controller : NSObject <NSTableViewDataSource>
+#else
+ at interface X11Controller : NSObject
+#endif
 {
     IBOutlet NSPanel *prefs_panel;
 
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 90f6610..c504762 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -40,6 +40,7 @@
 #define HACK_MISSING 1
 #define HACK_KEYPAD 1
 
+#include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
commit b5aa2e0a5fe233dc883084a5026013472e85bca4
Author: Chase Douglas <chasedouglas at gmail.com>
Date:   Mon Nov 9 22:54:39 2009 -0500

    Move FD_CLR above pInfo->read_input
    
    The event fd may be invalidated by the pInfo->read_input call. If it is
    invalidated, the subsequent FD_CLR call will segfault. Thus, the FD_CLR
    call must precede the pInfo->read_input call.
    
    Signed-off-by: Chase Douglas <chasedouglas at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 9487fe7..8cd765a 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -263,13 +263,14 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
 		    (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
 		    int sigstate = xf86BlockSIGIO();
 
-		    pInfo->read_input(pInfo);
-		    xf86UnblockSIGIO(sigstate);
 		    /*
 		     * Remove the descriptior from the set because more than one
 		     * device may share the same file descriptor.
 		     */
 		    FD_CLR(pInfo->fd, &devicesWithInput);
+
+		    pInfo->read_input(pInfo);
+		    xf86UnblockSIGIO(sigstate);
 		}
 		pInfo = pInfo->next;
 	    }
commit 982f6648fd29d085265bf6035c1bf4d1b2499316
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 10 09:50:50 2009 +1000

    dix: increase default number of buttons to 10.
    
    Currently the XTEST device is limited to the same number of buttons the core
    device has. This breaks if a user has a mouse with more than 3 buttons
    connected and is using a core client to fake button 8+ presses.
    
    Rather than expecting all clients to fix themselves, just increase the
    default number of buttons to 10, which is somewhat a compromise. Ideally,
    the XTEST devices should adjust themselves to the highest number of buttons
    available on the slave devices (like the master pointers already do), but
    that's a taks for another day.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/devices.c b/dix/devices.c
index 7486827..395e19a 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -539,7 +539,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
 int
 CorePointerProc(DeviceIntPtr pDev, int what)
 {
-#define NBUTTONS 7
+#define NBUTTONS 10
 #define NAXES 2
     BYTE map[NBUTTONS + 1];
     int i = 0;


More information about the Xquartz-changes mailing list