From 4acbaa3027d89728ed932616f6ef66d93537b101 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 7 May 2012 16:16:20 -0700 Subject: [PATCH 1/5] XQuartz: Workaround an SDK bug on Leopard/x86_64 Signed-off-by: Jeremy Huddleston --- hw/xquartz/quartz.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index ebaa56785..62a2852b7 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -69,6 +69,12 @@ #include #include +/* 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; From e0097ce9719f9b0aeccf7102630c0299f8acdf93 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 7 May 2012 16:31:38 -0700 Subject: [PATCH 2/5] XQuartz: Tiger build fix http://trac.macports.org/ticket/34364 Regression-from: 662d41acdde1dcb9774fbe4054e251c708acaffe Reported-by: Peter Dyballa Signed-off-by: Jeremy Huddleston --- hw/xquartz/X11Application.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 0c3283ed0..9f4c9b71e 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1641,6 +1641,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]; @@ -1662,6 +1667,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 From f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 7 May 2012 17:07:27 -0700 Subject: [PATCH 3/5] XQuartz: Provide fls implementation for Tiger Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Signed-off-by: Jeremy Huddleston --- hw/xquartz/console_redirect.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 1e0e56bad..91d693b67 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) { From c495211373a118acee02a29c6eb25a332abc856c Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 17 May 2012 16:20:30 -0700 Subject: [PATCH 4/5] XQuartz: Declare noPseudoramiXExtension for miinitext.c Regression-from: 6699f54fe0b3f4952a75e46fb6c3a643988e65dd Signed-off-by: Jeremy Huddleston --- include/globals.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/globals.h b/include/globals.h index d147df90f..8076955a9 100644 --- a/include/globals.h +++ b/include/globals.h @@ -104,6 +104,10 @@ extern _X_EXPORT Bool noXFixesExtension; extern _X_EXPORT Bool noPanoramiXExtension; #endif +#ifdef INXQUARTZ +extern _X_EXPORT Bool noPseudoramiXExtension; +#endif + #ifdef XSELINUX extern _X_EXPORT Bool noSELinuxExtension; From acdc4f54ee5784d26c251ff8c941b4360ae80e9b Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 17 May 2012 10:08:02 -0700 Subject: [PATCH 5/5] XQuartz: Avoid a race in initialization of darwinPointer http://xquartz.macosforge.org/trac/ticket/579 Signed-off-by: Jeremy Huddleston --- hw/xquartz/X11Application.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 9f4c9b71e..1f9b05dd1 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1329,6 +1329,11 @@ untrusted_str(NSEvent *e) } #endif +extern void +darwinEvents_lock(void); +extern void +darwinEvents_unlock(void); + - (void) sendX11NSEvent:(NSEvent *)e { NSPoint location = NSZeroPoint; @@ -1341,18 +1346,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 ||