diff options
author | marha <marha@users.sourceforge.net> | 2011-07-26 12:48:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-26 12:48:28 +0200 |
commit | dc23661fa1d58aa98d67fae47a919de452b8cd28 (patch) | |
tree | 0a8c7987f3756290e3ba9cfb8cdf23d6e9532037 /xorg-server/hw/xquartz/X11Application.m | |
parent | 8680f93ff96770b0a022596d8d4092a29c586435 (diff) | |
parent | ece07bdeaa82ea59e74bcfc588bcabe5e47567c1 (diff) | |
download | vcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.tar.gz vcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.tar.bz2 vcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
libX11/specs/libX11/CH11.xml
mesalib/src/glsl/main.cpp
mesalib/src/mesa/main/compiler.h
mesalib/src/mesa/main/get.c
mesalib/src/mesa/main/texcompress.c
mesalib/src/mesa/main/texparam.c
mesalib/src/mesa/program/ir_to_mesa.cpp
mesalib/src/mesa/program/prog_optimize.c
pixman/pixman/pixman-fast-path.c
pixman/pixman/pixman-fast-path.h
xorg-server/hw/xquartz/GL/indirect.c
xorg-server/hw/xquartz/X11Application.h
xorg-server/hw/xquartz/X11Application.m
xorg-server/hw/xquartz/bundle/Resources/French.lproj/locversion.plist
xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib
xorg-server/hw/xquartz/bundle/Resources/German.lproj/locversion.plist
xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib
xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist
xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib
xorg-server/hw/xquartz/darwinEvents.c
xorg-server/hw/xquartz/darwinEvents.h
xorg-server/hw/xquartz/man/Xquartz.man
xorg-server/hw/xquartz/xpr/dri.c
xorg-server/xkeyboard-config/symbols/ee
Diffstat (limited to 'xorg-server/hw/xquartz/X11Application.m')
-rw-r--r-- | xorg-server/hw/xquartz/X11Application.m | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m index d30ff3aa9..38c17665b 100644 --- a/xorg-server/hw/xquartz/X11Application.m +++ b/xorg-server/hw/xquartz/X11Application.m @@ -79,6 +79,11 @@ static TISInputSourceRef last_key_layout; static KeyboardLayoutRef last_key_layout;
#endif
+/* This preference is only tested on Lion or later as it's not relevant to
+ * earlier OS versions.
+ */
+Bool XQuartzScrollInDeviceDirection = FALSE;
+
extern int darwinFakeButtons;
/* Store the mouse location while in the background, and update X11's pointer
@@ -787,6 +792,9 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
default:FALSE];
+
+ XQuartzScrollInDeviceDirection = [self prefs_get_boolean:@PREFS_SCROLL_IN_DEV_DIRECTION
+ default:XQuartzScrollInDeviceDirection];
#if XQUARTZ_SPARKLE
NSURL *url = [self prefs_copy_url:@PREFS_UPDATE_FEED default:nil];
@@ -1004,6 +1012,11 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { app_prefs_domain_cfstr = (CFStringRef)[[NSBundle mainBundle] bundleIdentifier];
+ if (app_prefs_domain_cfstr == NULL) {
+ ErrorF("X11ApplicationMain: Unable to determine bundle identifier. Your installation of XQuartz may be broken.\n");
+ app_prefs_domain_cfstr = @BUNDLE_ID_PREFIX".X11";
+ }
+
[NSApp read_defaults];
[NSBundle loadNibNamed:@"main" owner:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:NSApp
@@ -1334,20 +1347,30 @@ static const char *untrusted_str(NSEvent *e) { break;
case NSScrollWheel:
+ {
+ float deltaX = [e deltaX];
+ float deltaY = [e deltaY];
#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0
- /* If we're in the background, we need to send a MotionNotify event
- * first, since we aren't getting them on background mouse motion
- */
- if(!XQuartzServerVisible && noTestExtensions) {
- bgMouseLocationUpdated = FALSE;
- DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, location.x,
- location.y, pressure, tilt.x, tilt.y);
- }
+ /* If we're in the background, we need to send a MotionNotify event
+ * first, since we aren't getting them on background mouse motion
+ */
+ if(!XQuartzServerVisible && noTestExtensions) {
+ bgMouseLocationUpdated = FALSE;
+ DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, location.x,
+ location.y, pressure, tilt.x, tilt.y);
+ }
#endif
- DarwinSendScrollEvents([e deltaX], [e deltaY], location.x, location.y,
- pressure, tilt.x, tilt.y);
- break;
-
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ // TODO: Change 1117 to NSAppKitVersionNumber10_7 when it is defined
+ if(NSAppKitVersionNumber >= 1117 && XQuartzScrollInDeviceDirection && [e isDirectionInvertedFromDevice]) {
+ deltaX *= -1;
+ deltaY *= -1;
+ }
+#endif
+ DarwinSendScrollEvents(deltaX, deltaY, location.x, location.y,
+ pressure, tilt.x, tilt.y);
+ break;
+ }
case NSKeyDown: case NSKeyUp:
{
/* XKB clobbers our keymap at startup, so we need to force it on the first keypress.
|