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 #ifdef HAVE_DIX_CONFIG_H #include @@ -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; }