summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-21 10:53:39 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-21 10:59:26 -0800
commitb262788401715787c68cea4ca79f4b270307afee (patch)
treeaf0511211eba31c3a65beb4579afbc87c7d2fef5
parent510744444329170f702d31d43997a6bbc1591b44 (diff)
XQuartz: More Tiger ifdefs
(cherry picked from commit 803509072f2c039e5cd555c4ac14d672f0e698c5)
-rw-r--r--hw/xquartz/X11Controller.m11
-rw-r--r--hw/xquartz/darwin.c4
-rw-r--r--hw/xquartz/darwin.h4
-rw-r--r--hw/xquartz/quartzKeyboard.c8
4 files changed, 19 insertions, 8 deletions
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 2668e1ed5..76fbb573a 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -28,6 +28,7 @@
prior written authorization. */
#include "sanitizedCarbon.h"
+#include <AvailabilityMacros.h>
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@@ -152,8 +153,11 @@
item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector
(item_selected:) keyEquivalent:shortcut];
-
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
[item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask];
+#else
+ [item setKeyEquivalentModifierMask:windowItemModMask];
+#endif
[item setTarget:self];
[item setTag:i];
[item setEnabled:YES];
@@ -162,8 +166,11 @@
action:@selector
(item_selected:) keyEquivalent:shortcut
atIndex:i];
-
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
[item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask];
+#else
+ [item setKeyEquivalentModifierMask:windowItemModMask];
+#endif
[item setTarget:self];
[item setTag:i];
[item setEnabled:YES];
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 2959a44eb..3f22508cd 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -114,10 +114,10 @@ int darwinFakeMouse3Mask = NX_COMMANDMASK;
#endif
// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu
-int darwinAppKitModMask = 0; // Any of these bits
+unsigned int darwinAppKitModMask = 0; // Any of these bits
// Modifier mask for items in the Window menu (0 and -1 cause shortcuts to be disabled)
-int windowItemModMask = NX_COMMANDMASK;
+unsigned int windowItemModMask = NX_COMMANDMASK;
// devices
DeviceIntPtr darwinKeyboard = NULL;
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index da5ad74a1..7fb9396e5 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -82,8 +82,8 @@ extern int darwinMouseAccelChange;
extern int darwinFakeButtons;
extern int darwinFakeMouse2Mask;
extern int darwinFakeMouse3Mask;
-extern int darwinAppKitModMask;
-extern int windowItemModMask;
+extern unsigned int darwinAppKitModMask;
+extern unsigned int windowItemModMask;
extern int darwinSyncKeymap;
extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
extern int darwinDesiredDepth;
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 2eb5feeca..9aa9ece5a 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -753,6 +753,11 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
}
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+ if(currentKeyLayoutRef)
+ CFRelease(currentKeyLayoutRef);
+#endif
+
if (chr_data == NULL) {
ErrorF ( "Couldn't get uchr or kchr resource\n");
return FALSE;
@@ -856,7 +861,6 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
k[0] = known_numeric_keys[i].keypad;
}
}
- if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
-
+
return TRUE;
}