diff --git a/src/core/mac_startup.mm b/src/core/mac_startup.mm index 36dc1b494..eb4a10c0f 100644 --- a/src/core/mac_startup.mm +++ b/src/core/mac_startup.mm @@ -12,6 +12,7 @@ #import +#include "config.h" #include "globalshortcuts.h" #include "mac_startup.h" #include "macglobalshortcutbackend.h" @@ -38,7 +39,7 @@ - (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat; @end -#ifdef MAC_OS_X_VERSION_10_6 +#ifdef SNOW_LEOPARD @interface AppDelegate :NSObject { #else @interface AppDelegate :NSObject { diff --git a/src/core/macglobalshortcutbackend.mm b/src/core/macglobalshortcutbackend.mm index 8b8292071..11144a0c7 100644 --- a/src/core/macglobalshortcutbackend.mm +++ b/src/core/macglobalshortcutbackend.mm @@ -41,7 +41,7 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable { } bool Register() { - #ifdef NS_BLOCKS_AVAILABLE + #ifdef SNOW_LEOPARD global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent* event) { HandleKeyEvent(event); @@ -58,8 +58,10 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable { } void Unregister() { + #ifdef SNOW_LEOPARD [NSEvent removeMonitor:global_monitor_]; [NSEvent removeMonitor:local_monitor_]; + #endif } private: @@ -222,10 +224,15 @@ void MacGlobalShortcutBackend::KeyPressed(const QKeySequence& sequence) { } bool MacGlobalShortcutBackend::IsAccessibilityEnabled() const { +#ifdef SNOW_LEOPARD return AXAPIEnabled(); +#else + return true; // It's not really enabled but it doesn't matter. +#endif } void MacGlobalShortcutBackend::ShowAccessibilityDialog() { +#ifdef SNOW_LEOPARD NSArray* paths = NSSearchPathForDirectoriesInDomains( NSPreferencePanesDirectory, NSSystemDomainMask, YES); if ([paths count] == 1) { @@ -233,4 +240,5 @@ void MacGlobalShortcutBackend::ShowAccessibilityDialog() { [[paths objectAtIndex:0] stringByAppendingPathComponent:@"UniversalAccessPref.prefPane"]]; [[NSWorkspace sharedWorkspace] openURL:prefpane_url]; } +#endif }