xserver: Branch 'server-1.12-branch' - 4 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Tue May 29 13:17:53 PDT 2012


 hw/xquartz/X11Application.m   |   24 ++++++++++++++++--------
 hw/xquartz/console_redirect.c |   14 ++++++++++++++
 hw/xquartz/quartz.c           |    6 ++++++
 3 files changed, 36 insertions(+), 8 deletions(-)

New commits:
commit 19126c0b36843f7c0e81631d1a1228d18e39eb62
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 17 10:08:02 2012 -0700

    XQuartz: Avoid a race in initialization of darwinPointer
    
    http://xquartz.macosforge.org/trac/ticket/579
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit acdc4f54ee5784d26c251ff8c941b4360ae80e9b)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3108399..339a93f 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1281,6 +1281,11 @@ untrusted_str(NSEvent *e)
 }
 #endif
 
+extern void
+darwinEvents_lock(void);
+extern void
+darwinEvents_unlock(void);
+
 - (void) sendX11NSEvent:(NSEvent *)e
 {
     NSPoint location = NSZeroPoint;
@@ -1293,18 +1298,15 @@ untrusted_str(NSEvent *e)
     int modifierFlags;
     BOOL isMouseOrTabletEvent, isTabletEvent;
 
-#ifdef HAVE_LIBDISPATCH
-    static dispatch_once_t once_pred;
-    dispatch_once(&once_pred, ^{
-                      tilt = NSZeroPoint;
-                      darwinTabletCurrent = darwinTabletStylus;
-                  });
-#else
     if (!darwinTabletCurrent) {
+        /* Ensure that the event system is initialized */
+        darwinEvents_lock();
+        darwinEvents_unlock();
+        assert(darwinTabletStylus);
+
         tilt = NSZeroPoint;
         darwinTabletCurrent = darwinTabletStylus;
     }
-#endif
 
     isMouseOrTabletEvent = [e type] == NSLeftMouseDown ||
                            [e type] == NSOtherMouseDown ||
commit 198a876e34b880be5f7da683ec3ff21a53edcec5
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon May 7 17:07:27 2012 -0700

    XQuartz: Provide fls implementation for Tiger
    
    Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417)

diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c
index 1e0e56b..91d693b 100644
--- a/hw/xquartz/console_redirect.c
+++ b/hw/xquartz/console_redirect.c
@@ -310,6 +310,20 @@ xq_asl_init(void)
     atexit(redirect_atexit);
 }
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+#define fls(v) xq_fls(v)
+
+static inline int fls(int value) {
+    unsigned int b, v;
+
+    v = *((unsigned int *)&value);
+
+    for(b=0 ; v ; v >>= 1 , b++);
+
+    return b;
+}
+#endif
+
 int
 xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
 {
commit 300970f8f80ef15614fef78215476a8011895000
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon May 7 16:31:38 2012 -0700

    XQuartz: Tiger build fix
    
    http://trac.macports.org/ticket/34364
    
    Regression-from: 662d41acdde1dcb9774fbe4054e251c708acaffe
    
    Reported-by: Peter Dyballa <Peter_Dyballa at Freenet.DE>
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit e0097ce9719f9b0aeccf7102630c0299f8acdf93)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index b686b00..3108399 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1593,6 +1593,11 @@ handle_mouse:
 
     case NSScrollWheel:
     {
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+        float deltaX = [e deltaX];
+        float deltaY = [e deltaY];
+        BOOL isContinuous = NO;
+#else
         CGFloat deltaX = [e deltaX];
         CGFloat deltaY = [e deltaY];
         CGEventRef cge = [e CGEvent];
@@ -1614,6 +1619,7 @@ handle_mouse:
             deltaY *= lineHeight / 5.0;
         }
 #endif
+#endif
         
 #if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0
         /* If we're in the background, we need to send a MotionNotify event
commit 21956e2f8e506dd167f188be0d3b18e052c6913d
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon May 7 16:16:20 2012 -0700

    XQuartz: Workaround an SDK bug on Leopard/x86_64
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 4acbaa3027d89728ed932616f6ef66d93537b101)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index ebaa567..62a2852 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -69,6 +69,12 @@
 #include <rootlessCommon.h>
 #include <Xplugin.h>
 
+/* Work around a bug on Leopard's headers */
+#if defined (__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 && MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+extern OSErr UpdateSystemActivity(UInt8 activity);
+#define OverallAct 0
+#endif
+
 DevPrivateKeyRec quartzScreenKeyRec;
 int aquaMenuBarHeight = 0;
 QuartzModeProcsPtr quartzProcs = NULL;


More information about the xorg-commit mailing list