]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/util_darwin.m
compatibility fix: get_clocktime() is not always available
[proxmark3-svn] / client / util_darwin.m
index d07ebebc40e3cf6f80b3bf7a5e825fd6290daf09..c0f69aa92f74a973d570186553883d3245ac1a6e 100644 (file)
@@ -12,6 +12,7 @@
 
 #import <Foundation/NSString.h>
 #import <Foundation/NSProcessInfo.h>
+#import <AppKit/NSApplication.h>
 
 static id activity = nil;
 
@@ -38,3 +39,17 @@ void enableAppNap() {
 void disableAppNap(const char* reason) { }
 void enableAppNap() { }
 #endif
+
+//OS X Version 10.6 is defined in OS X 10.6 and later
+#if defined(MAC_OS_X_VERSION_10_6)
+void makeUnfocusable() {
+       [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
+}
+
+void makeFocusable() {
+       [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+}
+#else
+void makeUnfocusable() { }
+void makeFocusable() { }
+#endif
Impressum, Datenschutz