aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/X11Application.m
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-21 09:10:35 +0200
committermarha <marha@users.sourceforge.net>2012-05-21 09:10:35 +0200
commitf543ceaca6820260f15a4eff86938214cf43c7d2 (patch)
treed66901c0385bd008ba46600be695c500daa78c8f /xorg-server/hw/xquartz/X11Application.m
parent062c45ff0df6a52080dcd74433710d47127cbe29 (diff)
downloadvcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.tar.gz
vcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.tar.bz2
vcxsrv-f543ceaca6820260f15a4eff86938214cf43c7d2.zip
fontconfig mesa xkeyboard-config xserver pixman git update 21 Mar 2012
Diffstat (limited to 'xorg-server/hw/xquartz/X11Application.m')
-rw-r--r--xorg-server/hw/xquartz/X11Application.m24
1 files changed, 16 insertions, 8 deletions
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m
index 0c3283ed0..1f9b05dd1 100644
--- a/xorg-server/hw/xquartz/X11Application.m
+++ b/xorg-server/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 ||
@@ -1641,6 +1643,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 +1669,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